diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-11-06 20:45:12 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-11-06 20:45:12 +0100 |
commit | cf74243d9ac67916a0739a51f158ca96957bd28e (patch) | |
tree | fb5124e5ca196db96a5d5494012de29d09071fb0 | |
parent | overrode requests' 'educated' encoding guesses (diff) | |
download | biblos-stat-cf74243d9ac67916a0739a51f158ca96957bd28e.tar biblos-stat-cf74243d9ac67916a0739a51f158ca96957bd28e.tar.gz biblos-stat-cf74243d9ac67916a0739a51f158ca96957bd28e.tar.bz2 biblos-stat-cf74243d9ac67916a0739a51f158ca96957bd28e.tar.lz biblos-stat-cf74243d9ac67916a0739a51f158ca96957bd28e.tar.xz biblos-stat-cf74243d9ac67916a0739a51f158ca96957bd28e.tar.zst biblos-stat-cf74243d9ac67916a0739a51f158ca96957bd28e.zip |
-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 |