WSJ Redirect Fix

This commit is contained in:
SheinH 2024-01-17 17:03:15 -05:00
parent 6ff92e685f
commit 3976982d08

View File

@ -92,6 +92,8 @@ class WSJ(BasicNewsRecipe):
try: try:
br.open(url) br.open(url)
except Exception as e: except Exception as e:
hdrs_location = e.hdrs.get('location')
if hdrs_location:
url = e.hdrs.get('location') url = e.hdrs.get('location')
raw = read_url(self.storage, 'https://archive.is/latest/' + url) raw = read_url(self.storage, 'https://archive.is/latest/' + url)
pt = PersistentTemporaryFile('.html') pt = PersistentTemporaryFile('.html')