Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Remove OS check
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-WinnfieldX committed Jan 31, 2024
1 parent 3aa4e15 commit 6ac1242
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 93 deletions.
2 changes: 1 addition & 1 deletion cyberdrop_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.1.59"
__version__ = "5.1.61"
12 changes: 1 addition & 11 deletions cyberdrop_dl/managers/client_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@
import ssl
from http import HTTPStatus
from typing import TYPE_CHECKING
import os

import aiohttp
import certifi
from aiohttp import ClientResponse
from aiolimiter import AsyncLimiter
from yarl import URL

from cyberdrop_dl.clients.download_client import DownloadClient
from cyberdrop_dl.clients.errors import DownloadFailure
from cyberdrop_dl.clients.scraper_client import ScraperClient
from cyberdrop_dl.utils.utilities import CustomHTTPStatus, log
from cyberdrop_dl.utils.utilities import CustomHTTPStatus

if TYPE_CHECKING:
from cyberdrop_dl.managers.manager import Manager
Expand Down Expand Up @@ -78,10 +76,6 @@ async def check_http_status(self, response: ClientResponse, download: bool = Fal
headers = response.headers
response_url = response.url

if os.getenv("CYDL_ENABLE_SENSITIVE_HTTP_LOGS") == "2":
# Log all responses
await log(f"Response: {response}\nRequest: {response.request_info}", 10)

if not headers.get('Content-Type'):
raise DownloadFailure(status=CustomHTTPStatus.IM_A_TEAPOT, message="No content-type in response header")

Expand All @@ -94,10 +88,6 @@ async def check_http_status(self, response: ClientResponse, download: bool = Fal
if HTTPStatus.OK <= status < HTTPStatus.BAD_REQUEST:
return

if os.getenv("CYDL_ENABLE_SENSITIVE_HTTP_LOGS") == "1":
# Only log responses to unsuccessful requests
await log(f"Response: {response}\nRequest: {response.request_info}", 10)

try:
phrase = HTTPStatus(status).phrase
except ValueError:
Expand Down
Loading

0 comments on commit 6ac1242

Please sign in to comment.