mirror of
https://github.com/Leseratte10/acsm-calibre-plugin.git
synced 2024-12-23 01:34:36 +06:00
Support for Google Play books without metadata node
This commit is contained in:
parent
1ac47e81e7
commit
f9fbc4172a
@ -319,6 +319,7 @@ def fulfill(acsm_file, do_notify = False):
|
|||||||
adNS = lambda tag: '{%s}%s' % ('http://ns.adobe.com/adept', tag)
|
adNS = lambda tag: '{%s}%s' % ('http://ns.adobe.com/adept', tag)
|
||||||
dcNS = lambda tag: '{%s}%s' % ('http://purl.org/dc/elements/1.1/', tag)
|
dcNS = lambda tag: '{%s}%s' % ('http://purl.org/dc/elements/1.1/', tag)
|
||||||
|
|
||||||
|
try:
|
||||||
mimetype = acsmxml.find("./%s/%s/%s" % (adNS("resourceItemInfo"), adNS("metadata"), dcNS("format"))).text
|
mimetype = acsmxml.find("./%s/%s/%s" % (adNS("resourceItemInfo"), adNS("metadata"), dcNS("format"))).text
|
||||||
|
|
||||||
if (mimetype == "application/pdf"):
|
if (mimetype == "application/pdf"):
|
||||||
@ -331,6 +332,10 @@ def fulfill(acsm_file, do_notify = False):
|
|||||||
print("Weird mimetype: %s" % (mimetype))
|
print("Weird mimetype: %s" % (mimetype))
|
||||||
print("Continuing anyways ...")
|
print("Continuing anyways ...")
|
||||||
|
|
||||||
|
except:
|
||||||
|
# Some books, like from Google Play books, use a different format and don't have that metadata tag.
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
fulfill_request, adept_ns = buildFulfillRequest(acsmxml)
|
fulfill_request, adept_ns = buildFulfillRequest(acsmxml)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user