fix economist cover and time magazine source link

This commit is contained in:
novopu 2024-12-25 20:58:09 +08:00 committed by GitHub
parent e022decacf
commit cf849e830c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 5 deletions

View File

@ -519,8 +519,7 @@ class Economist(BasicNewsRecipe):
self.description = safe_dict(data, "props", "pageProps", "content", "headline") self.description = safe_dict(data, "props", "pageProps", "content", "headline")
self.timefmt = ' [' + safe_dict(data, "props", "pageProps", "content", "formattedIssueDate") + ']' self.timefmt = ' [' + safe_dict(data, "props", "pageProps", "content", "formattedIssueDate") + ']'
self.cover_url = safe_dict(data, "props", "pageProps", "content", "cover", "url").replace( self.cover_url = safe_dict(data, "props", "pageProps", "content", "cover", "url").replace(
'economist.com/', 'economist.com/cdn-cgi/image/width=960,quality=80,format=auto/' 'economist.com/', 'economist.com/cdn-cgi/image/width=960,quality=80,format=auto/').replace('SQ_', '')
)
self.log('Got cover:', self.cover_url) self.log('Got cover:', self.cover_url)
feeds = [] feeds = []

View File

@ -519,8 +519,7 @@ class Economist(BasicNewsRecipe):
self.description = safe_dict(data, "props", "pageProps", "content", "headline") self.description = safe_dict(data, "props", "pageProps", "content", "headline")
self.timefmt = ' [' + safe_dict(data, "props", "pageProps", "content", "formattedIssueDate") + ']' self.timefmt = ' [' + safe_dict(data, "props", "pageProps", "content", "formattedIssueDate") + ']'
self.cover_url = safe_dict(data, "props", "pageProps", "content", "cover", "url").replace( self.cover_url = safe_dict(data, "props", "pageProps", "content", "cover", "url").replace(
'economist.com/', 'economist.com/cdn-cgi/image/width=960,quality=80,format=auto/' 'economist.com/', 'economist.com/cdn-cgi/image/width=960,quality=80,format=auto/').replace('SQ_', '')
)
self.log('Got cover:', self.cover_url) self.log('Got cover:', self.cover_url)
feeds = [] feeds = []

View File

@ -38,7 +38,7 @@ class TimeMagazine(BasicNewsRecipe):
title = article.get('friendly_title') or article.get('short_title') title = article.get('friendly_title') or article.get('short_title')
if title == 'In the Latest Issue' or 'content' not in article: if title == 'In the Latest Issue' or 'content' not in article:
continue continue
url = article['shortlink'] url = article['shortlink'].replace('?p=', '')
desc = article.get('excerpt') or '' desc = article.get('excerpt') or ''
self.log(title, ' at ', url) self.log(title, ' at ', url)
self.log('\t', desc) self.log('\t', desc)