Skip to content

Commit

Permalink
fix: #367
Browse files Browse the repository at this point in the history
fix: #368
  • Loading branch information
ThaUnknown committed Nov 21, 2023
1 parent 4b4137a commit 34770e5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
28 changes: 20 additions & 8 deletions common/modules/webtorrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,27 @@ import HTTPTracker from 'bittorrent-tracker/lib/client/http-tracker.js'
import { hex2bin, arr2hex, text2arr } from 'uint8-util'
import Parser from './parser.js'
import { defaults, fontRx, subRx, videoRx } from './util.js'
import { SUPPORTS } from './support.js'

const LARGE_FILESIZE = 32_000_000_000

const announce = [
atob('d3NzOi8vdHJhY2tlci5vcGVud2VidG9ycmVudC5jb20='),
atob('d3NzOi8vdHJhY2tlci53ZWJ0b3JyZW50LmRldg=='),
atob('d3NzOi8vdHJhY2tlci5maWxlcy5mbTo3MDczL2Fubm91bmNl'),
atob('d3NzOi8vdHJhY2tlci5idG9ycmVudC54eXov'),
atob('dWRwOi8vb3Blbi5zdGVhbHRoLnNpOjgwL2Fubm91bmNl'),
atob('aHR0cDovL255YWEudHJhY2tlci53Zjo3Nzc3L2Fubm91bmNl'),
atob('dWRwOi8vdHJhY2tlci5vcGVudHJhY2tyLm9yZzoxMzM3L2Fubm91bmNl'),
atob('dWRwOi8vZXhvZHVzLmRlc3luYy5jb206Njk2OS9hbm5vdW5jZQ=='),
atob('dWRwOi8vdHJhY2tlci5jb3BwZXJzdXJmZXIudGs6Njk2OS9hbm5vdW5jZQ=='),
atob('dWRwOi8vOS5yYXJiZy50bzoyNzEwL2Fubm91bmNl'),
atob('dWRwOi8vdHJhY2tlci50b3JyZW50LmV1Lm9yZzo0NTEvYW5ub3VuY2U='),
atob('aHR0cDovL29wZW4uYWNnbnh0cmFja2VyLmNvbTo4MC9hbm5vdW5jZQ=='),
atob('aHR0cDovL2FuaWRleC5tb2U6Njk2OS9hbm5vdW5jZQ=='),
atob('aHR0cDovL3RyYWNrZXIuYW5pcmVuYS5jb206ODAvYW5ub3VuY2U=')
]

let storedSettings = {}

try {
Expand Down Expand Up @@ -179,17 +197,11 @@ export default class TorrentClient extends WebTorrent {
path: this.settings.torrentPath,
destroyStoreOnDestroy: !this.settings.torrentPersist,
skipVerify,
announce: [
'wss://tracker.openwebtorrent.com',
'wss://tracker.webtorrent.dev',
'wss://tracker.files.fm:7073/announce',
'wss://tracker.btorrent.xyz/',
atob('aHR0cDovL255YWEudHJhY2tlci53Zjo3Nzc3L2Fubm91bmNl')
]
announce
})

torrent.once('done', () => {
localStorage.setItem('lastFinished', true)
if (SUPPORTS.torrentPersist && this.settings.torrentPath) localStorage.setItem('lastFinished', true)
})
}

Expand Down
8 changes: 4 additions & 4 deletions common/views/WatchTogether/WatchTogether.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
function joinLobby (code = generateRandomHexCode(16)) {
if (p2pt) cleanup()
p2pt = new P2PT([
'wss://tracker.openwebtorrent.com',
'wss://tracker.webtorrent.dev',
'wss://tracker.files.fm:7073/announce',
'wss://tracker.btorrent.xyz/'
atob('d3NzOi8vdHJhY2tlci5vcGVud2VidG9ycmVudC5jb20='),
atob('d3NzOi8vdHJhY2tlci53ZWJ0b3JyZW50LmRldg=='),
atob('d3NzOi8vdHJhY2tlci5maWxlcy5mbTo3MDczL2Fubm91bmNl'),
atob('d3NzOi8vdHJhY2tlci5idG9ycmVudC54eXov')
], code)
p2pt.on('peerconnect', async peer => {
console.log(peer.id)
Expand Down

0 comments on commit 34770e5

Please sign in to comment.