Calibre StorePlugin: Download Chunked Response
I'm developing a StorePlugin for Calibre and I've managed to get the bulk of the parsing completed, but when it gets down to the actual downloading of the ebook, I'm running into some issues.
The page I'm scraping from to retrieve download links supplies them in the format "http://server.com/get.php?fileID=XXXX". Checking the headers, it's giving a chunked response. Here's the info:
Connection → keep-alive
Content-Encoding → gzip
Transfer-Encoding → chunked
Throwing any download link like this in Calibre throws a ValueError (I'm assuming because it's just saving empty page as the file, not the chunked data referred to by the header.)
Any ideas on how to tackle this so I can either provide a proper link or somehow patch in chunked response support?
|