This commit is contained in:
Kovid Goyal 2020-02-25 19:20:48 +05:30
parent 2aa41c859b
commit 148df09652
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -3,9 +3,9 @@ __copyright__ = '2011, Pat Stapleton <pat.stapleton at gmail.com>'
''' '''
https://www.spectator.com.au/ https://www.spectator.com.au/
''' '''
import re
from calibre.web.feeds.recipes import BasicNewsRecipe from calibre.web.feeds.recipes import BasicNewsRecipe
class SpectatorAU(BasicNewsRecipe): class SpectatorAU(BasicNewsRecipe):
title = 'Spectator Australia' title = 'Spectator Australia'
__author__ = 'Pat Stapleton, Dean Cording, James Cridland' __author__ = 'Pat Stapleton, Dean Cording, James Cridland'
@ -24,11 +24,26 @@ class SpectatorAU(BasicNewsRecipe):
publication_type = 'newspaper' publication_type = 'newspaper'
extra_css = '.article-header__author{margin-bottom:20px;}' extra_css = '.article-header__author{margin-bottom:20px;}'
conversion_options = { conversion_options = {
'comments': description, 'tags': category, 'language': language, 'publisher': publisher, 'linearize_tables': False 'comments': description,
'tags': category,
'language': language,
'publisher': publisher,
'linearize_tables': False
} }
keep_only_tags = [dict(attrs={'class': ['article']})] keep_only_tags = [dict(attrs={'class': ['article']})]
remove_tags = [dict(attrs={'class': ['big-author','article-header__category','margin-menu','related-stories','disqus_thread','middle-promo','show-comments','article-tags']}), dict(name=['h4','hr'])] remove_tags = [
dict(
attrs={
'class': [
'big-author', 'article-header__category', 'margin-menu',
'related-stories', 'disqus_thread', 'middle-promo',
'show-comments', 'article-tags'
]
}
),
dict(name=['h4', 'hr'])
]
remove_attributes = ['width', 'height'] remove_attributes = ['width', 'height']
feeds = [ feeds = [