Update getEpgs.py
This commit is contained in:
@@ -10,7 +10,12 @@ output_file = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'epg.xml'
|
||||
output_file_gz = output_file + '.gz'
|
||||
|
||||
def fetch_and_extract_xml(url):
|
||||
response = requests.get(url)
|
||||
response = requests.get(url, allow_redirects=True)
|
||||
if response.history:
|
||||
for resp in response.history:
|
||||
print(f"{resp.status_code} -> {resp.url}")
|
||||
print(f"Final URL: {response.url}")
|
||||
|
||||
if response.status_code != 200:
|
||||
print(f"Failed to fetch {url}")
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user