Merge pull request #2042 from PR0M3TH3AN/codex/update-streamvideo-to-add-web-seeds

Explicitly add web seeds to torrents after creation in streamVideo
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-02-01 11:05:58 -05:00
commit f68c407771
1 file changed
+11
+11
View File
@@ -1035,6 +1035,15 @@ export class TorrentClient {
chromeOptions.urlList = candidateUrls;
}
const addExplicitWebSeeds = (torrent) => {
if (!candidateUrls.length || typeof torrent?.addWebSeed !== "function") {
return;
}
candidateUrls.forEach((url) => {
torrent.addWebSeed(url);
});
};
return new Promise((resolve, reject) => {
// 3) Add the torrent to the client and handle accordingly.
if (isFirefoxBrowser) {
@@ -1044,6 +1053,7 @@ export class TorrentClient {
{ ...chromeOptions, maxWebConns: 4 },
(torrent) => {
this.log("Torrent added (Firefox path):", torrent.name);
addExplicitWebSeeds(torrent);
this.handleFirefoxTorrent(torrent, videoElement, resolve, reject);
}
);
@@ -1051,6 +1061,7 @@ export class TorrentClient {
this.log("Starting torrent download (Chrome path)");
this.client.add(effectiveMagnetURI, chromeOptions, (torrent) => {
this.log("Torrent added (Chrome path):", torrent.name);
addExplicitWebSeeds(torrent);
this.handleChromeTorrent(torrent, videoElement, resolve, reject);
});
}