Update supervideo.py

This commit is contained in:
ciccioxm3 2025-06-26 11:39:10 +02:00 committed by GitHub
parent adf4fb089b
commit 1b81dca232
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,6 +17,7 @@ from StreamingCommunity.Util.headers import get_headers
# Variable # Variable
MAX_TIMEOUT = config_manager.get_int("REQUESTS", "timeout") MAX_TIMEOUT = config_manager.get_int("REQUESTS", "timeout")
REQUEST_VERIFY = config_manager.get_bool('REQUESTS', 'verify')
class VideoSource: class VideoSource:
@ -41,7 +42,7 @@ class VideoSource:
- str: The response content if successful, None otherwise. - str: The response content if successful, None otherwise.
""" """
try: try:
response = requests.get(url, headers=self.headers, timeout=MAX_TIMEOUT, impersonate="chrome110") response = requests.get(url, headers=self.headers, timeout=MAX_TIMEOUT, impersonate="chrome110", verify=REQUEST_VERIFY)
if response.status_code >= 400: if response.status_code >= 400:
logging.error(f"Request failed with status code: {response.status_code}") logging.error(f"Request failed with status code: {response.status_code}")
return None return None
@ -161,4 +162,4 @@ class VideoSource:
except Exception as e: except Exception as e:
logging.error(f"An error occurred: {e}") logging.error(f"An error occurred: {e}")
return None return None