added clopudflare support on supervideo

This commit is contained in:
William Zeni 2025-05-29 23:13:04 +02:00
parent 86c7293779
commit 7d72761bc5
2 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import logging
import httpx
import jsbeautifier
from bs4 import BeautifulSoup
import cloudscraper
# Internal utilities
@ -42,7 +43,8 @@ class VideoSource:
- str: The response content if successful, None otherwise.
"""
try:
response = self.client.get(url, headers=self.headers, timeout=MAX_TIMEOUT, follow_redirects=True)
cloudflare = cloudscraper.create_scraper()
response = cloudflare.get(url=url)
response.raise_for_status()
return response.text

View File

@ -13,3 +13,4 @@ pycryptodomex
ua-generator
qbittorrent-api
pyTelegramBotAPI
cloudscraper