Update The Week

fix cover
This commit is contained in:
unkn0w7n 2024-04-12 22:24:49 +05:30
parent c45b1f8bbc
commit 63060ff166
2 changed files with 6 additions and 4 deletions

View File

@ -41,8 +41,9 @@ class TheWeek(BasicNewsRecipe):
url = 'https://usmagazine.theweek.com/timelines.json'
data = json.loads(self.index_to_soup(url, raw=True))
for x in data['timelines'][:5]:
if '-cover-' in x['image']:
return 'https://usmagazine.theweek.com' + x['image'][1:]
if 'image' in x:
if '-cover-' in x['image']:
return 'https://usmagazine.theweek.com' + x['image'][1:]
articles_are_obfuscated = True

View File

@ -41,8 +41,9 @@ class TheWeek(BasicNewsRecipe):
url = 'https://ukmagazine.theweek.com/timelines.json'
data = json.loads(self.index_to_soup(url, raw=True))
for x in data['timelines'][:5]:
if '-cover-' in x['image']:
return 'https://ukmagazine.theweek.com' + x['image'][1:]
if 'image' in x:
if '-cover-' in x['image']:
return 'https://ukmagazine.theweek.com' + x['image'][1:]
articles_are_obfuscated = True