mirror of
https://github.com/leoherzog/TorrentParts.git
synced 2026-01-24 04:08:04 -08:00
Add README.md
This commit is contained in:
16
bundle.js
16
bundle.js
@@ -23810,10 +23810,11 @@ function parseTorrent (torrentId) {
|
||||
}
|
||||
}
|
||||
|
||||
function parseTorrentRemote (torrentId, cb) {
|
||||
let parsedTorrent
|
||||
function parseTorrentRemote (torrentId, opts, cb) {
|
||||
if (typeof opts === 'function') return parseTorrentRemote(torrentId, {}, opts)
|
||||
if (typeof cb !== 'function') throw new Error('second argument must be a Function')
|
||||
|
||||
let parsedTorrent
|
||||
try {
|
||||
parsedTorrent = parseTorrent(torrentId)
|
||||
} catch (err) {
|
||||
@@ -23832,11 +23833,12 @@ function parseTorrentRemote (torrentId, cb) {
|
||||
})
|
||||
} else if (typeof get === 'function' && /^https?:/.test(torrentId)) {
|
||||
// http, or https url to torrent file
|
||||
get.concat({
|
||||
opts = Object.assign({
|
||||
url: torrentId,
|
||||
timeout: 30 * 1000,
|
||||
headers: { 'user-agent': 'WebTorrent (https://webtorrent.io)' }
|
||||
}, (err, res, torrentBuf) => {
|
||||
}, opts)
|
||||
get.concat(opts, (err, res, torrentBuf) => {
|
||||
if (err) return cb(new Error(`Error downloading torrent: ${err.message}`))
|
||||
parseOrThrow(torrentBuf)
|
||||
})
|
||||
@@ -37981,6 +37983,7 @@ function start() {
|
||||
});
|
||||
copyurl.on('failure', function(e) {
|
||||
notyf.error('Problem copying to clipboard');
|
||||
console.warn(e);
|
||||
});
|
||||
|
||||
let copymagnet = new clipboard('#copyMagnet');
|
||||
@@ -38050,7 +38053,7 @@ function parse(toLoad) {
|
||||
function parseRemote(toLoad) {
|
||||
parser.remote(toLoad, function(err, result) {
|
||||
if (err) {
|
||||
notyf.error('Problem remotely fetching or parsing Torrent file');
|
||||
notyf.error('Problem remotely fetching file or parsing result');
|
||||
console.warn(err);
|
||||
resetProperties();
|
||||
return;
|
||||
@@ -38277,7 +38280,8 @@ async function addCurrentTrackers() {
|
||||
updateModified();
|
||||
}
|
||||
catch(e) {
|
||||
console.warn(e); // TODO: Alert user to error
|
||||
notyf.error('Problem fetching trackers from newTrackon');
|
||||
console.warn(e);
|
||||
}
|
||||
addTrackers.className = '';
|
||||
addTrackers.innerHTML = 'Add Known Working Trackers';
|
||||
|
||||
Reference in New Issue
Block a user