Leseratte10 / acsm-calibre-plugin

Calibre plugin for ACSM->EPUB and ACSM->PDF conversion.
https://www.mobileread.com/forums/showthread.php?t=341975
GNU General Public License v3.0
600 stars 23 forks source link

Not working with books from CloudLibrary #22

Closed bgiesing closed 2 years ago

bgiesing commented 2 years ago

Bug description

Importing acsm books from Libby/Overdrive works fine but anything from CloudLibrary just imports the ACSM itself with the book having no metadata (just called the name of the book + the number id in the file name). Adobe imports the file fine and the plugin still can't fulfill it even after Adobe does (so it's not a case of only not working on initial auth then working on subsequent auths)

Log:

stdout+stderr from file dialog helper: [b'', b'']
piped data from file dialog helper: [b'\\WEc\x05O\x02O\x18\xe7\x99!a\xf0\x9c\xa3!\xa2\xbc\xf0\x8eHh\xb3r\xe3\xae\xe9\x19\x0b\x11\x9c', b'D:\\Downloads\\What Would Google Do__9780061893933.acsm']
Running file type plugin DeACSM failed with traceback:
Traceback (most recent call last):
  File "calibre\customize\ui.py", line 175, in _run_filetype_plugins
  File "calibre_plugins.deacsm.__init__", line 378, in run
  File "calibre_plugins.deacsm.libadobeFulfill", line 420, in fulfill
  File "calibre_plugins.deacsm.libadobeFulfill", line 674, in performFulfillmentNotification
  File "calibre_plugins.deacsm.libadobe", line 307, in sendRequestDocuRC
  File "calibre_plugins.deacsm.libadobe", line 273, in sendPOSTHTTPRequest
  File "urllib\request.py", line 328, in __init__
  File "urllib\request.py", line 354, in full_url
  File "urllib\request.py", line 383, in _parse
ValueError: unknown url type: 'fulfillment.yourcloudlibrary.com/notify'
Integration status: True
DeACSM v0.0.15: Trying to parse file What Would Google Do__9780061893933.acsm
DeACSM v0.0.15: Try to fulfill ...
Notifying server ...
Notifying server http://fulfillment.yourcloudlibrary.com/fulfillment/FulfillmentNotification
Fulfillment notification successful.
Notifying optional server fulfillment.yourcloudlibrary.com/notify

Operating system

Windows

Which version of Calibre are you running?

5.42

Which version of the DeACSM plugin are you running?

v0.0.15

Further information

No response

Leseratte10 commented 2 years ago

Looks like CloudLibrary doesn't include a protocol in their URL and just uses fulfillment.yourcloudlibrary.com/notify instead of http://fulfillment.yourcloudlibrary.com/notify, and the python HTTP module doesn't like that. I'm going to add some code to make it fallback to HTTP if no protocol is included in the file.

Thanks for the report.

Leseratte10 commented 2 years ago

This bug should now be fixed with commit 137fc82fa834fef3560f9c58af5276896eaf2fb1. You can download and test that version on the Actions page (https://github.com/Leseratte10/acsm-calibre-plugin/actions/runs/2304883636 ) if you want; the fix will be included in the next release.

JJTech0130 commented 2 years ago

Weird. Must have changed recently or something. I’ve used books from CloudLibrary before, and never encountered this.

bgiesing commented 2 years ago

Just tested and yep, it fixes it.