Allow tools functions to be used offline

This commit is contained in:
mez 2025-08-28 17:15:23 +01:00
parent 557f006884
commit e179b011f2

View file

@ -6,22 +6,24 @@ import log,variables
values = ["red","orange","yellow","green","blue","purple","brown","gray","special","limited"]
numbers = ["01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20"]
print("Getting list of deck colours")
deckkey = {}
request = requests.get("https://colors-tcg.eu/cards.php?view=alpha")
alldecks = open("key.html","w")
alldecks.write(request.text)
alldecks.close()
try:
request = requests.get("https://colors-tcg.eu/cards.php?view=alpha")
print("Getting list of deck colours")
alldecks = open("key.html","w")
alldecks.write(request.text)
alldecks.close()
# need to correct some html issues
# need to correct some html issues
with open("key.html","r") as file:
filedata = file.read()
filedata = filedata.replace("</td></td>","</td>")
with open("key.html","w") as file:
file.write(filedata)
with open("key.html","r") as file:
filedata = file.read()
filedata = filedata.replace("</td></td>","</td>")
with open("key.html","w") as file:
file.write(filedata)
except:
print("Using cached version of decklist")
with open("key.html") as decks:
decksoup = BeautifulSoup(decks, "html.parser")