Update mediapolisvod.py

This commit is contained in:
ciccioxm3 2025-06-26 11:37:33 +02:00 committed by GitHub
parent fb87131777
commit 3743f784d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,7 +12,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:
@ -29,7 +29,7 @@ class VideoSource:
return "Error: Unable to determine video JSON URL" return "Error: Unable to determine video JSON URL"
try: try:
response = httpx.get(video_url, headers=get_headers(), timeout=MAX_TIMEOUT) response = httpx.get(video_url, headers=get_headers(), timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
if response.status_code != 200: if response.status_code != 200:
return f"Error: Failed to fetch video data (Status: {response.status_code})" return f"Error: Failed to fetch video data (Status: {response.status_code})"
@ -50,7 +50,7 @@ class VideoSource:
'cont': element_key, 'cont': element_key,
'output': '62', 'output': '62',
} }
stream_response = httpx.get('https://mediapolisvod.rai.it/relinker/relinkerServlet.htm', params=params, headers=get_headers(), timeout=MAX_TIMEOUT) stream_response = httpx.get('https://mediapolisvod.rai.it/relinker/relinkerServlet.htm', params=params, headers=get_headers(), timeout=MAX_TIMEOUT, verify=REQUEST_VERIFY)
if stream_response.status_code != 200: if stream_response.status_code != 200:
return f"Error: Failed to fetch stream URL (Status: {stream_response.status_code})" return f"Error: Failed to fetch stream URL (Status: {stream_response.status_code})"
@ -61,4 +61,4 @@ class VideoSource:
return m3u8_url return m3u8_url
except Exception as e: except Exception as e:
return f"Error: {str(e)}" return f"Error: {str(e)}"