[URGENT] Script no longer works as it seems Funimation have changed how the API works #11

Closed
opened 2020-05-31 17:24:53 +00:00 by Coppyhop · 1 comment
Coppyhop commented 2020-05-31 17:24:53 +00:00 (Migrated from github.com)

Currently the script will report 0 servers available. Upon editing the script to try and pinpoint what's wrong, we can see that the uri of 's' no longer is an entire uri but just the filename.

{"attributes":{"RESOLUTION":{"width":416,"height":234},"CODECS":"avc1.42001e,mp4a.40.2","BANDWIDTH":547097},"uri":"2198051_Japanese_c0654448-3a92-ea11-82a8-dd291e252010_Layer1.m3u8","timeline":0}

meaning that when it's trying to find a server by using

plUrlDl.split('/')[2]

it returns an undefined. This means that the server list it's trying to pull from is empty, and as such it can't find any layer, failing with "Layer not selected".

Currently the script will report 0 servers available. Upon editing the script to try and pinpoint what's wrong, we can see that the uri of 's' no longer is an entire uri but just the filename. ``` {"attributes":{"RESOLUTION":{"width":416,"height":234},"CODECS":"avc1.42001e,mp4a.40.2","BANDWIDTH":547097},"uri":"2198051_Japanese_c0654448-3a92-ea11-82a8-dd291e252010_Layer1.m3u8","timeline":0} ``` meaning that when it's trying to find a server by using ``` plUrlDl.split('/')[2] ``` it returns an undefined. This means that the server list it's trying to pull from is empty, and as such it can't find any layer, failing with "Layer not selected".
Coppyhop commented 2020-05-31 18:05:37 +00:00 (Migrated from github.com)

I was able to get around this issue by adding

    var lastSlash = tsDlPath.lastIndexOf("/");
    let testUri=tsDlPath.substring(0,lastSlash+1);
    console.log("SRC URL IS: " + testUri);

above the for loop and then inside the for loop I added

let plServer = plUrlDl.split('/')[2];

This seems to circumvent the issue for now. But I'd look into seeing how you can get the url for a stream in the new api because there is no guarantee this will work for all shows

I was able to get around this issue by adding ``` var lastSlash = tsDlPath.lastIndexOf("/"); let testUri=tsDlPath.substring(0,lastSlash+1); console.log("SRC URL IS: " + testUri); ``` above the for loop and then inside the for loop I added ``` let plServer = plUrlDl.split('/')[2]; ``` This seems to circumvent the issue for now. But I'd look into seeing how you can get the url for a stream in the new api because there is no guarantee this will work for all shows
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Creepso/multi-downloader-nx#11
No description provided.