mirror of
https://github.com/Xpl0itU/WiiUDownloader.git
synced 2025-05-31 07:18:25 -04:00
Revert grabTitles.py
This commit is contained in:
parent
e3334c9d0e
commit
6eb393f4f9
1 changed files with 10 additions and 11 deletions
|
@ -1,7 +1,8 @@
|
||||||
#!/bin/env python
|
#!/bin/env python
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import requests
|
import urllib.request
|
||||||
|
import ssl
|
||||||
|
|
||||||
# Don't edit below this line
|
# Don't edit below this line
|
||||||
|
|
||||||
|
@ -12,16 +13,14 @@ def checkAndDeleteFile(file):
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
|
|
||||||
|
|
||||||
def downloadFile(url, file, headers={}):
|
# Disable certificate verification
|
||||||
print(f"Downloading {file}")
|
ssl_context = ssl.create_default_context()
|
||||||
with requests.get(url, headers=headers) as r:
|
ssl_context.check_hostname = False
|
||||||
with open(file, "wb") as f:
|
ssl_context.verify_mode = ssl.CERT_NONE
|
||||||
f.write(r.content)
|
|
||||||
|
|
||||||
|
opener = urllib.request.build_opener(urllib.request.HTTPSHandler(context=ssl_context))
|
||||||
|
opener.addheaders = [("User-agent", "NUSspliBuilder/2.1")]
|
||||||
|
urllib.request.install_opener(opener)
|
||||||
|
|
||||||
checkAndDeleteFile("db.go")
|
checkAndDeleteFile("db.go")
|
||||||
downloadFile(
|
urllib.request.urlretrieve("https://napi.v10lator.de/db?t=go", "db.go")
|
||||||
"https://napi.v10lator.de/db?t=go",
|
|
||||||
"db.go",
|
|
||||||
{"User-Agent": "NUSspliBuilder/2.2", "Accept-Encoding": "br, gzip, deflate"},
|
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue