diff --git a/webarchiv.py b/webarchiv.py index 189c7b173af8658a20597227ff2ef89eb0977488..ee597e88baed6c0c1df63f6519aeaa7ddcb59428 100644 --- a/webarchiv.py +++ b/webarchiv.py @@ -305,7 +305,21 @@ class WebarchivSession: print('Error:'.format(query_string)) def getSnapshotUrl(self, seed, capture, onlysvg): - return self.api_path + 'snapshot?capture=' + capture + '&t=' + self.token + '&apikey=' + self.api_key + '&onlysvg=' + onlysvg + '&seed=' + seed; + return self.api_path + 'snapshot?capture=' + capture + '&t=' + self.token + '&apikey=' + self.api_key + '&onlysvg=' + onlysvg + '&seed=' + seed + + @staticmethod + def resultContainsSeeds(response): + try: + return response.json()['subtype'] == 2 + except: + return False + + @staticmethod + def resultContainsCaptures(response): + try: + return response.json()['subtype'] == 3 + except: + return False def savePage(self, url): self.connect()