Add README.md

This commit is contained in:
Leo Herzog
2020-11-13 11:36:25 -05:00
parent 56df9727cb
commit b09e24e991
4 changed files with 84 additions and 10 deletions

View File

@@ -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';