From 4e476ee2b50ff8537e62dd6e42151951ae15cd95 Mon Sep 17 00:00:00 2001 From: Nikhil Badyal Date: Wed, 21 Dec 2022 15:22:15 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Download=20app=20from=20apkmirror?= =?UTF-8?q?=20instead=20of=20uptodown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++--- src/config.py | 9 ++++++--- src/downloader.py | 10 +++++++--- src/patches.py | 4 ++-- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index efe50b7..0d66d12 100644 --- a/README.md +++ b/README.md @@ -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/) 7. [spotify](https://spotify.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/) - 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) 13. [citra](https://www.apkmirror.com/apk/citra-emulator/citra-emulator/) 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) 17. [backdrops](https://backdrops.en.uptodown.com/android) 18. [sleep-as-android](https://sleep-as-android.en.uptodown.com/android) diff --git a/src/config.py b/src/config.py index ab80c33..b7566ac 100644 --- a/src/config.py +++ b/src/config.py @@ -22,9 +22,6 @@ class RevancedConfig: self.upto_down = [ "spotify", "nyx-music-player", - "icon-pack-studio", - "twitch", - "windy", "my-expenses", "backdrops", "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/", "citra": f"{self.apk_mirror}/apk/citra-emulator/citra-emulator/", "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 = { "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", "citra": f"{self.apk_mirror_urls.get('citra')}citra-emulator", "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.alternative_youtube_patches = env.list("ALTERNATIVE_YOUTUBE_PATCHES", []) diff --git a/src/downloader.py b/src/downloader.py index 3c3a1b8..24f7333 100644 --- a/src/downloader.py +++ b/src/downloader.py @@ -161,9 +161,13 @@ class Downloader(object): logger.debug("Invalid app") sys.exit(1) parser = LexborHTMLParser(self.config.session.get(page).text) - main_page = parser.css_first(".appRowVariantTag>.accent_color").attributes[ - "href" - ] + try: + 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) if not match: logger.error("Cannot find app main page") diff --git a/src/patches.py b/src/patches.py index a7d97be..70150af 100644 --- a/src/patches.py +++ b/src/patches.py @@ -19,7 +19,7 @@ class Patches(object): "de.dwd.warnapp": ("warnwetter", "_warnwetter"), "com.spotify.music": ("spotify", "_spotify"), "com.awedea.nyx": ("nyx-music-player", "_nyx"), - "ginlemon.iconpackstudio": ("icon-pack-studio", "_iconpackstudio"), + "ginlemon.iconpackstudio": ("icon_pack_studio", "_iconpackstudio"), "com.ticktick.task": ("ticktick", "_ticktick"), "tv.twitch.android.app": ("twitch", "_twitch"), "com.myprog.hexedit": ("hex-editor", "_hexeditor"), @@ -131,7 +131,7 @@ class Patches(object): "youtube_music": "_ytm", "spotify": "_spotify", "nyx-music-player": "_nyx", - "icon-pack-studio": "_iconpackstudio", + "icon_pack_studio": "_iconpackstudio", "ticktick": "_ticktick", "twitch": "_twitch", "hex-editor": "_hexeditor",