Debian Codegraph @

recipes/gameplay_pl.recipe

raw
1 from calibre.web.feeds.news import BasicNewsRecipe
2
3
4 class Gameplay_pl(BasicNewsRecipe):
5 title = 'Gameplay.pl'
6 oldest_article = 7
7 __author__ = 'fenuks'
8 description = 'gameplay.pl - serwis o naszych zainteresowaniach, grach, filmach, książkach, muzyce, fotografii i konsolach.'
9 category = 'games, movies, books, music'
10 language = 'pl'
11 index = 'https://gameplay.pl'
12 masthead_url = 'https://gameplay.pl/img/gpy_top_logo.png'
13 cover_url = 'https://gameplay.pl/img/gpy_top_logo.png'
14 max_articles_per_feed = 100
15 remove_javascript = True
16 no_stylesheets = True
17 keep_only_tags = [dict(name='div', attrs={'class': 'news-container'})]
18 remove_tags = [
19 dict(name='div', attrs={'class': ['galeria', 'noedit center im', 'news_list', 'news_list_autor', 'stop_bot', 'tagi', 'news_tagi', 'social-16']}),
20 dict(attrs={'usemap': '#map'}),
21 dict(name='a', attrs={'class': ['pin-it-button', 'twitter-share-button']}),
22 ]
23 feeds = [('Wiadomo\u015bci', 'https://gameplay.pl/rss/')]
24
25 def image_url_processor(self, baseurl, url):
26 if 'https' not in url:
27 return 'https://gameplay.pl' + url[2:]
28 else:
29 return url
30
31 def preprocess_html(self, soup):
32 for a in soup('a', href=True):
33 if '../' in a['href']:
34 a['href'] = self.index + a['href'][2:]
35 return soup