Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/unkn0w7n/calibre
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Aug 6, 2023
2 parents ffd1af3 + 57bd5e6 commit c083393
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion recipes/bloomberg.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@ class Bloomberg(BasicNewsRecipe):
extra_css = '''
.auth {font-size:small; font-weight:bold;}
.time, .chart {font-size:small;}
.subhead {font-style:italic; color:#404040;}
.subhead, blockquote {font-style:italic; color:#404040;}
.cat {font-size:small; color:gray;}
.news-figure-caption-text, .cap, .img {font-size:small; text-align:center;}
.news-figure-credit {font-size:small; text-align:center; color:#202020;}
'''

articles_are_obfuscated = True
resolve_internal_links = True

def get_obfuscated_article(self, url):
br = self.get_browser()
Expand Down
12 changes: 5 additions & 7 deletions recipes/business_today.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ class BT(BasicNewsRecipe):
masthead_url = 'https://akm-img-a-in.tosshub.com/businesstoday/resource/img/logo.png'

keep_only_tags = [
dict(name='h1'),
dict(name='h2'),
classes('brand-detial-main main-img story-with-main-sec'),
classes('story-heading sab-head-tranlate-sec user-detial-left main-img field--name-body'),
]
remove_tags = [
dict(name='a', attrs={'title': 'videos'}),
Expand All @@ -28,11 +26,11 @@ class BT(BasicNewsRecipe):

def parse_index(self):
soup = self.index_to_soup('https://www.businesstoday.in/magazine')
issue = soup.find(attrs={'class': 'view-id-latest_issue_magzine'})
a = issue.findAll('a', href=lambda x: x and x.startswith('/magazine/issue/'))[1]
issue = soup.find(attrs={'class': 'swiper-wrapper'})
a = issue.findAll('a', href=lambda x: x and '/magazine/issue/' in x)[1]
url = a['href']
self.log('issue =', url)
soup = self.index_to_soup('https://www.businesstoday.in' + url)
soup = self.index_to_soup(url)
tag = soup.find(attrs={'class': 'issue-image'})
if tag:
self.cover_url = tag.find('img')['src']
Expand Down Expand Up @@ -62,7 +60,7 @@ class BT(BasicNewsRecipe):

# Insert feeds in specified order, if available

feedSort = ['Editors Note']
feedSort = ['Editor\'s Note']
for i in feedSort:
if i in sections:
feeds.append((i, sections[i]))
Expand Down
2 changes: 1 addition & 1 deletion recipes/india_today.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class IndiaToday(BasicNewsRecipe):
'''

remove_tags = [
classes('checkout__section sharing align-center-button amp-izooto-sub ads__container inline-story-add amp-ad'),
classes('checkout__section sharing align-center-button amp-izooto-sub ads__container inline-story-add amp-ad readmore__box'),
dict(name=(('amp-web-push-widget', 'amp-ad'))),
dict(attrs={'id':'tab-link-wrapper-plugin'}),
dict(name='div', attrs={'amp-access':'NOT granted'})
Expand Down

0 comments on commit c083393

Please sign in to comment.