Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tsaridas committed Jan 26, 2024
1 parent 1b65a60 commit 546d7ec
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ async function addResults(info, streams, source, signal) {
}

try {
const streamUrl = url + info.type + '/' + info.imdbId + '.json'
const streamUrl = url + info.type + '/' + info.imdbId + (info.season && info.episode ? info.season + ':' + info.episode + '.json' : '.json');
config.debug && console.log('Additional source url is :', streamUrl)
const response = await axios.get(streamUrl, {
headers: {
Expand Down Expand Up @@ -364,9 +364,10 @@ addon.get('/stream/:type/:id.json', async (req, res) => {
responseType: 'arraybuffer', // Specify the response type as 'arraybuffer'
});


if (requestSent || response.status >= 400) { // It usually takes some time to dowload the torrent file and we don't want to continue.
config.debug && console.log("Abort processing of : " + task.link + " - " + (requestSent ? "Request sent is " + requestSent : "Response code : " + response.statusCode));
// It takes some time to dowload the torrent file and we don't want to continue althought it will probably timeout.
if (requestSent || response.status >= 400) {
config.debug && console.log("Abort processing of : " + task.link + " - " + (requestSent ? "Request sent is "
+ requestSent : "Response code : " + response.statusCode));
inProgressCount--;
return;
}
Expand Down Expand Up @@ -424,7 +425,7 @@ const runAddon = async () => {
global.BLACKLIST_TRACKERS = blacklist_trackers;
configureConnectionPooling();
addon.listen(config.addonPort, () => {
console.log('Add-on Manifest URL: http://{{ YOUR IP ADDRESS }}:' + config.addonPort + '/manifest.json');
console.log("Version: " + version + ' Add-on Manifest URL: http://{{ IP ADDRESS }}:' + config.addonPort + '/manifest.json');
});
};

Expand Down

0 comments on commit 546d7ec

Please sign in to comment.