Skip to content

Commit 5d42868

Browse files
committed
Fix download of DRM-free books
1 parent 399db07 commit 5d42868

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kobodl/kobo.py

+4
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ def __GetDownloadInfo(
273273
for key in download_keys:
274274
download_url = jsonContentUrl.get(key, None)
275275
if download_url:
276+
parsed = urllib.parse.urlparse( download_url )
277+
parsedQueries = urllib.parse.parse_qs( parsed.query )
278+
parsedQueries.pop( "b", None ) # https://github.com/TnS-hun/kobo-book-downloader/commit/54a7f464c7fdf552e62c209fb9c3e7e106dabd85
279+
download_url = parsed._replace( query = urllib.parse.urlencode( parsedQueries, doseq = True ) ).geturl()
276280
return download_url, hasDrm
277281

278282
message = f"Download URL for supported formats can't be found for product '{productId}'.\n"

0 commit comments

Comments
 (0)