mirror of
https://gitlab.com/moepoi/Quintal-Grabber.git
synced 2024-12-22 06:25:11 +01:00
Fix error when input Invalid ID
This commit is contained in:
parent
39ae303a68
commit
65a693515f
1 changed files with 3 additions and 4 deletions
|
@ -17,10 +17,9 @@ class QuintalGrabber:
|
|||
self.host = "https://quintal.id"
|
||||
self.id = str(id)
|
||||
self.endpoint = "/id/api/initial_data/{}/?format=json".format(self.id)
|
||||
try:
|
||||
self.req = requests.get(self.host + self.endpoint)
|
||||
self.data = json.loads(self.req.text)
|
||||
except:
|
||||
self.req = requests.get(self.host + self.endpoint)
|
||||
self.data = json.loads(self.req.text)
|
||||
if "status" in self.data:
|
||||
print ("Invalid ID")
|
||||
sys.exit()
|
||||
|
||||
|
|
Loading…
Reference in a new issue