| 1 |
#!/usr/bin/env python |
| 2 |
# vim:fileencoding=utf-8 |
| 3 |
|
| 4 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 5 |
|
| 6 |
|
| 7 |
class NewTab(BasicNewsRecipe): |
| 8 |
title = '\u041d\u043e\u0432\u0430\u044f \u0432\u043a\u043b\u0430\u0434\u043a\u0430' |
| 9 |
__author__ = 'bugmen00t' |
| 10 |
description = '\u041f\u043b\u043e\u0449\u0430\u0434\u043a\u0430 \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0435\u043f\u043e\u0440\u0442\u0430\u0436\u0435\u0439 \u0438 \u0437\u0430\u043c\u0435\u0442\u043e\u043a \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0433\u0438\u043e\u043d\u044b \u0420\u043e\u0441\u0441\u0438\u0438 \u043f\u043e\u0441\u043b\u0435 24 \u0444\u0435\u0432\u0440\u0430\u043b\u044f 2022 \u0433\u043e\u0434\u0430.' # noqa: E501 |
| 11 |
publisher = '\u041c\u0438\u0445\u0430\u0438\u043b \u0414\u0430\u043d\u0438\u043b\u043e\u0432\u0438\u0447' |
| 12 |
category = 'blog' |
| 13 |
cover_url = 'https://static.tildacdn.com/tild3765-3961-4337-b366-323437626331/thenewtab-sn.jpg' |
| 14 |
language = 'ru' |
| 15 |
no_stylesheets = True |
| 16 |
remove_javascript = False |
| 17 |
auto_cleanup = False |
| 18 |
oldest_article = 30 |
| 19 |
max_articles_per_feed = 10 |
| 20 |
|
| 21 |
remove_tags_before = dict(name='h1') |
| 22 |
|
| 23 |
remove_tags = [ |
| 24 |
dict(name='div', attrs={'class': 't-popup'}), |
| 25 |
dict(name='div', attrs={'class': 't185'}), |
| 26 |
dict(name='div', attrs={'class': 't403'}), |
| 27 |
dict(name='div', attrs={'class': 't404'}), |
| 28 |
dict(name='div', attrs={'class': 't134'}), |
| 29 |
dict(name='div', attrs={'class': 'sp-form-fields-wrapper'}), |
| 30 |
] |
| 31 |
|
| 32 |
feeds = [('\u041d\u043e\u0432\u0430\u044f \u0432\u043a\u043b\u0430\u0434\u043a\u0430', 'https://thenewtab.io/feed/')] |
| 33 |
|
| 34 |
def preprocess_html(self, soup): |
| 35 |
for img in soup.findAll('img', attrs={'data-original': True}): |
| 36 |
img['src'] = img['data-original'] |
| 37 |
return soup |