mirror of
https://gitlab.com/moepoi/Quintal-Grabber.git
synced 2024-12-22 14:34:58 +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.host = "https://quintal.id"
|
||||||
self.id = str(id)
|
self.id = str(id)
|
||||||
self.endpoint = "/id/api/initial_data/{}/?format=json".format(self.id)
|
self.endpoint = "/id/api/initial_data/{}/?format=json".format(self.id)
|
||||||
try:
|
self.req = requests.get(self.host + self.endpoint)
|
||||||
self.req = requests.get(self.host + self.endpoint)
|
self.data = json.loads(self.req.text)
|
||||||
self.data = json.loads(self.req.text)
|
if "status" in self.data:
|
||||||
except:
|
|
||||||
print ("Invalid ID")
|
print ("Invalid ID")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue