Download app from apkmirror instead of uptodown

This commit is contained in:
Nikhil Badyal
2022-12-21 15:22:15 +05:30
parent f44b802de1
commit 4e476ee2b5
4 changed files with 18 additions and 11 deletions
+7 -3
View File
@@ -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")