Merge branch 'fix/gofile' into main

This commit is contained in:
shayaa
2026-03-11 22:26:10 +01:00
committed by GitHub
5 changed files with 37 additions and 22 deletions
+15 -6
View File
@@ -8,24 +8,33 @@ def scrape_gofile(url):
filetoken = re.findall(r"(?<=https...gofile.io\/d\/).*", url)[0]
session = requests.Session()
acc = session.post("https://api.gofile.io/accounts")
token = acc.json()["data"]["token"]
headers = {
"Authorization": f"Bearer {token}",
"X-Website-Token": "4fd6sg89d7s6", # Maybe make this dynamic in the future
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:148.0) Gecko/20100101 Firefox/148.0",
"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.9",
"Accept-Encoding": "gzip, deflate, br, zstd",
"Referer": "https://gofile.io/",
"Authorization": f"Bearer lUUtRAccOuRUoZhelNSslDFSlpOgKLDj",
"X-Website-Token": "ffd9ffa831c50b9e68ca5e65cbbbd1a50e9a32e63022e17c7c6748388a1ed73b",
"X-BL": "en-US",
"Origin": "https://gofile.io",
"Sec-GPC": "1",
"Connection": "keep-alive",
"TE": "trailers"
}
r = session.get(
f"https://api.gofile.io/contents/{filetoken}",
headers=headers,
)
try:
temp: dict = r.json()["data"]["children"]
child = [key for key in temp.keys()]
return temp[child[0]]["link"]
link = temp[child[0]]["link"]
return link, headers
except:
consoleLog("GoFile Authorisation failed, if the Issue persists, please open an Issue on GitHub")
+6 -8
View File
@@ -69,10 +69,6 @@ def scrape_steamrip_game_downloads(gamelink):
download_links[0] = "https:" + pure
if pure[2] == "g":
download_links[1] = "https:" + pure
if pure[2] == "v":
download_links[2] = "https:" + pure
if pure[2] == "m":
download_links[3] = "https:" + pure
ret = []
@@ -94,13 +90,15 @@ def get_download_link(post: Dict):
break
if links.index(best) == 0:
return scrape_buzzheavier(best)
link = scrape_buzzheavier(best)
return link
elif links.index(best) == 1:
return scrape_gofile(best)
link, headers = scrape_gofile(best)
return link, headers
else:
consoleLog("Unable to retrieve download link due to captcha, launching browser...")
webbrowser.open(best)
return None
return None, None
def filter_steamrip(query: str):
games = scrape_steamrip_links()
@@ -121,4 +119,4 @@ Metadata = {
}
def init_steamrip():
state.trackers.update({Metadata["name"] : Metadata})
state.trackers.update({Metadata["name"] : Metadata})