mirror of
https://github.com/sotam0316/docker-py-revanced.git
synced 2026-04-25 03:48:37 +09:00
🎨 Use request instead of session (#363)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user