pyload-bookmarklet icon indicating copy to clipboard operation
pyload-bookmarklet copied to clipboard

Issue with some character encoding

Open ghost opened this issue 5 years ago • 6 comments

Hello I'm using the method 2 to submit packages, and it fails for certain links. Experiments show that this happens when links contain double-byte characters. They're correctly sent, i.e. with a proper URL encoding, but do not seem to be properly processed by pyload API (?), since there's a log entry as follows:

1070 | 30.03.2019 09:29:34 | INFO | Added package Library Genesis containing 1 links

But then nothing happens.

Here's how to reproduce:

  • Go to http://lib1.org/fiction/a650c7aa35062eaab4de8209d62d69fb
  • Use the bookmarklet to send the GET link for download (http://download.library1.org/fiction/960000/a650c7aa35062eaab4de8209d62d69fb.epub/Mourlevat%2C%20Jean-Claude%20-%20L%27homme%20qui%20ne%20poss%C3%A9dait%20rien.epub)
  • Pyload seems to receive the request and detect that one link is provided, but no download is ever started.

This website is very practical for testing since any text after the last / will serve the same file, so the following links will be a valid download link:

  • http://download.library1.org/fiction/960000/a650c7aa35062eaab4de8209d62d69fb.epub/Mourlevat%2C%20Jean-Claude%20-%20L%27homme%20qui%20ne%20poss%C3%A9dait%20rien.epub (not working)
  • http://download.library1.org/fiction/960000/a650c7aa35062eaab4de8209d62d69fb.epub/Mourlevat%2C%20Jean-Claude%20-%20L%27homme%20qui%20ne%20poss (working!)
  • http://download.library1.org/fiction/960000/a650c7aa35062eaab4de8209d62d69fb.epub/Mourlevat%2C%20Jean-Claude%20-%20L%27homme%20qui%20ne%20poss%C3%A9 (not working)

Note that the same link works fine when added through the pyload UI.

ghost avatar Mar 30 '19 10:03 ghost

Any idea what's going on here? I suspect it's an issue on Pyload side, not the bookmarklet, as it happens both with or without prior URL-encoding... But I'm not certain.

ghost avatar Apr 04 '19 10:04 ghost

Any idea what's going on here? I suspect it's an issue on Pyload side, not the bookmarklet, as it happens both with or without prior URL-encoding... But I'm not certain.

I'm afraid you are right, pyload cannot handle correctly unicode file names :cry:

GammaC0de avatar Apr 05 '19 20:04 GammaC0de

But the strange thing is that the same URLs work fine when added through the pyload UI (which submits differently)... I still think there's a way to make it work, but I don't know pyload well enough to figure it out...

ghost avatar Apr 06 '19 01:04 ghost

The package name could be the issue.

GammaC0de avatar Apr 06 '19 01:04 GammaC0de

I don't think so since in the URL samples I provided above, the working and not working URLs have the same packager name. I will try to see if I can emulate the web UI behavior in the bookmarklet by POSTing the values as multipart form values instead of GET URIs... This would probably solve the issue, but I'm not yet sure if the bookmarklet sandboxing will let me do this...

ghost avatar Apr 17 '19 07:04 ghost

OK, this is indeed fixed by POSTing as multipart form data, confirming that it's a bookmarklet issue and not a PyLoad issue... I can send a PR but my changes might break a few things that I prefered handled differently (e.g. always rely on existing cookie authentication and never on hardcoded user/password). I'm also now posting into an invisible iframe inside the bookmarklet window so that we don't see the flashing window, and we wait for that iframe's load event to close it instead of using a timer. I'll send it out later this week after I'm done with some more testing.

ghost avatar Apr 17 '19 14:04 ghost