🎨 Use request instead of session (#363)

This commit is contained in:
Nikhil Badyal
2023-09-02 17:12:11 +05:30
committed by GitHub
parent 5c62a1b677
commit 720bfe9a3c
4 changed files with 8 additions and 9 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ from src.app import APP
from src.config import RevancedConfig
from src.downloader.utils import implement_method
from src.exceptions import DownloadError
from src.utils import handle_request_response
from src.utils import handle_request_response, session
class Downloader(object):
@@ -39,7 +39,7 @@ class Downloader(object):
if self.config.personal_access_token and "github" in url:
logger.debug("Using personal access token")
headers["Authorization"] = f"token {self.config.personal_access_token}"
response = self.config.session.get(
response = session.get(
url,
stream=True,
headers=headers,
+2 -2
View File
@@ -8,7 +8,7 @@ from loguru import logger
from src.app import APP
from src.downloader.download import Downloader
from src.exceptions import UptoDownAPKDownloadError
from src.utils import bs4_parser, handle_request_response, request_header, request_timeout
from src.utils import bs4_parser, handle_request_response, request_header, request_timeout, session
class UptoDown(Downloader):
@@ -43,7 +43,7 @@ class UptoDown(Downloader):
"""
logger.debug("downloading specified version of app from uptodown.")
url = f"{app.download_source}/versions"
html = self.config.session.get(url).text
html = session.get(url).text
soup = BeautifulSoup(html, bs4_parser)
versions_list = soup.find("section", {"id": "versions"})
download_url = None