Update press_information_bureau.recipe

This commit is contained in:
unkn0w7n 2025-08-02 19:09:28 +05:30
parent da640add79
commit 9305014fd2

View File

@ -1,30 +1,31 @@
#!/usr/bin/env python
from calibre.web.feeds.news import BasicNewsRecipe, classes
class PIB(BasicNewsRecipe):
title = u'Press Information Bureau'
title = 'Press Information Bureau'
language = 'en_IN'
__author__ = 'unkn0wn'
no_stylesheets = True
use_embedded_content = False
remove_attributes = ['style','height','width']
remove_attributes = ['style', 'height', 'width']
ignore_duplicate_articles = {'url'}
description = ('The Press Information Bureau (PIB) is the nodal agency of the Government of India'
' to disseminate information to the print and electronic media on government policies,'
' programmes, initiatives and achievements. Best downloaded at the end of the day!')
description = (
'The Press Information Bureau (PIB) is the nodal agency of the Government of India'
' to disseminate information to the print and electronic media on government policies,'
' programmes, initiatives and achievements. Best downloaded at the end of the day!'
)
extra_css = '''
#ltrSubtitle{color:#404040;}
blockquote{color:#404040;}
.ReleaseDateSubHeaddateTime{font-style:italic; font-size:small;}
'''
masthead_url = 'https://tse3.mm.bing.net/th?id=OIP.4QE8KPl1dZ3_BoR3X92aqgHaIH'
keep_only_tags = [
classes('innner-page-main-about-us-content-right-part')
]
remove_tags = [
classes('ReleaseLang log_oo')
]
masthead_url = 'https://tse3.mm.bing.net/th?id=OIP.4QE8KPl1dZ3_BoR3X92aqgHaIH'
cover_url = 'https://static.pib.gov.in/WriteReadData/specificdocs/photo/2024/jun/ph2024624343601.jpg'
keep_only_tags = [classes('innner-page-main-about-us-content-right-part')]
remove_tags = [classes('ReleaseLang log_oo')]
def parse_index(self):
soup = self.index_to_soup('https://pib.gov.in/Allrel.aspx')
@ -37,7 +38,7 @@ class PIB(BasicNewsRecipe):
for a in div.findAll('a', href=True):
url = a['href']
if url.startswith('/'):
url = 'https://pib.gov.in' + url
url = 'https://pib.gov.in' + url
title = self.tag_to_string(a)
self.log('\t', title, '\n\t\t', url)
articles.append({'title': title, 'url': url})