Update iptv.py

This commit is contained in:
alantang 2025-03-24 23:28:12 +08:00 committed by GitHub
parent 8ea2609170
commit b14b47e908
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,7 +20,7 @@ ipv6_pattern = re.compile(r'^http://\[([a-fA-F0-9:]+)\]')
def fetch_streams_from_url(url): def fetch_streams_from_url(url):
print(f"正在爬取网站源: {url}") print(f"正在爬取网站源: {url}")
try: try:
response = requests.get(url, timeout=10) response = requests.get(url, timeout=20)
response.encoding = 'utf-8' response.encoding = 'utf-8'
if response.status_code == 200: if response.status_code == 200:
return response.text return response.text