mirror of
https://github.com/ClaytonWWilson/Scraper-for-theTVDB.com.git
synced 2025-12-18 10:18:48 +00:00
Fixed some imports
This commit is contained in:
parent
64239e36ab
commit
da958cce55
@ -8,6 +8,9 @@ import subprocess
|
|||||||
from checks import checkTimestamp
|
from checks import checkTimestamp
|
||||||
from checks import getToken
|
from checks import getToken
|
||||||
|
|
||||||
|
def wait():
|
||||||
|
input("Press enter to continue.")
|
||||||
|
|
||||||
def clear_screen():
|
def clear_screen():
|
||||||
IS_WINDOWS = os.name == "nt"
|
IS_WINDOWS = os.name == "nt"
|
||||||
if IS_WINDOWS:
|
if IS_WINDOWS:
|
||||||
|
|||||||
@ -6,10 +6,6 @@ from search import search
|
|||||||
def user_choice():
|
def user_choice():
|
||||||
return input("> ").lower().strip()
|
return input("> ").lower().strip()
|
||||||
|
|
||||||
def wait():
|
|
||||||
input("Press enter to continue.")
|
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
clear_screen()
|
clear_screen()
|
||||||
print("=============================\n"
|
print("=============================\n"
|
||||||
|
|||||||
20
search.py
20
search.py
@ -2,9 +2,9 @@ import requests
|
|||||||
import json
|
import json
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import os.path
|
import os.path
|
||||||
from launcher import wait
|
from actions import wait
|
||||||
|
|
||||||
|
|
||||||
# import login
|
|
||||||
|
|
||||||
def searchRemainder(imageType, saveNameList, idNum):#Finds any images missing from the api call in getImages
|
def searchRemainder(imageType, saveNameList, idNum):#Finds any images missing from the api call in getImages
|
||||||
numbers = []
|
numbers = []
|
||||||
@ -73,7 +73,7 @@ def search():
|
|||||||
if checkTimestamp(saveTime, curTime) == False:
|
if checkTimestamp(saveTime, curTime) == False:
|
||||||
print("Your token has expired. Get a new one by choosing Refresh Token.")
|
print("Your token has expired. Get a new one by choosing Refresh Token.")
|
||||||
return None
|
return None
|
||||||
else: # All login checks pass and search starts
|
else: # All login checks pass and search starts # TODO move everything below out of the try except
|
||||||
FAN_KEY_TYPE = "?keyType=fanart" # These are used in the search strings
|
FAN_KEY_TYPE = "?keyType=fanart" # These are used in the search strings
|
||||||
POS_KEY_TYPE = "?keyType=poster"
|
POS_KEY_TYPE = "?keyType=poster"
|
||||||
BAN_KEY_TYPE = "?keyType=series"
|
BAN_KEY_TYPE = "?keyType=series"
|
||||||
@ -131,13 +131,11 @@ def search():
|
|||||||
fanart = searchImages(idNum, FAN_KEY_TYPE, authHeaders) # for banners, fanart, and posters
|
fanart = searchImages(idNum, FAN_KEY_TYPE, authHeaders) # for banners, fanart, and posters
|
||||||
poster = searchImages(idNum, POS_KEY_TYPE, authHeaders)
|
poster = searchImages(idNum, POS_KEY_TYPE, authHeaders)
|
||||||
banner = searchImages(idNum, BAN_KEY_TYPE, authHeaders)
|
banner = searchImages(idNum, BAN_KEY_TYPE, authHeaders)
|
||||||
|
|
||||||
|
downloadImages("fanart", fanart, idNum) # TODO find a better way to pass these variables. Constructor?
|
||||||
|
downloadImages("poster", poster, idNum)
|
||||||
|
downloadImages("banner", banner, idNum)
|
||||||
|
return None
|
||||||
except:
|
except:
|
||||||
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'.")
|
||||||
break
|
return None
|
||||||
|
|
||||||
|
|
||||||
downloadImages("fanart", fanart, idNum) # TODO find a better way to pass this variable
|
|
||||||
|
|
||||||
downloadImages("poster", poster, idNum)
|
|
||||||
|
|
||||||
downloadImages("banner", banner, idNum)
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user