Last active
March 14, 2022 18:48
-
-
Save andronedev/a3545c8b3c5f23acb928d2ede07f5acd to your computer and use it in GitHub Desktop.
VANCED SCRAPPER
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import os | |
import sys | |
androidVariants = ["armv7", "armv8", "x86", "x86_64", "arm64_v8a", "x86_64_aarch64"] | |
languages = ["fr", "en", "de", "es","it", "nl", "pl", "pt", "ru", "sv", "tr", "uk"] | |
themes = ["black", "dark"] | |
roots = ["root", "nonroot"] | |
def get_version(): | |
url = "https://api.vancedapp.com/api/v1/versions.json" | |
response = requests.get(url) | |
data = response.json() | |
return data | |
def download(url): | |
response = requests.get(url) | |
if response.status_code == 200: | |
return response.content | |
else: | |
print("Error downloading {}".format(url)) | |
return None | |
def save_to_file(data, filename): | |
if data != None: | |
# create directory if not exists | |
if not os.path.exists(os.path.dirname(filename)): | |
os.makedirs(os.path.dirname(filename)) | |
with open(filename, "wb") as f: | |
f.write(data) | |
else: | |
print("{} not found. SKIP".format(filename)) | |
def main(): | |
version = get_version() | |
for v in version["vanced"]: | |
for root in roots: | |
for theme in themes: | |
url = "https://vancedapp.com/api/v1/apks/v{}/{}/Theme/{}.apk".format(v, root, theme) | |
data = download(url) | |
save_to_file(data, "./backup/{}/{}/Theme/{}.apk".format(v, root, theme)) | |
print("{}/{}/Theme/{}.apk".format(v, root, theme)) | |
for lang in languages: | |
url = "https://vancedapp.com/api/v1/apks/v{}/{}/Language/split_config.{}.apk".format(v, root, lang) | |
data = download(url) | |
save_to_file(data, "./backup/{}/{}/Language/split_config.{}.apk".format(v, root, lang)) | |
print("{}/{}/Language/split_config.{}.apk".format(v, root, lang)) | |
for arch in androidVariants: | |
url = "https://vancedapp.com/api/v1/apks/v{}/{}/Arch/split_config.{}.apk".format(v, root, arch) | |
data = download(url) | |
save_to_file(data, "./backup/{}/{}/Arch/split_config.{}.apk".format(v, root, arch)) | |
print("{}/{}/Arch/split_config.{}.apk".format(v, root, arch)) | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment