mirror of
https://github.com/ClaytonWWilson/Scraper-for-theTVDB.com.git
synced 2025-12-15 17:28:46 +00:00
Refactoring - Small code fixes.
This commit is contained in:
parent
7298c82ceb
commit
2edfc5be14
@ -37,7 +37,7 @@ def login():
|
|||||||
tmp_user_key = input("Enter your Unique ID: ")
|
tmp_user_key = input("Enter your Unique ID: ")
|
||||||
while tmp_api_key is "":
|
while tmp_api_key is "":
|
||||||
tmp_api_key = input("Enter your API Key: ")
|
tmp_api_key = input("Enter your API Key: ")
|
||||||
except KeyboardInterrupt as e:
|
except KeyboardInterrupt:
|
||||||
print("\n")
|
print("\n")
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ def refreshToken():
|
|||||||
obj.write(json.dumps(login))
|
obj.write(json.dumps(login))
|
||||||
obj.close()
|
obj.close()
|
||||||
print("New token acquired!\n")
|
print("New token acquired!\n")
|
||||||
except Exception as e:
|
except Exception:
|
||||||
print("You need to log in first. Select Login/Change login.\n") # TODO make a set of constants for error codes
|
print("You need to log in first. Select Login/Change login.\n") # TODO make a set of constants for error codes
|
||||||
else:
|
else:
|
||||||
print("You need to log in first. Select Login/Change login.\n")
|
print("You need to log in first. Select Login/Change login.\n")
|
||||||
|
|||||||
@ -39,11 +39,6 @@ def search():
|
|||||||
print("There was an error checking your login. Try logging in again with 'Login/Change login'.")
|
print("There was an error checking your login. Try logging in again with 'Login/Change login'.")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# All login checks pass and search starts
|
|
||||||
FAN_KEY_TYPE = "?keyType=fanart" # These are used in the search strings
|
|
||||||
POS_KEY_TYPE = "?keyType=poster"
|
|
||||||
BAN_KEY_TYPE = "?keyType=series"
|
|
||||||
|
|
||||||
authHeaders = {
|
authHeaders = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Accept": "application/json",
|
"Accept": "application/json",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user