From 7132743a5e5ff0eab4a7596ee7500feefadedb0e Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:08:10 +0530 Subject: [PATCH 1/5] Update economist.recipe --- recipes/economist.recipe | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/economist.recipe b/recipes/economist.recipe index 5f0c7ff957..8574988d96 100644 --- a/recipes/economist.recipe +++ b/recipes/economist.recipe @@ -4,6 +4,7 @@ import json import re import time +from uuid import uuid4 from collections import defaultdict from datetime import datetime, timedelta from urllib.parse import quote, urlencode @@ -254,10 +255,9 @@ class Economist(BasicNewsRecipe): ) br = BasicNewsRecipe.get_browser(self, *args, **kwargs) else: - # Needed to bypass cloudflare - kwargs['user_agent'] = 'common_words/based' + kwargs['user_agent'] = 'TheEconomist-Lamarr-android' br = BasicNewsRecipe.get_browser(self, *args, **kwargs) - br.addheaders += [('Accept-Language', 'en-GB,en-US;q=0.9,en;q=0.8')] + br.addheaders += [('x-request-id', str(uuid4()))] return br def publication_date(self): From 17d9a31d664bdb0e3219e3c8b22968344e77c989 Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:08:46 +0530 Subject: [PATCH 2/5] Update economist_free.recipe --- recipes/economist_free.recipe | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/economist_free.recipe b/recipes/economist_free.recipe index 5f0c7ff957..8574988d96 100644 --- a/recipes/economist_free.recipe +++ b/recipes/economist_free.recipe @@ -4,6 +4,7 @@ import json import re import time +from uuid import uuid4 from collections import defaultdict from datetime import datetime, timedelta from urllib.parse import quote, urlencode @@ -254,10 +255,9 @@ class Economist(BasicNewsRecipe): ) br = BasicNewsRecipe.get_browser(self, *args, **kwargs) else: - # Needed to bypass cloudflare - kwargs['user_agent'] = 'common_words/based' + kwargs['user_agent'] = 'TheEconomist-Lamarr-android' br = BasicNewsRecipe.get_browser(self, *args, **kwargs) - br.addheaders += [('Accept-Language', 'en-GB,en-US;q=0.9,en;q=0.8')] + br.addheaders += [('x-request-id', str(uuid4()))] return br def publication_date(self): From 98fb801e8a949e0040c03aad3488401b341c7747 Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:10:20 +0530 Subject: [PATCH 3/5] Update economist_news.recipe --- recipes/economist_news.recipe | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/economist_news.recipe b/recipes/economist_news.recipe index dd163dba4f..4fe15ac7f9 100644 --- a/recipes/economist_news.recipe +++ b/recipes/economist_news.recipe @@ -3,6 +3,7 @@ import json import time +from uuid import uuid4 from datetime import datetime, timedelta from urllib.parse import quote, urlencode @@ -191,10 +192,9 @@ class EconomistNews(BasicNewsRecipe): self.oldest_article = float(d) def get_browser(self, *args, **kwargs): - # Needed to bypass cloudflare - kwargs['user_agent'] = 'common_words/based' + kwargs['user_agent'] = 'TheEconomist-Lamarr-android' br = BasicNewsRecipe.get_browser(self, *args, **kwargs) - br.addheaders += [('Accept-Language', 'en-GB,en-US;q=0.9,en;q=0.8')] + br.addheaders += [('x-request-id', str(uuid4()))] return br def economist_return_index(self, ans): From c813032e05aa3e4e67584b995e5ce39124943801 Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:26:34 +0530 Subject: [PATCH 4/5] ... --- recipes/economist.recipe | 4 +++- recipes/economist_free.recipe | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/recipes/economist.recipe b/recipes/economist.recipe index 8574988d96..8541c489b3 100644 --- a/recipes/economist.recipe +++ b/recipes/economist.recipe @@ -525,7 +525,9 @@ class Economist(BasicNewsRecipe): feeds = [] - for part in safe_dict(data, "props", "pageProps", "content", "sections"): + for part in safe_dict( + data, "props", "pageProps", "content", "headerSections" + ) + safe_dict(data, "props", "pageProps", "content", "sections"): section = safe_dict(part, "name") or '' if not section: continue diff --git a/recipes/economist_free.recipe b/recipes/economist_free.recipe index 8574988d96..8541c489b3 100644 --- a/recipes/economist_free.recipe +++ b/recipes/economist_free.recipe @@ -525,7 +525,9 @@ class Economist(BasicNewsRecipe): feeds = [] - for part in safe_dict(data, "props", "pageProps", "content", "sections"): + for part in safe_dict( + data, "props", "pageProps", "content", "headerSections" + ) + safe_dict(data, "props", "pageProps", "content", "sections"): section = safe_dict(part, "name") or '' if not section: continue From b286096f7266c3b7359702972cff81de3043365f Mon Sep 17 00:00:00 2001 From: unkn0w7n <51942695+unkn0w7n@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:27:11 +0530 Subject: [PATCH 5/5] ... --- recipes/korben.recipe | 3 ++- recipes/ugeskriftet.recipe | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/korben.recipe b/recipes/korben.recipe index 6afe94a8db..30a8b12cca 100644 --- a/recipes/korben.recipe +++ b/recipes/korben.recipe @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +#!/usr/bin/env python from calibre.web.feeds.news import BasicNewsRecipe @@ -7,6 +7,7 @@ class BasicUserRecipe1318619728(BasicNewsRecipe): oldest_article = 7 max_articles_per_feed = 100 auto_cleanup = True + language = 'fr' feeds = [(u'Korben', u'http://feeds2.feedburner.com/KorbensBlog-UpgradeYourMind')] diff --git a/recipes/ugeskriftet.recipe b/recipes/ugeskriftet.recipe index 20c0ddf269..e539c959f7 100644 --- a/recipes/ugeskriftet.recipe +++ b/recipes/ugeskriftet.recipe @@ -7,7 +7,7 @@ from calibre.web.feeds.news import BasicNewsRecipe class Ugeskriftet(BasicNewsRecipe): title = 'Ugeskriftet' description = 'Ugeskriftet for læger' - language = 'dan' + language = 'da' __author__ = 'https://github.com/morusn' oldest_article = 7 publication_type = 'magazine'