Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update The Week India #2301

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions recipes/the_week.recipe
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import datetime

from calibre.web.feeds.news import BasicNewsRecipe
from calibre.web.feeds.news import BasicNewsRecipe, classes


class TheWeek(BasicNewsRecipe):
Expand All @@ -17,17 +17,18 @@ class TheWeek(BasicNewsRecipe):
remove_attributes = ['style', 'height', 'width']
masthead_url = 'https://www.theweek.in/content/dam/week/logo/The-Week-Logo-Big.png'

keep_only_tags = [
dict(
name='div',
attrs={
'class': [
'article-title', 'article-image', 'articlecontentbody section',
'element11-page-content'
]
}
),
]
keep_only_tags = [classes('article-post section-heading element11-page-content')]

remove_tags = [classes('article-highlights sharebar')]

remove_tags_after = [classes('articlecontentbody')]

extra_css = '''
img {display:block; margin:0 auto;}
em, blockquote { color: #202020; }
.article-image, .article-imgbox { text-align:center; font-size:small; }
.article-info { font-size:small; }
'''

def get_cover_url(self):
soup = self.index_to_soup(
Expand Down
Loading