From cf849e830c14ec8a047f217dcda1f4d0d8c05eb4 Mon Sep 17 00:00:00 2001 From: novopu <166818876+novopu@users.noreply.github.com> Date: Wed, 25 Dec 2024 20:58:09 +0800 Subject: [PATCH] fix economist cover and time magazine source link --- recipes/economist.recipe | 3 +-- recipes/economist_free.recipe | 3 +-- recipes/time_magazine.recipe | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/recipes/economist.recipe b/recipes/economist.recipe index 6cc43d5c11..6326830086 100644 --- a/recipes/economist.recipe +++ b/recipes/economist.recipe @@ -519,8 +519,7 @@ class Economist(BasicNewsRecipe): self.description = safe_dict(data, "props", "pageProps", "content", "headline") self.timefmt = ' [' + safe_dict(data, "props", "pageProps", "content", "formattedIssueDate") + ']' 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) feeds = [] diff --git a/recipes/economist_free.recipe b/recipes/economist_free.recipe index 6cc43d5c11..6326830086 100644 --- a/recipes/economist_free.recipe +++ b/recipes/economist_free.recipe @@ -519,8 +519,7 @@ class Economist(BasicNewsRecipe): self.description = safe_dict(data, "props", "pageProps", "content", "headline") self.timefmt = ' [' + safe_dict(data, "props", "pageProps", "content", "formattedIssueDate") + ']' 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) feeds = [] diff --git a/recipes/time_magazine.recipe b/recipes/time_magazine.recipe index 679fd81190..29c449c83d 100644 --- a/recipes/time_magazine.recipe +++ b/recipes/time_magazine.recipe @@ -38,7 +38,7 @@ class TimeMagazine(BasicNewsRecipe): title = article.get('friendly_title') or article.get('short_title') if title == 'In the Latest Issue' or 'content' not in article: continue - url = article['shortlink'] + url = article['shortlink'].replace('?p=', '') desc = article.get('excerpt') or '' self.log(title, ' at ', url) self.log('\t', desc)