Skip to content

Commit

Permalink
V2 update (#2391)
Browse files Browse the repository at this point in the history
* fix: getStreamURL docs (#2257)

* chore(release): 1.7.4

## [1.7.4](v1.7.3...v1.7.4) (2022-02-03)

### Bug Fixes

* getStreamURL docs ([#2257](#2257)) ([69bdd93](69bdd93))

* feat: 1.8.0 fixing

* chore(release): 1.8.0

# [1.8.0](v1.7.4...v1.8.0) (2022-02-03)

### Features

* 1.8.0 fixing ([cac563b](cac563b))

* fix: going for 1.8.1

* chore(release): 1.8.1

## [1.8.1](v1.8.0...v1.8.1) (2022-02-03)

### Bug Fixes

* going for 1.8.1 ([e39057f](e39057f))

* chore(deps): update dependency tape to v5.5.1

* chore(deps): update dependency tape to v5.5.2

* chore(docs): Remove duplicate config row (#2265)

* fix(deps): update dependency simple-peer to ^9.11.1

* chore(release): 1.8.2

## [1.8.2](v1.8.1...v1.8.2) (2022-02-17)

### Bug Fixes

* **deps:** update dependency simple-peer to ^9.11.1 ([34df41a](34df41a))

* docs: Added TorQuiX docker webclient, to faq.md (#2262)

* Added TorQuiX docker webclient

* docs: Added TorQuiX docker webclient, to faq.md

Co-authored-by: Mauro Mazzocchetti <m.mazzocchetti@tech4care.it>

* chore(release): 1.8.3

## [1.8.3](v1.8.2...v1.8.3) (2022-02-21)

* fix(deps): update dependency torrent-discovery to ^9.4.8 (#2272)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(release): 1.8.4

## [1.8.4](v1.8.3...v1.8.4) (2022-03-03)

### Bug Fixes

* **deps:** update dependency torrent-discovery to ^9.4.8 ([#2272](#2272)) ([aa2fa59](aa2fa59))

* chore(deps): update actions/stale action to v5 (#2271)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update actions/setup-node action to v3 (#2268)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update actions/checkout action to v3 (#2270)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update dependency bittorrent-tracker to v9.18.4

* fix(deps): update dependency torrent-discovery to ^9.4.9

* chore(release): 1.8.5

## [1.8.5](v1.8.4...v1.8.5) (2022-03-06)

### Bug Fixes

* **deps:** update dependency torrent-discovery to ^9.4.9 ([5a08647](5a08647))

* fix(deps): update dependency create-torrent to ^5.0.2 (#2276)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(release): 1.8.6

## [1.8.6](v1.8.5...v1.8.6) (2022-03-11)

### Bug Fixes

* **deps:** update dependency create-torrent to ^5.0.2 ([#2276](#2276)) ([f389f87](f389f87))

* chore(deps): update actions/cache action to v3 (#2281)

* chore(deps): update actions/cache action to v3

* Update release.yml

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Diego Rodríguez Baquero <diego@mothership.com>

* refactor: replace deprecated String.prototype.substr() (#2282)

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>

* chore(deps): update dependency finalhandler to v1.2.0 (#2283)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(release): 1.8.7

## [1.8.7](v1.8.6...v1.8.7) (2022-03-24)

* fix(deps): update dependency debug to ^4.3.4

* chore(release): 1.8.8

## [1.8.8](v1.8.7...v1.8.8) (2022-03-25)

### Bug Fixes

* **deps:** update dependency debug to ^4.3.4 ([017c488](017c488))

* chore(deps): update webtorrent

* fix(deps): update dependency parse-torrent to ^9.1.5

* chore(release): 1.8.9

## [1.8.9](v1.8.8...v1.8.9) (2022-03-26)

### Bug Fixes

* **deps:** update dependency parse-torrent to ^9.1.5 ([650a8c9](650a8c9))

* chore(deps): update dependency serve-static to v1.15.0 (#2285)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* fix: web seed request URLs (#2267)

* fix: web seed request URLs

When adding a multi torrent file (not magnet link) which has only web seeds, the torrent fails to download because webtorrent seems to try to call the wrong URL.

Suppose that we are using the default download path of `/tmp/webtorrent`, and we have a web seed at `https://some-s3-bucket.s3.amazonaws.com/my-torrent` where `my-torrent` contains some nested directory structure like this:

```
my-torrent/
    file1.txt
    file2/
        file2.txt
```

Webtorrent will attempt to fetch the following URLs:

```
https://some-s3-bucket.s3.amazonaws.com/my-torrent//tmp/webtorrent/my-torrent/file1.txt
https://some-s3-bucket.s3.amazonaws.com/my-torrent//tmp/webtorrent/my-torrent/file2/file2.txt
```

This is obviously incorrect, but perhaps I'm doing something wrong to cause this. I dug through the code, and it seems that `fs-chunk-store` is [modifying `file.path`](https://github.com/webtorrent/fs-chunk-store/blob/master/index.js#L48) when the [chunk store is created](https://github.com/webtorrent/webtorrent/blob/master/lib/torrent.js#L485). Stripping off the temp path fixes this issue and the download progresses as expected.

* Update lib/webconn.js

Co-authored-by: Diego Rodríguez Baquero <github@diegorbaquero.com>

Co-authored-by: Diego Rodríguez Baquero <github@diegorbaquero.com>

* chore(release): 1.8.10

## [1.8.10](v1.8.9...v1.8.10) (2022-03-27)

### Bug Fixes

* web seed request URLs ([#2267](#2267)) ([5b4880a](5b4880a))

* refactor: trigger _onWireWithMetadata after selections are updated (#2103)

Co-authored-by: Diego Rodríguez Baquero <github@diegorbaquero.com>

* chore(release): 1.8.11

## [1.8.11](v1.8.10...v1.8.11) (2022-03-27)

* fix(deps): update dependency bittorrent-protocol to ^3.5.2

* chore(release): 1.8.12

## [1.8.12](v1.8.11...v1.8.12) (2022-03-28)

### Bug Fixes

* **deps:** update dependency bittorrent-protocol to ^3.5.2 ([13fb0d6](13fb0d6))

* chore: add locking of threads [skip ci]

* fix(deps): update dependency fs-chunk-store to ^2.0.5

* chore(release): 1.8.13

## [1.8.13](v1.8.12...v1.8.13) (2022-03-30)

### Bug Fixes

* **deps:** update dependency fs-chunk-store to ^2.0.5 ([2eef418](2eef418))

* chore: every day

* ci: fix failing ci

* chore(deps): update dependency tape to v5.5.3

* chore: standard 17

* fix(deps): update dependency bittorrent-protocol to ^3.5.3 (#2302)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* fix(deps): update dependency bitfield to ^4.1.0 (#2303)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(release): 1.8.14

## [1.8.14](v1.8.13...v1.8.14) (2022-04-22)

### Bug Fixes

* **deps:** update dependency bitfield to ^4.1.0 ([#2303](#2303)) ([a778522](a778522))
* **deps:** update dependency bittorrent-protocol to ^3.5.3 ([#2302](#2302)) ([11f9426](11f9426))

* docs: replace `git.io` link with the actual URL (#2305)

* chore(release): 1.8.15

## [1.8.15](v1.8.14...v1.8.15) (2022-04-26)

* fix(deps): update dependency bittorrent-protocol to ^3.5.5

* chore(release): 1.8.16

## [1.8.16](v1.8.15...v1.8.16) (2022-04-28)

### Bug Fixes

* **deps:** update dependency bittorrent-protocol to ^3.5.5 ([3522080](3522080))

* chore(docs): add miru, haven torrent client (#2312)

* chore(deps): update dependency babel-minify to v0.5.2 (#2313)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(deps): update github/codeql-action action to v2 (#2304)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* fix: measure transfer rates without using timeouts (#2314)

* chore(release): 1.8.17

## [1.8.17](v1.8.16...v1.8.17) (2022-05-11)

### Bug Fixes

* measure transfer rates without using timeouts ([#2314](#2314)) ([522ee4c](522ee4c))

* fix(deps): update dependency bittorrent-tracker to v9.18.6 (#2315)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(release): 1.8.18

## [1.8.18](v1.8.17...v1.8.18) (2022-05-11)

### Bug Fixes

* **deps:** update dependency bittorrent-tracker to v9.18.6 ([#2315](#2315)) ([b63d652](b63d652))

* docs: Updated TorQuiX with new name CrawFish and updated link reference, to faq.md (#2316) [skip ci]

* Added TorQuiX docker webclient

* docs: Added TorQuiX docker webclient, to faq.md

* docs: Updated TorQuiX with new name CrawFish and updated link reference, to faq.md

Co-authored-by: Mauro Mazzocchetti <m.mazzocchetti@tech4care.it>

* chore(docs): add Niwder cloud torrent platform (#2317) [skip ci]

Co-authored-by: Diego Rodríguez Baquero <github@diegorbaquero.com>

* fix(deps): update dependency torrent-discovery to ^9.4.12

* chore(release): 1.8.19

## [1.8.19](v1.8.18...v1.8.19) (2022-05-11)

### Bug Fixes

* **deps:** update dependency torrent-discovery to ^9.4.12 ([36e931a](36e931a))

* fix(deps): update dependency bittorrent-dht to ^10.0.3 (#2320)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(release): 1.8.20

## [1.8.20](v1.8.19...v1.8.20) (2022-05-14)

### Bug Fixes

* **deps:** update dependency bittorrent-dht to ^10.0.3 ([#2320](#2320)) ([2ebbd8e](2ebbd8e))

* fix(deps): update dependency throughput to ^1.0.1 (#2321)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* chore(release): 1.8.21

## [1.8.21](v1.8.20...v1.8.21) (2022-05-23)

### Bug Fixes

* **deps:** update dependency throughput to ^1.0.1 ([#2321](#2321)) ([d53d95e](d53d95e))

* fix(deps): update dependency bittorrent-dht to ^10.0.4

* chore(release): 1.8.22

## [1.8.22](v1.8.21...v1.8.22) (2022-05-24)

### Bug Fixes

* **deps:** update dependency bittorrent-dht to ^10.0.4 ([327d723](327d723))

* chore(deps): update dependency bittorrent-tracker to v9.19.0

* chore(deps): update dependency semantic-release to v19.0.3 [security]

* sponsor

* fix(deps): update dependency torrent-discovery to ^9.4.13

* chore(release): 1.8.23

## [1.8.23](v1.8.22...v1.8.23) (2022-06-23)

### Bug Fixes

* **deps:** update dependency torrent-discovery to ^9.4.13 ([1e3373a](1e3373a))

* fix: support stream cancelling (#2335)

* chore(release): 1.8.24

## [1.8.24](v1.8.23...v1.8.24) (2022-06-23)

### Bug Fixes

* support stream cancelling ([#2335](#2335)) ([2e4f91f](2e4f91f))

* fix: use streamx instead of stream

* fix: null opts causing error

* fix(deps): update dependency create-torrent to ^5.0.3

* chore(release): 1.8.25

## [1.8.25](v1.8.24...v1.8.25) (2022-07-03)

### Bug Fixes

* **deps:** update dependency create-torrent to ^5.0.3 ([5009d10](5009d10))

* fix: dedupe packages

* fix(deps): update dependency create-torrent to ^5.0.4

* chore(release): 1.8.26

## [1.8.26](v1.8.25...v1.8.26) (2022-07-04)

### Bug Fixes

* **deps:** update dependency create-torrent to ^5.0.4 ([3728336](3728336))

* fix: drop multi-stream

* chore: update dep

* chore: update deps

* chore(deps): update dependency tape to v5.6.0

* chore(deps): update dependency semantic-release to v19.0.5

* fix(deps): update dependency fast-blob-stream to ^1.1.1

* fix(deps): update dependency join-async-iterator to ^1.1.1

* chore(release): 1.8.27

## [1.8.27](v1.8.26...v1.8.27) (2022-09-02)

### Bug Fixes

* dedupe packages ([9ea33c2](9ea33c2))
* drop multi-stream ([5d87d1b](5d87d1b))
* null opts causing error ([3a8f901](3a8f901))
* use streamx instead of stream ([8b97ee8](8b97ee8))

* chore(release): 1.8.28

## [1.8.28](v1.8.27...v1.8.28) (2022-09-02)

### Bug Fixes

* **deps:** update dependency fast-blob-stream to ^1.1.1 ([a441dea](a441dea))
* **deps:** update dependency join-async-iterator to ^1.1.1 ([09b9958](09b9958))

* fix(deps): update dependency create-torrent to ^5.0.6

* chore(release): 1.8.29

## [1.8.29](v1.8.28...v1.8.29) (2022-09-03)

### Bug Fixes

* **deps:** update dependency create-torrent to ^5.0.6 ([03a0f50](03a0f50))

* fix: return duplicate torrent on Webtorrent.add() (#2372)

* Update index.js

if the there is a duplicate torrent, return the torrent

* no more emitting 'torrent' for duplicate torrents

* chore(release): 1.8.30

## [1.8.30](v1.8.29...v1.8.30) (2022-09-12)

### Bug Fixes

* return duplicate torrent on Webtorrent.add() ([#2372](#2372)) ([05d27bf](05d27bf))

* chore(deps): update dependency tape to v5.6.1

* chore(deps): update actions/stale action to v6 (#2378)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Change link of repojacking vulnerable link (#2382)

* fix(deps): update dependency bittorrent-dht to ^10.0.6 (#2384)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(release): 1.8.31

## [1.8.31](v1.8.30...v1.8.31) (2022-10-08)

### Bug Fixes

* **deps:** update dependency bittorrent-dht to ^10.0.6 ([#2384](#2384)) ([34089f8](34089f8))

* fix(deps): update dependency torrent-discovery to ^9.4.14

* chore(release): 1.8.32

## [1.8.32](v1.8.31...v1.8.32) (2022-10-09)

### Bug Fixes

* **deps:** update dependency torrent-discovery to ^9.4.14 ([8fadd4f](8fadd4f))

* chore(deps): update dependency @webtorrent/semantic-release-config to v1.0.8

* feat: add chitchatter link (#2388)

* chore: require Node.js 14

* fix(deps): update dependency fs-chunk-store to v3 (#2380)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(release): 1.9.0

# [1.9.0](v1.8.32...v1.9.0) (2022-10-28)

### Bug Fixes

* **deps:** update dependency fs-chunk-store to v3 ([#2380](#2380)) ([9abd966](9abd966))

### Features

* add chitchatter link ([#2388](#2388)) ([7ef22f7](7ef22f7))

* fix(deps): update dependency streamx to ^2.12.5 (#2366)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(release): 1.9.1

## [1.9.1](v1.9.0...v1.9.1) (2022-10-28)

### Bug Fixes

* **deps:** update dependency streamx to ^2.12.5 ([#2366](#2366)) ([457a2d3](457a2d3))

* chore: fix test typo

* ci: add node 18

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
Co-authored-by: Diego Rodríguez Baquero <diego@mothership.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Artak Safaryan <32634773+holoyan@users.noreply.github.com>
Co-authored-by: Drakonkat <adamo.mazzocchetti@gmail.com>
Co-authored-by: Mauro Mazzocchetti <m.mazzocchetti@tech4care.it>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: CommanderRoot <CommanderRoot@users.noreply.github.com>
Co-authored-by: Justin Lewis Salmon <jlsalmon@users.noreply.github.com>
Co-authored-by: Diego Rodríguez Baquero <github@diegorbaquero.com>
Co-authored-by: Alex <alxmorais8@msn.com>
Co-authored-by: Diego Rodriguez Baquero <diego@protocol.ai>
Co-authored-by: Sukka <isukkaw@gmail.com>
Co-authored-by: Nipuna Weerasekara <w.nipuna@gmail.com>
Co-authored-by: Feross Aboukhadijeh <feross@feross.org>
Co-authored-by: tedd pasta <37799569+resession@users.noreply.github.com>
Co-authored-by: Ilaygoldman <29836366+Ilaygoldman@users.noreply.github.com>
Co-authored-by: Jeremy Kahn <jeremyckahn@gmail.com>
  • Loading branch information
19 people committed Nov 10, 2022
1 parent 8a2d474 commit 721290e
Show file tree
Hide file tree
Showing 15 changed files with 178 additions and 48 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
os:
- ubuntu-latest
node:
- '18'
- '16'
- '14'
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/stale@v5
- uses: actions/stale@v6
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?'
Expand Down
4 changes: 4 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,9 @@
- Diego Rodriguez Baquero (diego@protocol.ai)
- Sukka (isukkaw@gmail.com)
- Nipuna Weerasekara (w.nipuna@gmail.com)
- ThaUnknown (6506529+ThaUnknown@users.noreply.github.com)
- tedd pasta (37799569+resession@users.noreply.github.com)
- Ilaygoldman (29836366+Ilaygoldman@users.noreply.github.com)
- Jeremy Kahn (jeremyckahn@gmail.com)

#### Generated by scripts/update-authors.sh.
79 changes: 79 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,82 @@
## [1.9.1](https://github.com/webtorrent/webtorrent/compare/v1.9.0...v1.9.1) (2022-10-28)


### Bug Fixes

* **deps:** update dependency streamx to ^2.12.5 ([#2366](https://github.com/webtorrent/webtorrent/issues/2366)) ([457a2d3](https://github.com/webtorrent/webtorrent/commit/457a2d3d5def6bb75d2551f34ab9fa350ec4a4e5))

# [1.9.0](https://github.com/webtorrent/webtorrent/compare/v1.8.32...v1.9.0) (2022-10-28)


### Bug Fixes

* **deps:** update dependency fs-chunk-store to v3 ([#2380](https://github.com/webtorrent/webtorrent/issues/2380)) ([9abd966](https://github.com/webtorrent/webtorrent/commit/9abd96691ab73ebc8fb10aa79a67b5db0c92ec72))


### Features

* add chitchatter link ([#2388](https://github.com/webtorrent/webtorrent/issues/2388)) ([7ef22f7](https://github.com/webtorrent/webtorrent/commit/7ef22f726bed2dfaa6f29ad633955f59db6a9022))

## [1.8.32](https://github.com/webtorrent/webtorrent/compare/v1.8.31...v1.8.32) (2022-10-09)


### Bug Fixes

* **deps:** update dependency torrent-discovery to ^9.4.14 ([8fadd4f](https://github.com/webtorrent/webtorrent/commit/8fadd4f437a9e60da4cbc49b3b6d6e65db38373f))

## [1.8.31](https://github.com/webtorrent/webtorrent/compare/v1.8.30...v1.8.31) (2022-10-08)


### Bug Fixes

* **deps:** update dependency bittorrent-dht to ^10.0.6 ([#2384](https://github.com/webtorrent/webtorrent/issues/2384)) ([34089f8](https://github.com/webtorrent/webtorrent/commit/34089f836bcb24df275f83b3026af548e32d02e9))

## [1.8.30](https://github.com/webtorrent/webtorrent/compare/v1.8.29...v1.8.30) (2022-09-12)


### Bug Fixes

* return duplicate torrent on Webtorrent.add() ([#2372](https://github.com/webtorrent/webtorrent/issues/2372)) ([05d27bf](https://github.com/webtorrent/webtorrent/commit/05d27bfd449aa705cefefe74d4a9eef327f63b4a))

## [1.8.29](https://github.com/webtorrent/webtorrent/compare/v1.8.28...v1.8.29) (2022-09-03)


### Bug Fixes

* **deps:** update dependency create-torrent to ^5.0.6 ([03a0f50](https://github.com/webtorrent/webtorrent/commit/03a0f500013172a5070dd5e8e67063bea6eaf190))

## [1.8.28](https://github.com/webtorrent/webtorrent/compare/v1.8.27...v1.8.28) (2022-09-02)


### Bug Fixes

* **deps:** update dependency fast-blob-stream to ^1.1.1 ([a441dea](https://github.com/webtorrent/webtorrent/commit/a441dea5d1a20982e9ad3fbe5237bbb02fb55898))
* **deps:** update dependency join-async-iterator to ^1.1.1 ([09b9958](https://github.com/webtorrent/webtorrent/commit/09b995814a2b5192cd9d9dd9a620d2b3dbdb5ab7))

## [1.8.27](https://github.com/webtorrent/webtorrent/compare/v1.8.26...v1.8.27) (2022-09-02)


### Bug Fixes

* dedupe packages ([9ea33c2](https://github.com/webtorrent/webtorrent/commit/9ea33c2c1cd3ea9fcfa66569a3fb94148afd9869))
* drop multi-stream ([5d87d1b](https://github.com/webtorrent/webtorrent/commit/5d87d1b32356f6b75ed4f9aefe91f3ddf1ecebdb))
* null opts causing error ([3a8f901](https://github.com/webtorrent/webtorrent/commit/3a8f901a48503a5c767b6174904e2c062d403a6a))
* use streamx instead of stream ([8b97ee8](https://github.com/webtorrent/webtorrent/commit/8b97ee8cc18b05e0d20135ea8f1651e97bb65c6f))

## [1.8.26](https://github.com/webtorrent/webtorrent/compare/v1.8.25...v1.8.26) (2022-07-04)


### Bug Fixes

* **deps:** update dependency create-torrent to ^5.0.4 ([3728336](https://github.com/webtorrent/webtorrent/commit/37283369f3476d32ac9ca85c2c2da4bd4fee273c))

## [1.8.25](https://github.com/webtorrent/webtorrent/compare/v1.8.24...v1.8.25) (2022-07-03)


### Bug Fixes

* **deps:** update dependency create-torrent to ^5.0.3 ([5009d10](https://github.com/webtorrent/webtorrent/commit/5009d1018bdec96afd4bf15e5f7143951623fd48))

## [1.8.24](https://github.com/webtorrent/webtorrent/compare/v1.8.23...v1.8.24) (2022-06-23)


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ they can connect to both normal *and* web peers. We hope other clients will foll
- **peer discovery** via **[dht](https://github.com/webtorrent/bittorrent-dht)**,
**[tracker](https://github.com/webtorrent/bittorrent-tracker)**,
**[lsd](https://github.com/webtorrent/bittorrent-lsd)**, and
**[ut_pex](https://github.com/fisch0920/ut_pex)**
**[ut_pex](https://github.com/webtorrent/ut_pex)**
- **[protocol extension api](https://github.com/webtorrent/bittorrent-protocol#extension-api)**
for adding new extensions
- **Comprehensive test suite** (runs completely offline, so it's reliable and fast)
Expand Down
2 changes: 2 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ navigator.serviceWorker.register('./sw.min.js', { scope: './' }).then(reg => {
client._server.close()
client.destroy()
```
Needs either [this worker](https://github.com/webtorrent/webtorrent/blob/master/sw.min.js) to be used, or have [this functionality](https://github.com/webtorrent/webtorrent/blob/master/lib/worker.js) implemented.

# Torrent API

## `torrent.name`
Expand Down
3 changes: 3 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ WebTorrent is still pretty new, but it's already being used in cool ways:
- **[Haven Torrent Client][haven-torrent-client]** - Simple and Fast Torrent Client for the web. ([source code][haven-torrent-client-source])
- **[CrawFish][CrawFish]** - Desktop/Web/Server torrent client, with streaming support and integrated search (Works in docker, windows and has a WebUI that can be accessed by remote). ([source code][CrawFish-source])
- **[Niwder][Niwder]** - Web based platform to transfer torrents to Mega.nz and Google Drive on the cloud. ([source code][Niwder-source])
- **[Chitchatter][Chitchatter]** - A peer-to-peer chat app that is serverless, decentralized, and ephemeral. Uses WebTorrent to initiate peer connections. ([source code][Chitchatter-source])
- ***Your app here – [Send a pull request][pr] with your URL!***
<!-- - **[PeerCloud][peercloud]** - Serverless websites via WebTorrent ([source code][peercloud-source]) -->
<!-- - **[Niagara][niagara]** - Video player webtorrent with subtitles (zipped .srt(s)) -->
Expand Down Expand Up @@ -212,6 +213,8 @@ There's also a list of WebTorrent-powered alternatives to centralized services h
[haven-torrent-client-source]: https://github.com/ThaUnknown/pwa-haven/tree/main/torrent-client
[Niwder]: https://niwder.niweera.gq
[Niwder-source]: https://github.com/Niweera/niwder
[Chitchatter]: https://chitchatter.im/
[Chitchatter-source]: https://github.com/jeremyckahn/chitchatter

## How does WebTorrent work?

Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ class WebTorrent extends EventEmitter {
for (const t of this.torrents) {
if (t.infoHash === torrent.infoHash && t !== torrent) {
torrent._destroy(new Error(`Cannot add duplicate torrent ${torrent.infoHash}`))
ontorrent(t)
return
}
}
Expand Down
26 changes: 11 additions & 15 deletions lib/file-stream.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const stream = require('stream')
const { Readable } = require('streamx')
const debugFactory = require('debug')
const eos = require('end-of-stream')

const debug = debugFactory('webtorrent:file-stream')

Expand All @@ -12,9 +11,9 @@ const debug = debugFactory('webtorrent:file-stream')
* @param {number} opts.start stream slice of file, starting from this byte (inclusive)
* @param {number} opts.end stream slice of file, ending with this byte (inclusive)
*/
class FileStream extends stream.Readable {
class FileStream extends Readable {
constructor (file, opts) {
super(opts)
super(opts ?? {})

this._torrent = file._torrent

Expand All @@ -39,26 +38,22 @@ class FileStream extends stream.Readable {
this._torrent.select(this._startPiece, this._endPiece, true, () => {
this._notify()
})

// Ensure that cleanup happens even if destroy() is never called (readable-stream v3 currently doesn't call it automaticallly)
eos(this, (err) => {
this.destroy(err)
})
}

_read () {
_read (cb) {
if (this._reading) return
this._reading = true
this._notify()
this._notify(cb)
}

_notify () {
if (!this._reading || this._missing === 0) return
_notify (cb = () => {}) {
if (!this._reading || this._missing === 0) return cb()
if (!this._torrent.bitfield.get(this._piece)) {
cb()
return this._torrent.critical(this._piece, this._piece + this._criticalLength)
}

if (this._notifying) return
if (this._notifying) return cb()
this._notifying = true

if (this._torrent.destroyed) return this.destroy(new Error('Torrent removed'))
Expand Down Expand Up @@ -92,11 +87,12 @@ class FileStream extends stream.Readable {
this.push(buffer)

if (this._missing === 0) this.push(null)
cb()
})
this._piece += 1
}

_destroy (err, cb) {
_destroy (cb, err) {
if (!this._torrent.destroyed) {
this._torrent.deselect(this._startPiece, this._endPiece, true)
}
Expand Down
23 changes: 9 additions & 14 deletions lib/file.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const EventEmitter = require('events')
const { PassThrough } = require('stream')
const streamToBlob = require('stream-to-blob')
const streamToBlobURL = require('stream-to-blob-url')
const { PassThrough } = require('streamx')
const { BlobWriteStream } = require('fast-blob-stream')
const streamToBuffer = require('stream-with-known-length-to-buffer')
const queueMicrotask = require('queue-microtask')
const rangeParser = require('range-parser')
Expand Down Expand Up @@ -121,20 +120,16 @@ class File extends EventEmitter {

getBlob (cb) {
if (typeof window === 'undefined') throw new Error('browser-only method')
streamToBlob(this.createReadStream(), mime.getType(this.name))
.then(
blob => cb(null, blob),
err => cb(err)
)
const writeStream = new BlobWriteStream(blob => {
cb(null, blob)
}, { mimeType: this._getMimeType() })
this.createReadStream().pipe(writeStream)
}

getBlobURL (cb) {
if (typeof window === 'undefined') throw new Error('browser-only method')
streamToBlobURL(this.createReadStream(), mime.getType(this.name))
.then(
blobUrl => cb(null, blobUrl),
err => cb(err)
)
this.getBlob((_err, blob) => {
cb(null, URL.createObjectURL(blob))
})
}

_serve (req) {
Expand Down
5 changes: 3 additions & 2 deletions lib/torrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const get = require('simple-get')
const ImmediateChunkStore = require('immediate-chunk-store')
const ltDontHave = require('lt_donthave')
const MemoryChunkStore = require('memory-chunk-store')
const MultiStream = require('multistream')
const joinIterator = require('join-async-iterator')
const parallel = require('run-parallel')
const parallelLimit = require('run-parallel-limit')
const parseTorrent = require('parse-torrent')
Expand All @@ -29,6 +29,7 @@ const sha1 = require('simple-sha1')
const throughput = require('throughput')
const utMetadata = require('ut_metadata')
const utPex = require('ut_pex') // browser exclude
const { Readable } = require('streamx')

const File = require('./file.js')
const Peer = require('./peer.js')
Expand Down Expand Up @@ -1834,7 +1835,7 @@ class Torrent extends EventEmitter {
if (!Array.isArray(streams)) streams = [streams]
if (!cb) cb = noop

const readable = new MultiStream(streams)
const readable = Readable.from(joinIterator(streams))
const writable = new ChunkStoreWriteStream(this.store, this.pieceLength)

pump(readable, writable, err => {
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "webtorrent",
"description": "Streaming torrent client",
"version": "1.8.24",
"version": "1.9.1",
"author": {
"name": "WebTorrent LLC",
"email": "feross@webtorrent.io",
Expand Down Expand Up @@ -38,23 +38,24 @@
"@webtorrent/http-node": "^1.3.0",
"addr-to-ip-port": "^1.5.4",
"bitfield": "^4.1.0",
"bittorrent-dht": "^10.0.4",
"bittorrent-dht": "^10.0.6",
"bittorrent-protocol": "^3.5.5",
"cache-chunk-store": "^3.2.2",
"chrome-net": "^3.3.4",
"chunk-store-stream": "^4.3.0",
"cpus": "^1.0.3",
"create-torrent": "^5.0.2",
"create-torrent": "^5.0.6",
"debug": "^4.3.4",
"end-of-stream": "^1.4.4",
"escape-html": "^1.0.3",
"fs-chunk-store": "^2.0.5",
"fast-blob-stream": "^1.1.1",
"fs-chunk-store": "^3.0.1",
"immediate-chunk-store": "^2.2.0",
"join-async-iterator": "^1.1.1",
"load-ip-set": "^2.2.1",
"lt_donthave": "^1.0.1",
"memory-chunk-store": "^1.3.5",
"mime": "^3.0.0",
"multistream": "^4.1.0",
"package-json-versionify": "^1.0.4",
"parse-torrent": "^9.1.5",
"pump": "^3.0.0",
Expand All @@ -69,18 +70,17 @@
"simple-peer": "^9.11.1",
"simple-sha1": "^3.1.0",
"speed-limiter": "^1.0.2",
"stream-to-blob": "^2.0.1",
"stream-to-blob-url": "^3.0.2",
"stream-with-known-length-to-buffer": "^1.0.4",
"streamx": "^2.12.5",
"throughput": "^1.0.1",
"torrent-discovery": "^9.4.13",
"torrent-discovery": "^9.4.14",
"torrent-piece": "^2.0.1",
"unordered-array-remove": "^1.0.2",
"ut_metadata": "^3.5.2",
"ut_pex": "^3.0.2"
},
"devDependencies": {
"@webtorrent/semantic-release-config": "1.0.7",
"@webtorrent/semantic-release-config": "1.0.8",
"airtap": "4.0.4",
"airtap-manual": "1.0.0",
"airtap-sauce": "1.1.2",
Expand All @@ -91,17 +91,17 @@
"finalhandler": "1.2.0",
"network-address": "1.1.2",
"run-series": "1.1.9",
"semantic-release": "19.0.3",
"semantic-release": "19.0.5",
"serve-static": "1.15.0",
"standard": "*",
"tape": "5.5.3",
"tape": "5.6.1",
"webtorrent-fixtures": "1.7.5"
},
"optionalDependencies": {
"utp-native": "^2.5.3"
},
"engines": {
"node": ">=12"
"node": ">=14"
},
"funding": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/client-seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ test('client.seed: torrent file (Blob)', t => {
})
})

test('client.seed: duplicate seed)', t => {
test('client.seed: duplicate seed', t => {
t.plan(4)

const client = new WebTorrent()
Expand Down
34 changes: 33 additions & 1 deletion webtorrent.chromeapp.js

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion webtorrent.min.js

Large diffs are not rendered by default.

0 comments on commit 721290e

Please sign in to comment.