[addon] include trackers when downloading to debrid

This commit is contained in:
TheBeastLT
2020-12-24 17:32:15 +01:00
parent f8fe581313
commit c733d7e266
6 changed files with 37 additions and 9 deletions

View File

@@ -1,8 +1,8 @@
const PutioAPI = require('@putdotio/api-client').default
const { encode } = require('magnet-uri');
const { isVideo } = require('../lib/extension');
const delay = require('./delay');
const StaticResponse = require('./static');
const { getMagnetLink } = require('../lib/magnetHelper');
async function getCachedStreams(streams, apiKey) {
return streams
@@ -64,7 +64,7 @@ async function _findTorrent(Putio, infoHash) {
}
async function _createTorrent(Putio, infoHash) {
const magnetLink = encode({ infoHash });
const magnetLink = await getMagnetLink(infoHash);
// Add the torrent and then delay for 3 secs for putio to process it and then check it's status.
return Putio.Transfers.Add({ url: magnetLink })
.then(response => _getNewTorrent(Putio, response.data.transfer.id));