🎨 Updated variable name

This commit is contained in:
Nikhil Badyal
2023-08-22 21:06:53 +05:30
parent a92de3e6da
commit 07b01bb3a1
8 changed files with 17 additions and 22 deletions
+2 -3
View File
@@ -5,11 +5,10 @@ import requests
from bs4 import BeautifulSoup, Tag
from loguru import logger
from scripts.status_check import headers
from src.downloader.download import Downloader
from src.downloader.sources import APK_MIRROR_BASE_URL, apk_sources
from src.exceptions import APKMirrorAPKDownloadFailure
from src.utils import bs4_parser, contains_any_word
from src.utils import bs4_parser, contains_any_word, request_header
class ApkMirror(Downloader):
@@ -84,7 +83,7 @@ class ApkMirror(Downloader):
@staticmethod
def _extracted_search_div(url: str, search_class: str) -> Tag:
"""Extract search div."""
r = requests.get(url, headers=headers, timeout=60)
r = requests.get(url, headers=request_header, timeout=60)
if r.status_code != 200:
raise APKMirrorAPKDownloadFailure(
f"Unable to connect with {url} on ApkMirror. Are you blocked by APKMirror or abused apkmirror "
+2 -3
View File
@@ -4,11 +4,10 @@ from typing import Any
import requests
from bs4 import BeautifulSoup
from scripts.status_check import headers
from src.downloader.download import Downloader
from src.downloader.sources import apk_sources
from src.exceptions import APKSosAPKDownloadFailure
from src.utils import bs4_parser
from src.utils import bs4_parser, request_header
class ApkSos(Downloader):
@@ -20,7 +19,7 @@ class ApkSos(Downloader):
:param page: Url of the page
:param app: Name of the app
"""
r = requests.get(page, headers=headers, allow_redirects=True)
r = requests.get(page, headers=request_header, allow_redirects=True)
soup = BeautifulSoup(r.text, bs4_parser)
download_button = soup.find(class_="col-sm-12 col-md-8 text-center")
possible_links = download_button.find_all("a")
+2 -3
View File
@@ -5,18 +5,17 @@ import requests
from bs4 import BeautifulSoup
from loguru import logger
from scripts.status_check import headers
from src.downloader.download import Downloader
from src.downloader.sources import apk_sources
from src.exceptions import UptoDownAPKDownloadFailure
from src.utils import bs4_parser
from src.utils import bs4_parser, request_header
class UptoDown(Downloader):
"""Files downloader."""
def extract_download_link(self, page: str, app: str) -> str:
r = requests.get(page, headers=headers, allow_redirects=True, timeout=60)
r = requests.get(page, headers=request_header, allow_redirects=True, timeout=60)
soup = BeautifulSoup(r.text, bs4_parser)
soup = soup.find(id="detail-download-button")
download_url = soup.get("data-url")