Merge pull request #106 from nikhilbadyal/download-from-apkmirror [skip ci]

 Download apks from apkmirror instead of uptodown
This commit is contained in:
Nikhil Badyal
2022-12-21 15:26:50 +05:30
committed by GitHub
4 changed files with 18 additions and 11 deletions
+3 -3
View File
@@ -128,13 +128,13 @@ By default, script build the version as recommended by Revanced team.
6. [warnwetter](https://www.apkmirror.com/apk/deutscher-wetterdienst/warnwetter/) 6. [warnwetter](https://www.apkmirror.com/apk/deutscher-wetterdienst/warnwetter/)
7. [spotify](https://spotify.en.uptodown.com/android) 7. [spotify](https://spotify.en.uptodown.com/android)
8. [nyx-music-player](https://nyx-music-player.en.uptodown.com/android) 8. [nyx-music-player](https://nyx-music-player.en.uptodown.com/android)
9. [icon-pack-studio](https://icon-pack-studio.en.uptodown.com/android) 9. [icon_pack_studio](https://www.apkmirror.com/apk/smart-launcher-team/icon-pack-studio/)
10. [ticktick](https://www.apkmirror.com/apk/appest-inc/ticktick-to-do-list-with-reminder-day-planner/) 10. [ticktick](https://www.apkmirror.com/apk/appest-inc/ticktick-to-do-list-with-reminder-day-planner/)
11. [twitch](https://twitch.en.uptodown.com/android) 11. [twitch](https://www.apkmirror.com/apk/twitch-interactive-inc/twitch/)
12. [hex-editor](https://m.apkpure.com/hex-editor/com.myprog.hexedit) 12. [hex-editor](https://m.apkpure.com/hex-editor/com.myprog.hexedit)
13. [citra](https://www.apkmirror.com/apk/citra-emulator/citra-emulator/) 13. [citra](https://www.apkmirror.com/apk/citra-emulator/citra-emulator/)
14. [crunchyroll](https://www.apkmirror.com/apk/ellation-inc/crunchyroll/) 14. [crunchyroll](https://www.apkmirror.com/apk/ellation-inc/crunchyroll/)
15. [windy](https://windy.en.uptodown.com/android) 15. [windy](https://www.apkmirror.com/apk/windy-weather-world-inc/windy-wind-weather-forecast/)
16. [my-expenses](https://my-expenses.en.uptodown.com/android) 16. [my-expenses](https://my-expenses.en.uptodown.com/android)
17. [backdrops](https://backdrops.en.uptodown.com/android) 17. [backdrops](https://backdrops.en.uptodown.com/android)
18. [sleep-as-android](https://sleep-as-android.en.uptodown.com/android) 18. [sleep-as-android](https://sleep-as-android.en.uptodown.com/android)
+6 -3
View File
@@ -22,9 +22,6 @@ class RevancedConfig:
self.upto_down = [ self.upto_down = [
"spotify", "spotify",
"nyx-music-player", "nyx-music-player",
"icon-pack-studio",
"twitch",
"windy",
"my-expenses", "my-expenses",
"backdrops", "backdrops",
"sleep-as-android", "sleep-as-android",
@@ -63,6 +60,9 @@ class RevancedConfig:
"ticktick": f"{self.apk_mirror}/apk/appest-inc/ticktick-to-do-list-with-reminder-day-planner/", "ticktick": f"{self.apk_mirror}/apk/appest-inc/ticktick-to-do-list-with-reminder-day-planner/",
"citra": f"{self.apk_mirror}/apk/citra-emulator/citra-emulator/", "citra": f"{self.apk_mirror}/apk/citra-emulator/citra-emulator/",
"crunchyroll": f"{self.apk_mirror}/apk/ellation-inc/crunchyroll/", "crunchyroll": f"{self.apk_mirror}/apk/ellation-inc/crunchyroll/",
"icon_pack_studio": f"{self.apk_mirror}/apk/smart-launcher-team/icon-pack-studio/",
"twitch": f"{self.apk_mirror}/apk/twitch-interactive-inc/twitch/",
"windy": f"{self.apk_mirror}/apk/windy-weather-world-inc/windy-wind-weather-forecast/",
} }
self.apk_mirror_version_urls = { self.apk_mirror_version_urls = {
"reddit": f"{self.apk_mirror_urls.get('reddit')}reddit", "reddit": f"{self.apk_mirror_urls.get('reddit')}reddit",
@@ -74,6 +74,9 @@ class RevancedConfig:
"ticktick": f"{self.apk_mirror_urls.get('ticktick')}ticktick-to-do-list-with-reminder-day-planner", "ticktick": f"{self.apk_mirror_urls.get('ticktick')}ticktick-to-do-list-with-reminder-day-planner",
"citra": f"{self.apk_mirror_urls.get('citra')}citra-emulator", "citra": f"{self.apk_mirror_urls.get('citra')}citra-emulator",
"crunchyroll": f"{self.apk_mirror_urls.get('crunchyroll')}crunchyroll", "crunchyroll": f"{self.apk_mirror_urls.get('crunchyroll')}crunchyroll",
"icon_pack_studio": f"{self.apk_mirror_urls.get('icon_pack_studio')}icon-pack-studio",
"twitch": f"{self.apk_mirror_urls.get('twitch')}twitch",
"windy": f"{self.apk_mirror_urls.get('windy')}windy-wind-weather-forecast",
} }
self.archs_to_build = env.list("ARCHS_TO_BUILD", []) self.archs_to_build = env.list("ARCHS_TO_BUILD", [])
self.alternative_youtube_patches = env.list("ALTERNATIVE_YOUTUBE_PATCHES", []) self.alternative_youtube_patches = env.list("ALTERNATIVE_YOUTUBE_PATCHES", [])
+7 -3
View File
@@ -166,9 +166,13 @@ class Downloader(object):
logger.debug("Invalid app") logger.debug("Invalid app")
sys.exit(1) sys.exit(1)
parser = LexborHTMLParser(self.config.session.get(page).text) parser = LexborHTMLParser(self.config.session.get(page).text)
main_page = parser.css_first(".appRowVariantTag>.accent_color").attributes[ try:
"href" main_page = parser.css_first(".appRowVariantTag>.accent_color").attributes[
] "href"
]
except AttributeError:
# Handles a case when variants are not available
main_page = parser.css_first(".downloadLink").attributes["href"]
match = re.search(r"\d", main_page) match = re.search(r"\d", main_page)
if not match: if not match:
logger.error("Cannot find app main page") logger.error("Cannot find app main page")
+2 -2
View File
@@ -19,7 +19,7 @@ class Patches(object):
"de.dwd.warnapp": ("warnwetter", "_warnwetter"), "de.dwd.warnapp": ("warnwetter", "_warnwetter"),
"com.spotify.music": ("spotify", "_spotify"), "com.spotify.music": ("spotify", "_spotify"),
"com.awedea.nyx": ("nyx-music-player", "_nyx"), "com.awedea.nyx": ("nyx-music-player", "_nyx"),
"ginlemon.iconpackstudio": ("icon-pack-studio", "_iconpackstudio"), "ginlemon.iconpackstudio": ("icon_pack_studio", "_iconpackstudio"),
"com.ticktick.task": ("ticktick", "_ticktick"), "com.ticktick.task": ("ticktick", "_ticktick"),
"tv.twitch.android.app": ("twitch", "_twitch"), "tv.twitch.android.app": ("twitch", "_twitch"),
"com.myprog.hexedit": ("hex-editor", "_hexeditor"), "com.myprog.hexedit": ("hex-editor", "_hexeditor"),
@@ -131,7 +131,7 @@ class Patches(object):
"youtube_music": "_ytm", "youtube_music": "_ytm",
"spotify": "_spotify", "spotify": "_spotify",
"nyx-music-player": "_nyx", "nyx-music-player": "_nyx",
"icon-pack-studio": "_iconpackstudio", "icon_pack_studio": "_iconpackstudio",
"ticktick": "_ticktick", "ticktick": "_ticktick",
"twitch": "_twitch", "twitch": "_twitch",
"hex-editor": "_hexeditor", "hex-editor": "_hexeditor",