From 67c8238cc94437d9675349eaf78338df5a947fce Mon Sep 17 00:00:00 2001 From: ping Date: Sun, 23 Jul 2023 16:31:32 +0800 Subject: [PATCH] Make NYT* recipes DRYer [skip ci] --- recipes/includes/nyt.py | 5 +++++ recipes/nytimes-books.recipe.py | 4 ---- recipes/nytimes-global.recipe.py | 4 ---- recipes/nytimes-magazine.recipe.py | 4 ---- recipes/nytimes-paper.recipe.py | 2 -- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/recipes/includes/nyt.py b/recipes/includes/nyt.py index 2a1667c0..2725cf68 100644 --- a/recipes/includes/nyt.py +++ b/recipes/includes/nyt.py @@ -11,6 +11,11 @@ class NYTRecipe(BasicNewsrackRecipe): + use_embedded_content = False + auto_cleanup = False + compress_news_images_auto_size = 10 + ignore_duplicate_articles = {"title", "url"} + delay = 0 simultaneous_downloads = 1 delay_range = list(range(2, 5)) diff --git a/recipes/nytimes-books.recipe.py b/recipes/nytimes-books.recipe.py index 535e440f..027a6322 100644 --- a/recipes/nytimes-books.recipe.py +++ b/recipes/nytimes-books.recipe.py @@ -27,10 +27,6 @@ class NYTimesBooks(NYTRecipe, BasicNewsrackRecipe, BasicNewsRecipe): publication_type = "newspaper" oldest_article = 7 # days max_articles_per_feed = 25 - use_embedded_content = False - - auto_cleanup = False - scale_news_images = (600, 600) remove_attributes = ["style", "font"] remove_tags_before = [dict(id="story")] diff --git a/recipes/nytimes-global.recipe.py b/recipes/nytimes-global.recipe.py index 21771894..562b8dcb 100644 --- a/recipes/nytimes-global.recipe.py +++ b/recipes/nytimes-global.recipe.py @@ -29,10 +29,6 @@ class NYTimesGlobal(NYTRecipe, BasicNewsrackRecipe, BasicNewsRecipe): oldest_article = 1 # days max_articles_per_feed = 20 - use_embedded_content = False - - auto_cleanup = False - ignore_duplicate_articles = {"title", "url"} remove_attributes = ["style", "font"] remove_tags_before = [dict(id="story")] diff --git a/recipes/nytimes-magazine.recipe.py b/recipes/nytimes-magazine.recipe.py index cb0d6c6e..1862dbce 100644 --- a/recipes/nytimes-magazine.recipe.py +++ b/recipes/nytimes-magazine.recipe.py @@ -31,10 +31,6 @@ class NYTimesBooks(NYTRecipe, BasicNewsrackRecipe, BasicNewsRecipe): publication_type = "magazine" oldest_article = 7 # days max_articles_per_feed = 25 - use_embedded_content = False - - auto_cleanup = False - scale_news_images = (600, 600) remove_attributes = ["style", "font"] remove_tags_before = [dict(id="story")] diff --git a/recipes/nytimes-paper.recipe.py b/recipes/nytimes-paper.recipe.py index 2ab2abec..b06aac8f 100644 --- a/recipes/nytimes-paper.recipe.py +++ b/recipes/nytimes-paper.recipe.py @@ -31,8 +31,6 @@ class NewYorkTimesPrint(NYTRecipe, BasicNewsrackRecipe, BasicNewsRecipe): language = "en" publication_type = "newspaper" masthead_url = "https://mwcm.nyt.com/.resources/mkt-wcm/dist/libs/assets/img/logo-nyt-header.svg" - ignore_duplicate_articles = {"title", "url"} - compress_news_images_auto_size = 10 INDEX = "https://www.nytimes.com/section/todayspaper"