Downloader
This commit is contained in:
BIN
modules/__pycache__/dl.cpython-310.pyc
Normal file
BIN
modules/__pycache__/dl.cpython-310.pyc
Normal file
Binary file not shown.
BIN
modules/__pycache__/storergadguard.cpython-310.pyc
Normal file
BIN
modules/__pycache__/storergadguard.cpython-310.pyc
Normal file
Binary file not shown.
27
modules/dl.py
Normal file
27
modules/dl.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import requests
|
||||
|
||||
|
||||
def download(links: dict, path: str, architecture: str):
|
||||
for name in list(links):
|
||||
if architecture in name or 'neutral' in name:
|
||||
if 'msixbundle' not in name:
|
||||
print(f"Downloading {name}")
|
||||
with open(path + '\\' + name, 'wb') as f:
|
||||
f.write(requests.get(links[name]).content)
|
||||
|
||||
bundles = dict()
|
||||
for name in list(links):
|
||||
if 'msixbundle' in name and 'emsixbundle' not in name:
|
||||
bundles[name.split('_')[1]] = [links[name], name]
|
||||
|
||||
print("Found versions of app:")
|
||||
for name in list(bundles):
|
||||
print(name)
|
||||
|
||||
version = input("Which version do you want to download? \nType here: ")
|
||||
|
||||
with open(path + '\\' + bundles[version][1], 'wb') as f:
|
||||
print(f"Downloading {bundles[version][1]}")
|
||||
f.write(requests.get(bundles[version][0]).content)
|
||||
|
||||
print("DOWNLOAD COMPLETE")
|
||||
25
modules/storergadguard.py
Normal file
25
modules/storergadguard.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import requests
|
||||
import re
|
||||
|
||||
api_url = "https://store.rg-adguard.net/api/GetFiles"
|
||||
|
||||
|
||||
def get_files(product_url):
|
||||
print("Collecting links...")
|
||||
r = requests.post(api_url, data={
|
||||
'type': 'url',
|
||||
'url': product_url,
|
||||
'ring': 'Slow',
|
||||
'lang': 'en-US'
|
||||
}).text
|
||||
|
||||
links = dict()
|
||||
for line in r.split("\n"):
|
||||
try:
|
||||
link = re.search('<tr style.*<a href=\"(?P<url>.*)"\s.*>(?P<text>.*)<\/a>', line).groups()
|
||||
if re.search("_(x86|x64|neutral).*appx|msix(|bundle)$", link[1]):
|
||||
links[link[1]] = link[0]
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
return links
|
||||
Reference in New Issue
Block a user