Support for Google Play books without metadata node

This commit is contained in:
Florian Bach 2021-12-12 09:35:28 +01:00
parent 1ac47e81e7
commit f9fbc4172a

View File

@ -319,6 +319,7 @@ def fulfill(acsm_file, do_notify = False):
adNS = lambda tag: '{%s}%s' % ('http://ns.adobe.com/adept', 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
if (mimetype == "application/pdf"):
@ -331,6 +332,10 @@ def fulfill(acsm_file, do_notify = False):
print("Weird mimetype: %s" % (mimetype))
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)