gabonator / SynologyUlozTo

UlozTo.cz file sharing service downloader plugin for Synology NAS with captcha cracker
26 stars 4 forks source link

Ulozto Service fails unexpectedly #7

Closed svasek closed 7 years ago

svasek commented 7 years ago

Log contains lines bellow:

Ulozto.cz interface webserver running at localhost:8034
query='getDownload('http://ulozto.cz/file-tracking/ccfb6a7b7bafa1c870b4d80e47d908a37af8f8816256a398b277883bfaf37032341fd7f26e26fbeb89948e18112a2814')' 
/volume1/@appstore/Ulozto/api.js:42 
    mainurl = newLocation[1];
                 ^
TypeError: Cannot read property '1' of null 
    at /volume1/@appstore/Ulozto/api.js:42:26 
    at ChildProcess.  (/volume1/@appstore/Ulozto/api.js:72:5) 
    at emitTwo (events.js:87:13) 
    at ChildProcess.emit (events.js:172:7) 
    at maybeClose (internal/child_process.js:827:16) 
    at Socket. (internal/child_process.js:319:11) 
    at emitOne (events.js:77:13) 
    at Socket.emit (events.js:169:7) 
    at Pipe._onclose (net.js:477:12) 
gabonator commented 7 years ago

how to reproduce this problem? what exactly you have been looking for? Just tried it now and everything is working well. But I noticed that ulozto is having some problems with their servers, many times it shows webpage "server busy..."

svasek commented 7 years ago

I don't know yet. After approx. 30 downloads from ulozto it started to failing on every request to download. Restart didn't help. Only uninstall and install solved/workaround the problem.

gabonator commented 7 years ago

Could you please add a line as in following code in api.js ? So we can see what server responded with

 myRequest(mainurl, function(body) {
    console.log(body);  // <-------- ADD THIS LINE
    body = body.split("\r").join("").split("\n").join("#");

    keepCookie  = body.match("(ULOSESSID=.*?);")[1];
    keepCookie += "; "+body.match("(uloztoid=.*?);")[1];
    //keepCookie += "; maturity=adult";

    var newLocation = body.match("#Location: (.*?)#");
    mainurl = newLocation[1];
    doMainRequest(doCaptcha);
  });
}
svasek commented 7 years ago

Attaching the log file: ulozto-log.txt

gabonator commented 7 years ago

the url it tries to download is not valid, in the response you can find "Stranka nenalezena" message. When did you try to download the file? Probably the URL is not valid anymore, maybe its validity is just few hours

Try it: "http://ulozto.cz/file-tracking/1c2b99d606986e131529e251776be60f2b4f47a503d6d2af553fc1822bd0be2d3cf3185851653add332592aa555cc289"

svasek commented 7 years ago

I downloaded it by clicking in the search results. Anyway we should fix the stopping of the service once this occur.

gabonator commented 7 years ago

But did you start the download process right after adding the URL to download list? For me it seems like the download URL was queued in list for few hours (maybe you wanted to download more files at once). I don't know how to fix this problem... Maybe when it will happen to me I will investigate it more deeply. But we need to keep in mind that the "file-tracking" urls are valid for short period of time, they just redirect you to the right URL. Maybe it would be good idea to obtain the redirection link right after you add the url to download queue. But I think the synology download station plugins does not offer this option...

Ok, I will fix the crash at least, probably during weekend

gabonator commented 7 years ago

I tried to fix the issue in latest commit, please let me know if the issue will happen again. It was caused by downloading outdated URL as I suggested in previous comment, I was able to reproduce the problem quite easily, validity of the URL is probably just 15 minutes