diff options
-rwxr-xr-x | gather.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -93,10 +93,10 @@ try: if acsm_id < guaranteed_large_acsm_id: logger.error(f"this shouldn't happen. I have a hardcoded value that tells me that at time of program writing, acsm id {guaranteed_large_acsm_id} did exist on the server. dying anyways.") break - elif r.text.startswith('<error xmlns="http://ns.adobe.com/adept" data="E_URLLINK_NO_SUCH_RESOURCE resid urn:uuid:00000000-1002-0000-0009-78'): - isbn = int(r.text.split()[4].split("-").pop())+int(9e12) + elif r.text.startswith('<error xmlns="http://ns.adobe.com/adept" data="E_URLLINK_NO_SUCH_RESOURCE resid urn:uuid:00000000-1002-0000-0009-78') or r.text.startswith('<error xmlns="http://ns.adobe.com/adept" data="E_URLLINK_NO_DISTRIBUTION_RIGHTS urn:uuid:00000000-1002-0000-0009-78'): + isbn = int([x for x in r.text.split() if x.startswith("urn:uuid:00000000-1002-0000-0009-78")][0].split("-").pop())+int(9e12) borrow = Borrow(id=acsm_id, isbn=isbn, obtained=int(time())) - logger.warning(f"received 'no such resource' from server and stored a quite empty {borrow}") + logger.warning(f"received either 'no such resource' or 'no distribution rights' from server and stored a quite empty {borrow}") session.add(borrow) session.commit() only_isbn_acsms += 1 |