kolyvan / kybook

modern ebook reader for iOS
83 stars 10 forks source link

Cannot Download urlencoded Data from OPDS #296

Open isyangban opened 4 years ago

isyangban commented 4 years ago

Hi. Thanks for the great app.

I found that the app throws an error when trying to download from an url encoded (percent encoded url, RFC) url.

Here's an example opds and

<entry>
<title>
한국 [韓国] Korean
</title>
<updated>2020-04-20T06:18:03.887851Z</updated>
<id>3215</id>
<content>CBZ - 14 MiB</content>
<link type="image/jpeg" rel="http://opds-spec.org/image/thumbnail" href="/opds/v1.2/books/3215/thumbnail"/>
<link type="image/jpeg" rel="http://opds-spec.org/image" href="/opds/v1.2/books/3215/pages/1"/>
<link type="application/zip" rel="http://opds-spec.org/acquisition" href="/opds/v1.2/books/3215/file/%ED%95%9C%EA%B5%AD%20%5B%E9%9F%93%E5%9B%BD%5D%20Korean.cbz"/>
<link xmlns:wstxns1="http://vaemendis.net/opds-pse/ns" href="/opds/v1.2/books/3215/pages/{pageNumber}?convert=jpeg&zero_based=true" wstxns1:count="24" type="image/jpeg" rel="http://vaemendis.net/opds-pse/stream"/>
</entry>

When the file is downloaded, the file name should be 한국 [韓国] Korean.cbz not %ED%95%9C%EA%B5%AD%20%5B%E9%9F%93%E5%9B%BD%5D%20Korean.cbz I think you should try to url decode the last part for the downloaded filename. The file cannot be downloaded anyways (the apps throws an error) but if you fix it, the wrong filename will be fixed together.

isyangban commented 4 years ago

It's a KyBook3 issue btw