mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'ruff-pep8' of https://github.com/un-pogaz/calibre
This commit is contained in:
commit
5c9d3386ee
@ -23,8 +23,9 @@ from setup import __appname__, __version__
|
||||
|
||||
sys.path.append(base)
|
||||
|
||||
import calibre.utils.img as cimg
|
||||
import custom
|
||||
|
||||
import calibre.utils.img as cimg
|
||||
from calibre.utils.localization import localize_website_link
|
||||
|
||||
del sys.path[0]
|
||||
|
@ -299,7 +299,7 @@ def render_options(cmd, groups, options_header=True, add_program=True, header_le
|
||||
|
||||
|
||||
def mark_options(raw):
|
||||
raw = re.sub(r'(\s+)--(\s+)', u'\\1``--``\\2', raw)
|
||||
raw = re.sub(r'(\s+)--(\s+)', r'\1``--``\2', raw)
|
||||
|
||||
def sub(m):
|
||||
opt = m.group()
|
||||
|
@ -8,13 +8,13 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import os
|
||||
|
||||
from sphinx.builders.epub3 import Epub3Builder as EpubBuilder
|
||||
|
||||
from calibre.ebooks.oeb.base import OPF
|
||||
from calibre.ebooks.oeb.polish.check.links import UnreferencedResource, check_links
|
||||
from calibre.ebooks.oeb.polish.container import OEB_DOCS, get_container
|
||||
from calibre.ebooks.oeb.polish.pretty import pretty_html_tree, pretty_opf
|
||||
from calibre.utils.imghdr import identify
|
||||
from sphinx.builders.epub3 import Epub3Builder as EpubBuilder
|
||||
|
||||
from polyglot.builtins import iteritems
|
||||
|
||||
|
||||
|
@ -7,14 +7,15 @@ __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
import re
|
||||
|
||||
from css_parser.css import CSSRule
|
||||
from qt.core import QAction, QInputDialog
|
||||
|
||||
from calibre import force_unicode
|
||||
from calibre.ebooks.oeb.polish.container import OEB_DOCS, OEB_STYLES, serialize
|
||||
from calibre.gui2 import error_dialog
|
||||
|
||||
# The base class that all tools must inherit from
|
||||
from calibre.gui2.tweak_book.plugin import Tool
|
||||
from css_parser.css import CSSRule
|
||||
from qt.core import QAction, QInputDialog
|
||||
|
||||
|
||||
class DemoTool(Tool):
|
||||
|
@ -6,9 +6,10 @@ __license__ = 'GPL v3'
|
||||
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from calibre.utils.config import JSONConfig
|
||||
from qt.core import QHBoxLayout, QLabel, QLineEdit, QWidget
|
||||
|
||||
from calibre.utils.config import JSONConfig
|
||||
|
||||
# This is where all preferences for this plugin will be stored
|
||||
# Remember that this name (i.e. plugins/interface_demo) is also
|
||||
# in a global namespace, so make it as unique as possible.
|
||||
|
@ -12,9 +12,10 @@ if False:
|
||||
# You do not need this code in your plugins
|
||||
get_icons = get_resources = None
|
||||
|
||||
from calibre_plugins.interface_demo.config import prefs
|
||||
from qt.core import QDialog, QLabel, QMessageBox, QPushButton, QVBoxLayout
|
||||
|
||||
from calibre_plugins.interface_demo.config import prefs
|
||||
|
||||
|
||||
class DemoDialog(QDialog):
|
||||
|
||||
|
@ -4,24 +4,35 @@ requires-python = ">=3.8"
|
||||
[tool.ruff]
|
||||
line-length = 160
|
||||
target-version = 'py38'
|
||||
builtins = ['_']
|
||||
|
||||
[tool.ruff.lint]
|
||||
ignore = ['E741', 'E402', 'E722', 'E401']
|
||||
select = ['E', 'F', 'I']
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"src/calibre/ebooks/unihandecode/unicodepoints.py" = ["E501"]
|
||||
"src/qt/__init__.py" = ["E501"]
|
||||
builtins = ['_', 'I', 'P']
|
||||
include = ['*.py', '*.recipe']
|
||||
exclude = [
|
||||
"*_ui.py",
|
||||
"bypy/*",
|
||||
"setup/*",
|
||||
"src/css_selectors/*",
|
||||
"src/polyglot/*",
|
||||
"src/templite/*",
|
||||
"src/tinycss/*",
|
||||
]
|
||||
|
||||
[tool.ruff.format]
|
||||
quote-style = 'single'
|
||||
|
||||
[tool.ruff.lint]
|
||||
ignore = ['E402', 'E722', 'E741', 'E401']
|
||||
select = ['E', 'F', 'I', 'W']
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"src/calibre/ebooks/unihandecode/*codepoints.py" = ['E501', 'W191']
|
||||
"src/qt/*.py" = ['I']
|
||||
"src/qt/*.pyi" = ['I']
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
detect-same-package = true
|
||||
extra-standard-library = ['aes', 'elementmaker', 'encodings']
|
||||
known-first-party = ["calibre_extensions", 'polyglot']
|
||||
known-third-party = ["qt"]
|
||||
extra-standard-library = ["aes", "elementmaker", "encodings"]
|
||||
known-first-party = ["calibre_extensions", "calibre_plugins", "polyglot"]
|
||||
known-third-party = ["odf", "qt", "templite", "tinycss", "css_selectors"]
|
||||
relative-imports-order = "closest-to-furthest"
|
||||
split-on-trailing-comma = false
|
||||
section-order = ['__python__', "future", "standard-library", "third-party", "first-party", "local-folder"]
|
||||
|
@ -7,12 +7,13 @@ from collections import defaultdict
|
||||
from datetime import datetime, timedelta
|
||||
from urllib.parse import quote, urlencode
|
||||
|
||||
from html5_parser import parse
|
||||
from lxml import etree
|
||||
|
||||
from calibre import replace_entities
|
||||
from calibre.ebooks.BeautifulSoup import NavigableString, Tag
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from html5_parser import parse
|
||||
from lxml import etree
|
||||
|
||||
use_archive = True
|
||||
|
||||
|
@ -4,9 +4,10 @@ __copyright__ = '2010, Walt Anthony <workshop.northpole at gmail.com>'
|
||||
www.americanthinker.com
|
||||
'''
|
||||
import html5lib
|
||||
from lxml import etree
|
||||
|
||||
from calibre.utils.cleantext import clean_xml_chars
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from lxml import etree
|
||||
|
||||
|
||||
class AmericanThinker(BasicNewsRecipe):
|
||||
|
@ -4,9 +4,10 @@ __copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||
spectator.org
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from css_selectors import Select
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class TheAmericanSpectator(BasicNewsRecipe):
|
||||
title = 'The American Spectator'
|
||||
|
@ -7,7 +7,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class BeforeWeGo(BasicNewsRecipe):
|
||||
title = 'Before We Go'
|
||||
title = 'Before We Go'
|
||||
__author__ = 'bugmen00t'
|
||||
description = 'Before We Go Blog is a collective of Fantasy, Sci-Fi and Graphic Novel fans from around the world, passionate about providing awesome, enjoyable reviews for anyone who loves a good book!' # noqa
|
||||
publisher = 'BEFOREWEGOBLOG'
|
||||
|
@ -14,7 +14,7 @@ class bergfreunde_blog(BasicNewsRecipe):
|
||||
max_articles_per_feed = 100
|
||||
# clean up the mess
|
||||
auto_cleanup = True
|
||||
# what's this?
|
||||
# what's this?
|
||||
description = 'Blog der Bergfreunde Seite (Online Händler für Bergsport)'
|
||||
publisher = 'https://www.bergfreunde.de/ueber-die-bergfreunde/'
|
||||
language = 'de'
|
||||
@ -31,4 +31,4 @@ class bergfreunde_blog(BasicNewsRecipe):
|
||||
|
||||
feeds = [
|
||||
('Bergfreunde', 'https://www.bergfreunde.de/blog/feed'),
|
||||
]
|
||||
]
|
||||
|
@ -3,9 +3,10 @@
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from html5_parser import parse
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class BusinessStandard(BasicNewsRecipe):
|
||||
title = 'Business Standard'
|
||||
@ -97,9 +98,9 @@ class BusinessStandard(BasicNewsRecipe):
|
||||
date = (datetime.fromtimestamp(int(data['publishDate']))).strftime('%b %d, %Y | %I:%M %p')
|
||||
|
||||
authors = []
|
||||
if 'articleMappedMultipleAuthors' in data:
|
||||
if 'articleMappedMultipleAuthors' in data:
|
||||
for aut in data['articleMappedMultipleAuthors']:
|
||||
authors.append(data['articleMappedMultipleAuthors'][str(aut)])
|
||||
authors.append(data['articleMappedMultipleAuthors'][str(aut)])
|
||||
auth = '<div><p class="auth">' + ', '.join(authors) + ' | ' + data['placeName'] + ' | ' + date + '</p></div>'
|
||||
|
||||
if 'featuredImageObj' in data:
|
||||
|
@ -3,9 +3,10 @@
|
||||
import json
|
||||
from urllib.parse import quote, urlparse
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from mechanize import Request
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
def absurl(x):
|
||||
if x.startswith('//'):
|
||||
|
@ -5,7 +5,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class CATOInstitute(BasicNewsRecipe):
|
||||
title = u'The CATO Institute'
|
||||
description = "The Cato Institute is a public policy research organization — a think tank — \
|
||||
description = "The Cato Institute is a public policy research organization — a think tank — \
|
||||
dedicated to the principles of individual liberty, limited government, free markets and peace.\
|
||||
Its scholars and analysts conduct independent, nonpartisan research on a wide range of policy issues."
|
||||
__author__ = '_reader'
|
||||
|
@ -5,7 +5,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class Cherta(BasicNewsRecipe):
|
||||
title = '\u0427\u0435\u0440\u0442\u0430'
|
||||
title = '\u0427\u0435\u0440\u0442\u0430'
|
||||
__author__ = 'bugmen00t'
|
||||
description = ' \u0418\u043D\u0442\u0435\u0440\u0435\u0441\u043D\u044B\u0435, \u0432\u0430\u0436\u043D\u044B\u0435 \u0438 \u0433\u043B\u0443\u0431\u043E\u043A\u0438\u0435 \u0442\u0435\u043A\u0441\u0442\u044B \u043F\u0440\u043E \u043D\u0430\u0441\u0438\u043B\u0438\u0435 \u0438 \u043D\u0435\u0440\u0430\u0432\u0435\u043D\u0441\u0442\u0432\u043E \u0432 \u0420\u043E\u0441\u0441\u0438\u0438.' # noqa
|
||||
publisher = 'cherta.media'
|
||||
|
@ -58,14 +58,14 @@ class CourrierInternational(BasicNewsRecipe):
|
||||
|
||||
.info-date, .info-reserved {
|
||||
font-style: italic;
|
||||
font-size: 0.9em;
|
||||
font-size: 0.9em;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.strapline {
|
||||
font-size: 1.17em;
|
||||
font-weight: bold;
|
||||
margin: 0.67em 0;
|
||||
margin: 0.67em 0;
|
||||
line-height: 1.2;
|
||||
}
|
||||
'''
|
||||
|
@ -18,7 +18,6 @@ class herald(BasicNewsRecipe):
|
||||
keep_only_tags = [
|
||||
classes('article-title article-author__name'),
|
||||
dict(name='div', attrs={'id':'main-content'})
|
||||
|
||||
]
|
||||
|
||||
remove_tags = [
|
||||
|
@ -16,10 +16,10 @@ class DeutscheWelle_bs(BasicNewsRecipe):
|
||||
remove_empty_feeds = True
|
||||
remove_javascript = True
|
||||
masthead_url = 'http://www.dw-world.de/skins/std/channel1/pics/dw_logo1024.gif'
|
||||
|
||||
|
||||
ignore_duplicate_articles = {'title', 'url'}
|
||||
remove_attributes = ['height', 'width', 'style']
|
||||
|
||||
|
||||
keep_only_tags = [
|
||||
dict(name='article')
|
||||
]
|
||||
|
@ -40,7 +40,7 @@ class DeutscheWelle(BasicNewsRecipe):
|
||||
dict(attrs={'data-tracking-name':'sharing-icons-inline'}),
|
||||
classes('kicker advertisement vjs-wrapper')
|
||||
]
|
||||
|
||||
|
||||
# watch out https://www.dw.com/de/service/rss/s-9773 for description of possible rss feeds
|
||||
feeds = [
|
||||
('Nachrichten', 'http://rss.dw.com/xml/rss-de-news'),
|
||||
@ -53,7 +53,7 @@ class DeutscheWelle(BasicNewsRecipe):
|
||||
('Kultur und Leben', 'http://rss.dw.com/xml/rss-de-cul'),
|
||||
('Thema des Tages', 'http://rss.dw.com/xml/rss-de-top'),
|
||||
]
|
||||
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for img in soup.findAll('img', srcset=True):
|
||||
img['src'] = img['srcset'].split()[6]
|
||||
|
@ -15,7 +15,7 @@ class DeutscheWelle_en(BasicNewsRecipe):
|
||||
remove_empty_feeds = True
|
||||
ignore_duplicate_articles = {'title', 'url'}
|
||||
remove_attributes = ['height', 'width', 'style']
|
||||
|
||||
|
||||
recipe_specific_options = {
|
||||
'days': {
|
||||
'short': 'Oldest article to download from this news source. In days ',
|
||||
@ -29,17 +29,17 @@ class DeutscheWelle_en(BasicNewsRecipe):
|
||||
d = self.recipe_specific_options.get('days')
|
||||
if d and isinstance(d, str):
|
||||
self.oldest_article = float(d)
|
||||
|
||||
|
||||
keep_only_tags = [
|
||||
dict(name='article')
|
||||
]
|
||||
|
||||
|
||||
remove_tags = [
|
||||
dict(name=['footer', 'source']),
|
||||
dict(attrs={'data-tracking-name':'sharing-icons-inline'}),
|
||||
classes('kicker advertisement vjs-wrapper')
|
||||
]
|
||||
|
||||
|
||||
feeds = [
|
||||
('World', 'http://rss.dw.de/rdf/rss-en-world'),
|
||||
('Germany', 'http://rss.dw.de/rdf/rss-en-ger'),
|
||||
@ -51,7 +51,7 @@ class DeutscheWelle_en(BasicNewsRecipe):
|
||||
('Asia', 'http://rss.dw.de/rdf/rss-en-asia'),
|
||||
('Top Stories', 'http://rss.dw-world.de/rdf/rss-en-top'),
|
||||
]
|
||||
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for img in soup.findAll('img', srcset=True):
|
||||
img['src'] = img['srcset'].split()[6]
|
||||
|
@ -19,7 +19,7 @@ class DeutscheWelle_pt(BasicNewsRecipe):
|
||||
remove_javascript = True
|
||||
ignore_duplicate_articles = {'title', 'url'}
|
||||
remove_attributes = ['height', 'width', 'style']
|
||||
|
||||
|
||||
recipe_specific_options = {
|
||||
'days': {
|
||||
'short': 'Oldest article to download from this news source. In days ',
|
||||
|
@ -16,7 +16,7 @@ class DeutscheWelle(BasicNewsRecipe):
|
||||
remove_empty_feeds = True
|
||||
ignore_duplicate_articles = {'title', 'url'}
|
||||
remove_attributes = ['height', 'width', 'style']
|
||||
|
||||
|
||||
recipe_specific_options = {
|
||||
'days': {
|
||||
'short': 'Oldest article to download from this news source. In days ',
|
||||
@ -30,7 +30,7 @@ class DeutscheWelle(BasicNewsRecipe):
|
||||
d = self.recipe_specific_options.get('days')
|
||||
if d and isinstance(d, str):
|
||||
self.oldest_article = float(d)
|
||||
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for img in soup.findAll('img', srcset=True):
|
||||
img['src'] = img['srcset'].split()[6]
|
||||
@ -39,7 +39,7 @@ class DeutscheWelle(BasicNewsRecipe):
|
||||
keep_only_tags = [
|
||||
dict(name='article')
|
||||
]
|
||||
|
||||
|
||||
remove_tags = [
|
||||
dict(name=['footer', 'source']),
|
||||
dict(attrs={'data-tracking-name':'sharing-icons-inline'}),
|
||||
|
@ -7,7 +7,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class WiComix(BasicNewsRecipe):
|
||||
title = 'dev.ua'
|
||||
title = 'dev.ua'
|
||||
__author__ = 'bugmen00t'
|
||||
publisher = '\u0422\u041E\u0412 \u00AB\u0414\u0435\u0432 \u0423\u043A\u0440\u0430\u0457\u043D\u0430\u00BB'
|
||||
category = 'news'
|
||||
|
@ -16,6 +16,7 @@ try:
|
||||
except ImportError:
|
||||
from cookielib import Cookie
|
||||
import mechanize
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@ class DRNyheder(BasicNewsRecipe):
|
||||
publisher = 'DR Nyheder'
|
||||
description = 'Her finder du nyheder fra DR.'
|
||||
category = 'news, politics, money, culture, sport, science, Denmark'
|
||||
publication_type = 'newspaper'
|
||||
publication_type = 'newspaper'
|
||||
encoding = 'utf8'
|
||||
language = 'da'
|
||||
oldest_article = 4 # 2 might be best
|
||||
@ -47,7 +47,7 @@ class DRNyheder(BasicNewsRecipe):
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
auto_cleanup = False
|
||||
remove_empty_feeds = True
|
||||
remove_empty_feeds = True
|
||||
ignore_duplicate_articles = {'title', 'url'}
|
||||
simultaneous_downloads = 20
|
||||
compress_news_images = True
|
||||
|
@ -4,7 +4,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class EchoMsk(BasicNewsRecipe):
|
||||
title = '\u042D\u0425\u041E'
|
||||
title = '\u042D\u0425\u041E'
|
||||
__author__ = 'bugmen00t'
|
||||
description = ('\u042D\u0425\u041E - \u043A\u0430\u043A \u043D\u0430 \u0441\u0442\u0430\u0440\u043E\u043C'
|
||||
' \u0434\u043E\u0431\u0440\u043E\u043C \u0440\u0430\u0434\u0438\u043E')
|
||||
|
@ -53,7 +53,7 @@ class JSONHasNoContent(ValueError):
|
||||
|
||||
|
||||
def load_article_from_json(raw, root):
|
||||
# open('/t/raw.json', 'w').write(raw)
|
||||
# open('/t/raw.json', 'w').write(raw)
|
||||
data = json.loads(raw)
|
||||
body = root.xpath('//body')[0]
|
||||
article = E(body, 'article')
|
||||
|
@ -42,7 +42,7 @@ class EpochTimes(BasicNewsRecipe):
|
||||
dict(name='img', attrs={'src':lambda x: x and x.endswith('svg')})
|
||||
]
|
||||
|
||||
# feeds can be found at https://www.theepochtimes.com/rssfeeds
|
||||
# feeds can be found at https://www.theepochtimes.com/rssfeeds
|
||||
feeds = [
|
||||
('Special Series', 'https://feed.theepochtimes.com/health/special-series/feed'),
|
||||
('US', 'https://feed.theepochtimes.com/us/feed'),
|
||||
|
@ -5,9 +5,10 @@ www.esquire.com
|
||||
'''
|
||||
from collections import defaultdict
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from css_selectors import Select
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
def absolutize(url):
|
||||
if url.startswith('/'):
|
||||
|
@ -4,9 +4,10 @@ import json
|
||||
import re
|
||||
from urllib.parse import quote
|
||||
|
||||
from html5_parser import parse
|
||||
|
||||
from calibre import browser
|
||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||
from html5_parser import parse
|
||||
|
||||
|
||||
class ft(BasicNewsRecipe):
|
||||
|
@ -7,9 +7,10 @@ __copyright__ = '2017, John Hutson <jfhutson at gmail.com>'
|
||||
firstthings.com
|
||||
'''
|
||||
import html5lib
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from lxml import html
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class FirstThings(BasicNewsRecipe):
|
||||
|
||||
|
@ -4,9 +4,10 @@ import re
|
||||
|
||||
import html5lib
|
||||
import mechanize
|
||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||
from lxml import html
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||
|
||||
|
||||
def as_article(source, log):
|
||||
url = source['url']
|
||||
|
@ -69,15 +69,15 @@ class Frontline(BasicNewsRecipe):
|
||||
issue_url = 'https://frontline.thehindu.com/magazine/issue/vol' + d
|
||||
|
||||
soup = self.index_to_soup(issue_url)
|
||||
|
||||
|
||||
if cover := soup.find('div', attrs={'class':'magazine'}):
|
||||
self.cover_url = cover.find(**classes('sptar-image')).img['data-original'].replace('SQUARE_80', 'FREE_615')
|
||||
self.log('Cover ', self.cover_url)
|
||||
if desc := cover.find(**classes('sub-text')):
|
||||
self.description = self.tag_to_string(desc)
|
||||
|
||||
|
||||
feeds_dict = defaultdict(list)
|
||||
|
||||
|
||||
mag = soup.find(**classes('section-magazine'))
|
||||
for div in mag.findAll('div', attrs={'class':'content'}):
|
||||
a = div.find(**classes('title')).find('a')
|
||||
@ -87,7 +87,7 @@ class Frontline(BasicNewsRecipe):
|
||||
if cat := div.find(**classes('label')):
|
||||
section = self.tag_to_string(cat)
|
||||
desc = ''
|
||||
|
||||
|
||||
if art := div.find(**classes('sub-text')):
|
||||
desc = self.tag_to_string(art)
|
||||
if auth := div.find(**classes('author')):
|
||||
|
@ -20,9 +20,9 @@ class google_news_de(BasicNewsRecipe):
|
||||
cover_url = 'https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Google_News_icon.svg/500px-Google_News_icon.svg.png'
|
||||
# Author
|
||||
__author__ = 'Volker Heggemann, VoHe, unkn0wn'
|
||||
# oldest article to download (in days) ---- can be edit by user
|
||||
# oldest article to download (in days) ---- can be edit by user
|
||||
oldest_article = 1.25
|
||||
# describes itself, ---- can be edit by user
|
||||
# describes itself, ---- can be edit by user
|
||||
max_articles_per_feed = 200
|
||||
# speed up the download on fast computers be careful (I test max.20)
|
||||
# ---- can be edit by user
|
||||
@ -31,7 +31,7 @@ class google_news_de(BasicNewsRecipe):
|
||||
description = u'Google News filter by your own recipe. Please read it in calibre software!'
|
||||
# What is the content of?
|
||||
category = u'NEWS'
|
||||
# describes itself, ---- can be edit by user
|
||||
# describes itself, ---- can be edit by user
|
||||
use_embedded_content = False
|
||||
remove_javascript = True
|
||||
# Removes empty feeds - why keep them!?
|
||||
@ -39,7 +39,7 @@ class google_news_de(BasicNewsRecipe):
|
||||
|
||||
# remove the rubbish (in ebook)
|
||||
auto_cleanup = True
|
||||
|
||||
|
||||
articles_are_obfuscated = True
|
||||
|
||||
def get_obfuscated_article(self, url):
|
||||
@ -65,7 +65,7 @@ class google_news_de(BasicNewsRecipe):
|
||||
return pt.name
|
||||
|
||||
# now the content description and URL follows
|
||||
# feel free to add, wipe out what you need ---- can be edit by user
|
||||
# feel free to add, wipe out what you need ---- can be edit by user
|
||||
#
|
||||
def get_feeds(self):
|
||||
url = "https://geolocation-db.com/json"
|
||||
|
@ -5,7 +5,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class Gorky(BasicNewsRecipe):
|
||||
title = '\u0413\u043E\u0440\u044C\u043A\u0438\u0439'
|
||||
title = '\u0413\u043E\u0440\u044C\u043A\u0438\u0439'
|
||||
__author__ = 'bugmen00t'
|
||||
description = '\u041D\u0435\u043A\u043E\u043C\u043C\u0435\u0440\u0447\u0435\u0441\u043A\u0438\u0439 \u043F\u0440\u043E\u0435\u043A\u0442 \u043E \u043A\u043D\u0438\u0433\u0430\u0445 \u0438 \u0447\u0442\u0435\u043D\u0438\u0438.' # noqa
|
||||
publisher = '\u0410\u041D\u041E "\u0426\u0435\u043D\u0442\u0440 \u043F\u043E \u0441\u043E\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044E \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044F \u043A\u0443\u043B\u044C\u0442\u0443\u0440\u044B \u0447\u0442\u0435\u043D\u0438\u044F \u0438 \u043A\u043D\u0438\u0433\u043E\u0438\u0437\u0434\u0430\u043D\u0438\u044F \u00AB\u0413\u043E\u0440\u044C\u043A\u0438\u0439 \u041C\u0435\u0434\u0438\u0430\u00BB"' # noqa
|
||||
|
@ -8,9 +8,10 @@ __copyright__ = '2011, Piotr Kontek, piotr.kontek@gmail.com \
|
||||
import re
|
||||
import time
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from lxml import html
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class GN(BasicNewsRecipe):
|
||||
__author__ = 'Piotr Kontek, Tomasz Długosz'
|
||||
|
@ -7,9 +7,10 @@ __copyright__ = '2011, Piotr Kontek, piotr.kontek@gmail.com \
|
||||
|
||||
import re
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from lxml import html
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class GN(BasicNewsRecipe):
|
||||
__author__ = 'Piotr Kontek, Tomasz Długosz'
|
||||
|
@ -5,9 +5,10 @@ import re
|
||||
from collections import OrderedDict
|
||||
from urllib.parse import urlencode, urljoin
|
||||
|
||||
from mechanize import Request
|
||||
|
||||
from calibre import browser, random_user_agent
|
||||
from calibre.web.feeds.news import BasicNewsRecipe, classes
|
||||
from mechanize import Request
|
||||
|
||||
|
||||
class HBR(BasicNewsRecipe):
|
||||
|
@ -2,9 +2,10 @@
|
||||
# vim:fileencoding=utf-8
|
||||
import json
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from html5_parser import parse
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
def get_story(story):
|
||||
str_type = story.get('type', '')
|
||||
|
@ -15,10 +15,10 @@ class hindutamil(BasicNewsRecipe):
|
||||
language = 'ta'
|
||||
remove_attributes = ['style', 'height', 'width']
|
||||
masthead_url = 'https://static.hindutamil.in/hindu/static/store/images/logo.png'
|
||||
|
||||
|
||||
def get_browser(self):
|
||||
return BasicNewsRecipe.get_browser(self, user_agent='common_words/based')
|
||||
|
||||
return BasicNewsRecipe.get_browser(self, user_agent='common_words/based')
|
||||
|
||||
keep_only_tags = [
|
||||
classes('main-article')
|
||||
]
|
||||
|
@ -37,7 +37,7 @@ class horizons(BasicNewsRecipe):
|
||||
'long': 'For example, https://www.cirsd.org/en/horizons/horizons-winter-2024--issue-no-25',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def get_browser(self):
|
||||
return BasicNewsRecipe.get_browser(self, verify_ssl_certificates=False)
|
||||
|
||||
|
@ -41,7 +41,7 @@ class Hurriyet(BasicNewsRecipe):
|
||||
keep_only_tags = [
|
||||
# title
|
||||
{'class': 'news-detail-title'},
|
||||
# date
|
||||
# date
|
||||
{'class': 'news-detail-text'},
|
||||
# media
|
||||
{'class': 'news-media'},
|
||||
|
@ -1,7 +1,7 @@
|
||||
##########################################################################
|
||||
# Description: http://hvg.hu/ RSS channel
|
||||
# Author: Bigpapa (bigpapabig@hotmail.com)
|
||||
# Date: 2011.12.20. - V1.1
|
||||
# Description: http://hvg.hu/ RSS channel
|
||||
# Author: Bigpapa (bigpapabig@hotmail.com)
|
||||
# Date: 2011.12.20. - V1.1
|
||||
##########################################################################
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
@ -11,7 +11,7 @@ class hvg(BasicNewsRecipe):
|
||||
title = u'HVG'
|
||||
__author__ = 'Bigpapa'
|
||||
language = 'hu'
|
||||
oldest_article = 5 # Hany napos legyen a legregebbi cikk amit leszedjen.
|
||||
oldest_article = 5 # Hany napos legyen a legregebbi cikk amit leszedjen.
|
||||
# Az adott e-bookban tarolt cikkek feedenkenti maximalis szamat adja meg.
|
||||
max_articles_per_feed = 5
|
||||
no_stylesheets = True
|
||||
|
@ -12,18 +12,18 @@ class inc42(BasicNewsRecipe):
|
||||
language = 'en_IN'
|
||||
remove_attributes = ['style', 'height', 'width']
|
||||
masthead_url = 'https://omcdn.inc42.com/users/d0ffd8ffa0d2/images/4477fc48bee71659696918-color-black-1-e1576150264134.png?width=224'
|
||||
|
||||
|
||||
keep_only_tags = [
|
||||
classes('entry-header entry-content'),
|
||||
]
|
||||
|
||||
|
||||
remove_tags = [
|
||||
dict(name='button'),
|
||||
classes('also-read slick-list slides-three common-card'),
|
||||
]
|
||||
|
||||
ignore_duplicate_articles = {'title', 'url'}
|
||||
remove_empty_feeds = True
|
||||
remove_empty_feeds = True
|
||||
|
||||
def parse_index(self):
|
||||
index = 'https://inc42.com/'
|
||||
|
@ -8,9 +8,10 @@ import json
|
||||
from contextlib import closing
|
||||
from time import sleep
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from mechanize import Request
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
def absolutize(url):
|
||||
if url.startswith('/'):
|
||||
|
@ -38,4 +38,4 @@ class Computerra(BasicNewsRecipe):
|
||||
feeds = [(
|
||||
u'\u041A\u043E\u043C\u043F\u044C\u044E\u0442\u0435\u0440\u0440\u0430',
|
||||
'https://www.computerra.ru/feed/'
|
||||
)]
|
||||
)]
|
||||
|
@ -26,7 +26,7 @@ class LeGorafi(BasicNewsRecipe):
|
||||
height: auto !important;
|
||||
}
|
||||
'''
|
||||
|
||||
|
||||
keep_only_tags = [
|
||||
dict(name='h1'),
|
||||
dict(name='img', attrs={'class': 'attachment- size- wp-post-image'}),
|
||||
@ -36,16 +36,16 @@ class LeGorafi(BasicNewsRecipe):
|
||||
dict(name='div', attrs={'class': 'heateor_sss_sharing_container'}),
|
||||
]
|
||||
feeds = ['http://www.legorafi.fr/feed/']
|
||||
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for img in soup.findAll('img'):
|
||||
if 'svg' in img['src']:
|
||||
img.decompose() # Removes the tag entirely
|
||||
return soup
|
||||
|
||||
|
||||
def is_cover(article):
|
||||
return 'gorafi-magazine' in article.url
|
||||
|
||||
|
||||
def get_cover_url(self):
|
||||
feeds = BasicNewsRecipe.parse_feeds(self)
|
||||
for feed in feeds:
|
||||
@ -55,12 +55,12 @@ class LeGorafi(BasicNewsRecipe):
|
||||
img = soup.select_one('#mvp-post-feat-img img')
|
||||
return img['data-lazy-src']
|
||||
print("No cover found")
|
||||
return None
|
||||
|
||||
return None
|
||||
|
||||
def parse_feeds(self):
|
||||
feeds = BasicNewsRecipe.parse_feeds(self)
|
||||
for feed in feeds:
|
||||
for article in feed.articles:
|
||||
if LeGorafi.is_cover(article):
|
||||
feed.articles.remove(article)
|
||||
return feeds
|
||||
return feeds
|
||||
|
@ -129,11 +129,11 @@ class LeMonde(BasicNewsRecipe):
|
||||
dict(name=['footer', 'link', 'meta', 'svg', 'button', 'source']),
|
||||
dict(name='img', attrs={'class': ['article__author-picture']}),
|
||||
dict(name='section', attrs={'class':
|
||||
[
|
||||
'inread js-services-inread', 'catcher catcher--inline', 'inread inread--NL js-services-inread',
|
||||
'article__reactions', 'author', 'catcher', 'portfolio', 'services-inread'
|
||||
]
|
||||
})
|
||||
[
|
||||
'inread js-services-inread', 'catcher catcher--inline', 'inread inread--NL js-services-inread',
|
||||
'article__reactions', 'author', 'catcher', 'portfolio', 'services-inread'
|
||||
]
|
||||
})
|
||||
]
|
||||
|
||||
remove_attributes = [
|
||||
|
@ -30,7 +30,7 @@ class AdvancedUserRecipe1591780224(BasicNewsRecipe):
|
||||
# remove the rubbish (in ebook)
|
||||
auto_cleanup = True
|
||||
# now the content description and URL follows
|
||||
# feel free to add, wipe out what you need ---- can be edit by user
|
||||
# feel free to add, wipe out what you need ---- can be edit by user
|
||||
#
|
||||
# some of this are double
|
||||
#
|
||||
|
@ -111,16 +111,17 @@ class Mediapart(BasicNewsRecipe):
|
||||
br['email'] = self.username
|
||||
br['password'] = self.password
|
||||
br.submit()
|
||||
|
||||
|
||||
return br
|
||||
|
||||
def default_cover(self, cover_file):
|
||||
'''
|
||||
Create a generic cover for recipes that don't have a cover
|
||||
'''
|
||||
from calibre.gui2 import ensure_app, load_builtin_fonts, pixmap_to_data
|
||||
from qt.core import QFont, QImage, QPainter, QPen, QRect, Qt
|
||||
|
||||
from calibre.gui2 import ensure_app, load_builtin_fonts, pixmap_to_data
|
||||
|
||||
def init_environment():
|
||||
ensure_app()
|
||||
load_builtin_fonts()
|
||||
|
@ -74,7 +74,7 @@ class MitTechnologyReview(BasicNewsRecipe):
|
||||
}
|
||||
|
||||
def parse_index(self):
|
||||
# for past editions, change the issue link below
|
||||
# for past editions, change the issue link below
|
||||
issue = 'http://www.technologyreview.com/magazine/'
|
||||
d = self.recipe_specific_options.get('issue_url')
|
||||
if d and isinstance(d, str):
|
||||
|
@ -53,7 +53,7 @@ class MoneyControlRecipe(BasicNewsRecipe):
|
||||
index = 'https://www.moneycontrol.com/'
|
||||
|
||||
business_sections = [
|
||||
'markets', 'stocks', 'ipo', 'budget', 'banks', 'moneycontrol-research', 'economy', 'earnings', 'real-estate',
|
||||
'markets', 'stocks', 'ipo', 'budget', 'banks', 'moneycontrol-research', 'economy', 'earnings', 'real-estate',
|
||||
'personal-finance', 'commodities', 'trade', 'companies'
|
||||
]
|
||||
|
||||
|
@ -5,7 +5,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class MoscowTimes(BasicNewsRecipe):
|
||||
title = 'The Moscow Times'
|
||||
title = 'The Moscow Times'
|
||||
__author__ = 'bugmen00t'
|
||||
description = 'The Moscow Times is Russia’s leading, independent English-language media outlet. Our team of Russian and English journalists provide readers across the world with breaking news, engaging stories and balanced reporting about the largest country on Earth.' # noqa
|
||||
publisher = 'Tiamti LLC'
|
||||
|
@ -9,9 +9,9 @@ class MyDealzDE(BasicNewsRecipe):
|
||||
title = 'MyDealz'
|
||||
# Author
|
||||
__author__ = 'Volker Heggemann, VoHe'
|
||||
# oldest article to download (in days) ---- can be edit by user
|
||||
# oldest article to download (in days) ---- can be edit by user
|
||||
oldest_article = 5
|
||||
# describes itself, ---- can be edit by user
|
||||
# describes itself, ---- can be edit by user
|
||||
max_articles_per_feed = 100
|
||||
# Cover Picture
|
||||
cover_url = 'https://pbs.twimg.com/profile_images/817053687545741313/0wFqvfqC_400x400.jpg'
|
||||
@ -24,9 +24,9 @@ class MyDealzDE(BasicNewsRecipe):
|
||||
publisher = u'https://www.mydealz.de'
|
||||
# What is the content of?
|
||||
category = u'Shopping'
|
||||
# describes itself, ---- can be edit by user
|
||||
# describes itself, ---- can be edit by user
|
||||
use_embedded_content = False
|
||||
# describes itself, ---- can be edit by user
|
||||
# describes itself, ---- can be edit by user
|
||||
language = 'de'
|
||||
# encoding of content. e.g. utf-8, None, ...
|
||||
# ---- can be edit by user
|
||||
@ -39,7 +39,7 @@ class MyDealzDE(BasicNewsRecipe):
|
||||
# remove the rubbish (in ebook)
|
||||
auto_cleanup = True
|
||||
# now the content description and URL follows
|
||||
# feel free to add, wipe out what you need ---- can be edit by user
|
||||
# feel free to add, wipe out what you need ---- can be edit by user
|
||||
#
|
||||
# some of this are double
|
||||
#
|
||||
|
@ -84,7 +84,7 @@ class NewScientist(BasicNewsRecipe):
|
||||
d = self.recipe_specific_options.get('issue')
|
||||
if d and isinstance(d, str):
|
||||
issue_url = 'https://www.newscientist.com/issue/' + d
|
||||
|
||||
|
||||
soup = self.index_to_soup(issue_url)
|
||||
div = soup.find('div', attrs={'class':'ThisWeeksMagazineHero__CoverInfo'})
|
||||
tme = div.find(**classes('ThisWeeksMagazineHero__MagInfoHeading'))
|
||||
|
@ -1,7 +1,7 @@
|
||||
##########################################################################
|
||||
# Description: http://nol.hu/ RSS channel
|
||||
# Author: Bigpapa (bigpapabig@hotmail.com)
|
||||
# Date: 2011.12.18. - V1.1
|
||||
# Description: http://nol.hu/ RSS channel
|
||||
# Author: Bigpapa (bigpapabig@hotmail.com)
|
||||
# Date: 2011.12.18. - V1.1
|
||||
##########################################################################
|
||||
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
|
@ -4,9 +4,10 @@ import json
|
||||
import re
|
||||
from contextlib import closing
|
||||
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
from mechanize import Request
|
||||
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
|
||||
|
||||
class NRC(BasicNewsRecipe):
|
||||
title = 'NRC'
|
||||
|
@ -1,9 +1,10 @@
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
from mechanize import Request
|
||||
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
|
||||
|
||||
class Nzz(BasicNewsRecipe):
|
||||
title = 'NZZ'
|
||||
|
@ -7,9 +7,10 @@ odb.org
|
||||
|
||||
import uuid
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from lxml import html
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class OurDailyBread(BasicNewsRecipe):
|
||||
title = 'Our Daily Bread'
|
||||
|
@ -7,7 +7,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class PaperPaper(BasicNewsRecipe):
|
||||
title = '\u0411\u0443\u043C\u0430\u0433\u0430'
|
||||
title = '\u0411\u0443\u043C\u0430\u0433\u0430'
|
||||
__author__ = 'bugmen00t'
|
||||
description = '\u0418\u0437\u0434\u0430\u043D\u0438\u0435 \u043E \u043F\u0440\u0435\u043A\u0440\u0430\u0441\u043D\u043E\u043C \u0433\u043E\u0440\u043E\u0434\u0435 \u0421\u0430\u043D\u043A\u0442-\u041F\u0435\u0442\u0435\u0440\u0431\u0443\u0440\u0433\u0435, \u0432 \u043A\u043E\u0442\u043E\u0440\u043E\u043C, \u043A\u043E\u043D\u0435\u0447\u043D\u043E, \u0434\u0430\u043B\u0435\u043A\u043E \u043D\u0435 \u0432\u0441\u0451 \u0438\u0434\u0435\u0430\u043B\u044C\u043D\u043E, \u2014 \u0438 \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043C\u044B \u0437\u0430\u043D\u0438\u043C\u0430\u0435\u043C\u0441\u044F \u0436\u0443\u0440\u043D\u0430\u043B\u0438\u0441\u0442\u0438\u043A\u043E\u0439, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u0438\u0432\u043B\u0435\u043A\u0430\u0442\u044C \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u0435 \u043A \u0432\u0430\u0436\u043D\u044B\u043C \u0434\u043B\u044F \u0432\u0441\u0435\u0445 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0430\u043C \u0438 \u0432\u043B\u0438\u044F\u0442\u044C \u043D\u0430 \u0438\u0445 \u0440\u0435\u0448\u0435\u043D\u0438\u0435.' # noqa
|
||||
publisher = '\u041A\u0438\u0440\u0438\u043B\u043B \u0410\u0440\u0442\u0451\u043C\u0435\u043D\u043A\u043E, \u0422\u0430\u0442\u044C\u044F\u043D\u0430 \u0418\u0432\u0430\u043D\u043E\u0432\u0430' # noqa
|
||||
|
@ -3,9 +3,10 @@ import json
|
||||
import uuid
|
||||
from contextlib import closing
|
||||
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
from mechanize import Request
|
||||
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
|
||||
|
||||
class Parool(BasicNewsRecipe):
|
||||
title = 'Het Parool'
|
||||
|
@ -33,7 +33,7 @@ class PhilosophyNow(BasicNewsRecipe):
|
||||
.articleImageCaption { font-size:small; text-align:center; }
|
||||
em, blockquote { color:#202020; }
|
||||
'''
|
||||
|
||||
|
||||
recipe_specific_options = {
|
||||
'issue': {
|
||||
'short': 'Enter the Issue Number you want to download ',
|
||||
|
@ -7,7 +7,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class Poligon(BasicNewsRecipe):
|
||||
title = '\u041F\u043E\u043B\u0438\u0433\u043E\u043D'
|
||||
title = '\u041F\u043E\u043B\u0438\u0433\u043E\u043D'
|
||||
__author__ = 'bugmen00t'
|
||||
description = '\u041D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E\u0435 \u0438\u043D\u0442\u0435\u0440\u043D\u0435\u0442-\u0438\u0437\u0434\u0430\u043D\u0438\u0435, \u0432\u044B\u043F\u0443\u0441\u043A\u0430\u0435\u043C\u043E\u0435 \u0436\u0443\u0440\u043D\u0430\u043B\u0438\u0441\u0442\u0430\u043C\u0438 \u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u0438\u0445 \u0440\u043E\u0441\u0441\u0438\u0439\u0441\u043A\u0438\u0445 \u0438\u0437\u0434\u0430\u043D\u0438\u0439, \u043F\u043E\u0434\u0432\u0435\u0440\u0433\u0448\u0438\u0445\u0441\u044F \u0434\u0430\u0432\u043B\u0435\u043D\u0438\u044E \u0441\u043E \u0441\u0442\u043E\u0440\u043E\u043D\u044B \u0433\u043E\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0430. \u041F\u0438\u0448\u0435\u043C \u043E \u0420\u043E\u0441\u0441\u0438\u0438 \u0438 \u043D\u0435 \u0442\u043E\u043B\u044C\u043A\u043E.' # noqa
|
||||
publisher = 'poligon.media'
|
||||
|
@ -12,9 +12,9 @@ class PressePortalDE(BasicNewsRecipe):
|
||||
title = 'Presseportal DE'
|
||||
# Author
|
||||
__author__ = 'Volker Heggemann, VoHe'
|
||||
# oldest article to download (in days) ---- can be edit by user
|
||||
# oldest article to download (in days) ---- can be edit by user
|
||||
oldest_article = 1
|
||||
# describes itself, ---- can be edit by user
|
||||
# describes itself, ---- can be edit by user
|
||||
max_articles_per_feed = 100
|
||||
# speed up the download on fast computers be careful (I test max.20)
|
||||
# ---- can be edit by user
|
||||
@ -29,9 +29,9 @@ class PressePortalDE(BasicNewsRecipe):
|
||||
publisher = u'Presseportal.de'
|
||||
# What is the content of?
|
||||
category = u'latest news, national Police, Germany'
|
||||
# describes itself, ---- can be edit by user
|
||||
# describes itself, ---- can be edit by user
|
||||
use_embedded_content = False
|
||||
# describes itself, ---- can be edit by user
|
||||
# describes itself, ---- can be edit by user
|
||||
language = 'de'
|
||||
# encoding of content. e.g. utf-8, None, ...
|
||||
# ---- can be edit by user
|
||||
@ -44,7 +44,7 @@ class PressePortalDE(BasicNewsRecipe):
|
||||
# remove the rubbish (in ebook)
|
||||
auto_cleanup = True
|
||||
# now the content description and URL follows
|
||||
# feel free to add, wipe out what you need ---- can be edit by user
|
||||
# feel free to add, wipe out what you need ---- can be edit by user
|
||||
#
|
||||
# some of this are double
|
||||
# so if you load "Alle Ressort" you don't need "Wirtschaft, Finanzen, Politik, Vermischtes..." at all.
|
||||
|
@ -10,27 +10,27 @@ from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
class AdvancedUserRecipe1303841067(BasicNewsRecipe):
|
||||
|
||||
title = u'Pro Physik'
|
||||
__author__ = 'schuster, Armin Geller'
|
||||
__author__ = 'schuster, Armin Geller'
|
||||
# AGE Upd. 2012-11-28, 2019-02-09,
|
||||
# 2019-02-18, 2024-02-11
|
||||
# https://www.mobileread.com/forums/showthread.php?t=133184
|
||||
|
||||
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
|
||||
no_stylesheets = True
|
||||
remove_javascript = True
|
||||
remove_empty_feeds = True
|
||||
language = 'de_DE'
|
||||
|
||||
language = 'de_DE'
|
||||
|
||||
# In case you want to assign a cover picture to this recipe.
|
||||
# Copy the file Pro_Physik.png to:
|
||||
# c:/Users/YOUR_USERNAME/AppData/Roaming/calibre/resources/images/news_covers/
|
||||
# where YOUR_USERNAME needs to be replaced with your username.
|
||||
# Then remove # in front of cover_url and replace YOUR_USERNAME with your username as well
|
||||
|
||||
|
||||
# cover_url = file:///c:/Users/YOUR_USERNAME/AppData/Roaming/calibre/resources/images/news_covers/Pro_Physik.png
|
||||
|
||||
|
||||
extra_css = '''
|
||||
h1 {font-size: 1.6em; text-align: left}
|
||||
h2, h3 {font-size: 1.3em;text-align: left}
|
||||
@ -43,7 +43,7 @@ class AdvancedUserRecipe1303841067(BasicNewsRecipe):
|
||||
dict(name='article', attrs={'id':['story']}),
|
||||
dict(name='div', attrs={'class':['event-item view-mode-default']})
|
||||
]
|
||||
|
||||
|
||||
remove_tags = [
|
||||
dict(name='ul', attrs={'class':["wj-share-buttons"]}), #Block social media
|
||||
]
|
||||
@ -51,4 +51,4 @@ class AdvancedUserRecipe1303841067(BasicNewsRecipe):
|
||||
feeds = [
|
||||
(u'Nachrichten', u'https://pro-physik.de/rss/news/'),
|
||||
# (u'Veranstaltungen', u'https://pro-physik.de/rss/events/'), # AGe 2024-02-11
|
||||
]
|
||||
]
|
||||
|
@ -7,7 +7,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class ProSleduet(BasicNewsRecipe):
|
||||
title = '\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0435\u043D\u0438\u0435 \u0441\u043B\u0435\u0434\u0443\u0435\u0442'
|
||||
title = '\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0435\u043D\u0438\u0435 \u0441\u043B\u0435\u0434\u0443\u0435\u0442'
|
||||
__author__ = 'bugmen00t'
|
||||
description = ('\u0414\u0438\u0434\u0436\u0438\u0442\u0430\u043B-\u043F\u0440\u043E\u0435\u043A\u0442'
|
||||
' \u0436\u0443\u0440\u043D\u0430\u043B\u0438\u0441\u0442\u043E\u0432'
|
||||
|
@ -9,7 +9,6 @@ publico.pt
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
from polyglot.urllib import urlencode
|
||||
|
||||
|
||||
|
@ -35,4 +35,4 @@ class QueueAcmOrg(BasicNewsRecipe):
|
||||
)
|
||||
if len(imgs) > 0:
|
||||
self.cover_url = 'https://queue.acm.org/' + imgs[0]['src']
|
||||
return getattr(self, 'cover_url', self.cover_url)
|
||||
return getattr(self, 'cover_url', self.cover_url)
|
||||
|
@ -82,70 +82,70 @@ class RadioCanada(BasicNewsRecipe):
|
||||
# From the list situated at https://ici.radio-canada.ca/rss
|
||||
feeds = [
|
||||
# Information
|
||||
('Grands titres', 'https://ici.radio-canada.ca/rss/4159'),
|
||||
('En continu', 'https://ici.radio-canada.ca/rss/1000524'),
|
||||
('Grands titres', 'https://ici.radio-canada.ca/rss/4159'),
|
||||
('En continu', 'https://ici.radio-canada.ca/rss/1000524'),
|
||||
|
||||
# Thématiques
|
||||
('Alimentation', 'https://ici.radio-canada.ca/rss/7239'),
|
||||
('Art de vivre', 'https://ici.radio-canada.ca/rss/4163'),
|
||||
('Économie', 'https://ici.radio-canada.ca/rss/5717'),
|
||||
('Environnement', 'https://ici.radio-canada.ca/rss/92408'),
|
||||
('International', 'https://ici.radio-canada.ca/rss/96'),
|
||||
('Alimentation', 'https://ici.radio-canada.ca/rss/7239'),
|
||||
('Art de vivre', 'https://ici.radio-canada.ca/rss/4163'),
|
||||
('Économie', 'https://ici.radio-canada.ca/rss/5717'),
|
||||
('Environnement', 'https://ici.radio-canada.ca/rss/92408'),
|
||||
('International', 'https://ici.radio-canada.ca/rss/96'),
|
||||
('Justice et faits divers', 'https://ici.radio-canada.ca/rss/92411'),
|
||||
('Politique', 'https://ici.radio-canada.ca/rss/4175'),
|
||||
('Santé', 'https://ici.radio-canada.ca/rss/4171'),
|
||||
('Science', 'https://ici.radio-canada.ca/rss/4165'),
|
||||
('Société', 'https://ici.radio-canada.ca/rss/7110'),
|
||||
('Techno', 'https://ici.radio-canada.ca/rss/4169'),
|
||||
('Politique', 'https://ici.radio-canada.ca/rss/4175'),
|
||||
('Santé', 'https://ici.radio-canada.ca/rss/4171'),
|
||||
('Science', 'https://ici.radio-canada.ca/rss/4165'),
|
||||
('Société', 'https://ici.radio-canada.ca/rss/7110'),
|
||||
('Techno', 'https://ici.radio-canada.ca/rss/4169'),
|
||||
|
||||
# Sports
|
||||
|
||||
('Grands titres', 'https://ici.radio-canada.ca/rss/771'),
|
||||
('Football', 'https://ici.radio-canada.ca/rss/1000057'),
|
||||
('Hockey', 'https://ici.radio-canada.ca/rss/1000056'),
|
||||
('Olympiques', 'https://ici.radio-canada.ca/rss/64852'),
|
||||
('Podium', 'https://ici.radio-canada.ca/rss/555082'),
|
||||
('Soccer', 'https://ici.radio-canada.ca/rss/1000058'),
|
||||
('Tennis', 'https://ici.radio-canada.ca/rss/1000059'),
|
||||
('Grands titres', 'https://ici.radio-canada.ca/rss/771'),
|
||||
('Football', 'https://ici.radio-canada.ca/rss/1000057'),
|
||||
('Hockey', 'https://ici.radio-canada.ca/rss/1000056'),
|
||||
('Olympiques', 'https://ici.radio-canada.ca/rss/64852'),
|
||||
('Podium', 'https://ici.radio-canada.ca/rss/555082'),
|
||||
('Soccer', 'https://ici.radio-canada.ca/rss/1000058'),
|
||||
('Tennis', 'https://ici.radio-canada.ca/rss/1000059'),
|
||||
|
||||
# Arts
|
||||
('Grands Titres', 'https://ici.radio-canada.ca/rss/4167'),
|
||||
('Célébrités', 'https://ici.radio-canada.ca/rss/1000232'),
|
||||
('Cinéma', 'https://ici.radio-canada.ca/rss/1000229'),
|
||||
('Humour', 'https://ici.radio-canada.ca/rss/1000231'),
|
||||
('Livres', 'https://ici.radio-canada.ca/rss/1000083'),
|
||||
('Musique', 'https://ici.radio-canada.ca/rss/1000230'),
|
||||
('Télé', 'https://ici.radio-canada.ca/rss/1000233'),
|
||||
('Grands Titres', 'https://ici.radio-canada.ca/rss/4167'),
|
||||
('Célébrités', 'https://ici.radio-canada.ca/rss/1000232'),
|
||||
('Cinéma', 'https://ici.radio-canada.ca/rss/1000229'),
|
||||
('Humour', 'https://ici.radio-canada.ca/rss/1000231'),
|
||||
('Livres', 'https://ici.radio-canada.ca/rss/1000083'),
|
||||
('Musique', 'https://ici.radio-canada.ca/rss/1000230'),
|
||||
('Télé', 'https://ici.radio-canada.ca/rss/1000233'),
|
||||
|
||||
# Régions
|
||||
('Abitibi-Témiscamingue', 'https://ici.radio-canada.ca/rss/5763'),
|
||||
('Alberta', 'https://ici.radio-canada.ca/rss/5767'),
|
||||
('Bas-Saint-Laurent', 'https://ici.radio-canada.ca/rss/35004'),
|
||||
('Colombie-Brittanique', 'https://ici.radio-canada.ca/rss/5769'),
|
||||
('Côte-Nord', 'https://ici.radio-canada.ca/rss/35019'),
|
||||
('Estrie', 'https://ici.radio-canada.ca/rss/5773'),
|
||||
('Gaspésie-Îles-de-la-Madeleine', 'https://ici.radio-canada.ca/rss/35015'),
|
||||
('Grand Montréal', 'https://ici.radio-canada.ca/rss/4201'),
|
||||
('Grand Nord', 'https://ici.radio-canada.ca/rss/1001049'),
|
||||
('Île-du-Prince-Édouard', 'https://ici.radio-canada.ca/rss/1000814'),
|
||||
('Manitoba', 'https://ici.radio-canada.ca/rss/5775'),
|
||||
('Mauricie–Centre-du-Québec', 'https://ici.radio-canada.ca/rss/5777'),
|
||||
('Nord de l’Ontario', 'https://ici.radio-canada.ca/rss/36518'),
|
||||
('Nouveau-Brunswick', 'https://ici.radio-canada.ca/rss/5765'),
|
||||
('Nouvelle-Écosse', 'https://ici.radio-canada.ca/rss/1000813'),
|
||||
('Ottawa-Gatineau', 'https://ici.radio-canada.ca/rss/6102'),
|
||||
('Québec', 'https://ici.radio-canada.ca/rss/6104'),
|
||||
('Saguenay-Lac-St-Jean', 'https://ici.radio-canada.ca/rss/6106'),
|
||||
('Saskatchewan', 'https://ici.radio-canada.ca/rss/6108'),
|
||||
('Terre-Neuve-et-Labrador', 'https://ici.radio-canada.ca/rss/1000815'),
|
||||
('Toronto', 'https://ici.radio-canada.ca/rss/5779'),
|
||||
('Windsor', 'https://ici.radio-canada.ca/rss/475289'),
|
||||
('Abitibi-Témiscamingue', 'https://ici.radio-canada.ca/rss/5763'),
|
||||
('Alberta', 'https://ici.radio-canada.ca/rss/5767'),
|
||||
('Bas-Saint-Laurent', 'https://ici.radio-canada.ca/rss/35004'),
|
||||
('Colombie-Brittanique', 'https://ici.radio-canada.ca/rss/5769'),
|
||||
('Côte-Nord', 'https://ici.radio-canada.ca/rss/35019'),
|
||||
('Estrie', 'https://ici.radio-canada.ca/rss/5773'),
|
||||
('Gaspésie-Îles-de-la-Madeleine', 'https://ici.radio-canada.ca/rss/35015'),
|
||||
('Grand Montréal', 'https://ici.radio-canada.ca/rss/4201'),
|
||||
('Grand Nord', 'https://ici.radio-canada.ca/rss/1001049'),
|
||||
('Île-du-Prince-Édouard', 'https://ici.radio-canada.ca/rss/1000814'),
|
||||
('Manitoba', 'https://ici.radio-canada.ca/rss/5775'),
|
||||
('Mauricie–Centre-du-Québec', 'https://ici.radio-canada.ca/rss/5777'),
|
||||
('Nord de l’Ontario', 'https://ici.radio-canada.ca/rss/36518'),
|
||||
('Nouveau-Brunswick', 'https://ici.radio-canada.ca/rss/5765'),
|
||||
('Nouvelle-Écosse', 'https://ici.radio-canada.ca/rss/1000813'),
|
||||
('Ottawa-Gatineau', 'https://ici.radio-canada.ca/rss/6102'),
|
||||
('Québec', 'https://ici.radio-canada.ca/rss/6104'),
|
||||
('Saguenay-Lac-St-Jean', 'https://ici.radio-canada.ca/rss/6106'),
|
||||
('Saskatchewan', 'https://ici.radio-canada.ca/rss/6108'),
|
||||
('Terre-Neuve-et-Labrador', 'https://ici.radio-canada.ca/rss/1000815'),
|
||||
('Toronto', 'https://ici.radio-canada.ca/rss/5779'),
|
||||
('Windsor', 'https://ici.radio-canada.ca/rss/475289'),
|
||||
|
||||
# Autres
|
||||
('Archives', 'https://ici.radio-canada.ca/rss/1000548'),
|
||||
('Dossiers', 'https://ici.radio-canada.ca/rss/6735'),
|
||||
('Archives', 'https://ici.radio-canada.ca/rss/1000548'),
|
||||
('Dossiers', 'https://ici.radio-canada.ca/rss/6735'),
|
||||
('Espaces autochtones', 'https://ici.radio-canada.ca/rss/116435'),
|
||||
('RCI', 'http://www.rcinet.ca/fr/feed/rss/')
|
||||
('RCI', 'http://www.rcinet.ca/fr/feed/rss/')
|
||||
]
|
||||
|
||||
# The following was copied and adapted as per the following post:
|
||||
|
@ -10,9 +10,10 @@ import re
|
||||
|
||||
# This imports the version bundled with Calibre
|
||||
import lxml
|
||||
from lxml.builder import E
|
||||
|
||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
from lxml.builder import E
|
||||
|
||||
respekt_url = 'https://www.respekt.cz'
|
||||
|
||||
|
@ -5,7 +5,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class Sobaka(BasicNewsRecipe):
|
||||
title = '\u0421\u043E\u0431\u0430\u043A\u0430.ru'
|
||||
title = '\u0421\u043E\u0431\u0430\u043A\u0430.ru'
|
||||
__author__ = 'bugmen00t'
|
||||
description = '\u0416\u0443\u0440\u043D\u0430\u043B \u043E \u043B\u044E\u0434\u044F\u0445 \u0432 \u041F\u0435\u0442\u0435\u0440\u0431\u0443\u0440\u0433\u0435' # noqa
|
||||
publisher = '\u041E\u041E\u041E \u00AB\u0416\u0443\u0440\u043D\u0430\u043B\u044B \u0438 \u0441\u0430\u0439\u0442\u044B "\u0424\u0430\u0431\u0440\u0438\u043A\u0430 \u043A\u043E\u043D\u0442\u0435\u043D\u0442\u0430 "\u0422\u043E\u0447\u043A\u0430 \u0420\u0443"\u00BB' # noqa
|
||||
|
@ -40,7 +40,7 @@ class spectator(BasicNewsRecipe):
|
||||
dict(name = ['svg', 'button']),
|
||||
classes(
|
||||
'entry-meta audio-read-block insert--most-popular ad-slot ad-slot--in-content ad-content '
|
||||
'subscription-banner '
|
||||
'subscription-banner '
|
||||
)
|
||||
]
|
||||
|
||||
@ -48,7 +48,7 @@ class spectator(BasicNewsRecipe):
|
||||
for fc in soup.findAll('figcaption'):
|
||||
fc['id'] = 'fig-c'
|
||||
return soup
|
||||
|
||||
|
||||
def get_browser(self, *args, **kwargs):
|
||||
kwargs['user_agent'] = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'
|
||||
br = BasicNewsRecipe.get_browser(self, *args, **kwargs)
|
||||
|
@ -19,10 +19,10 @@ class Spiegel_DE_all(BasicNewsRecipe):
|
||||
title = u'Spiegel Online RSS - German alle Themen'
|
||||
# Author
|
||||
__author__ = u'Volker Heggemann, VoHe'
|
||||
# oldest article to download (in days) ---- can be edit by user
|
||||
# oldest article to download (in days) ---- can be edit by user
|
||||
# be careful, if there is a lot of news, the file size exceeds!
|
||||
oldest_article = 7
|
||||
# describes itself, ---- can be edit by user
|
||||
# describes itself, ---- can be edit by user
|
||||
max_articles_per_feed = 100
|
||||
# speed up the download on fast computers be careful (I test max.20)
|
||||
# ---- can be edit by user
|
||||
@ -40,11 +40,11 @@ class Spiegel_DE_all(BasicNewsRecipe):
|
||||
cover_url = 'https://de.m.wikipedia.org/wiki/Datei:Spiegel_Online_logo.svg'
|
||||
# What is the content of?
|
||||
category = 'SPIEGEL ONLINE RSS'
|
||||
# describes itself, ---- can be edit by user
|
||||
# describes itself, ---- can be edit by user
|
||||
language = 'de'
|
||||
lang = 'de-DE'
|
||||
no_stylesheets = True
|
||||
# describes itself, ---- can be edit by user
|
||||
# describes itself, ---- can be edit by user
|
||||
use_embedded_content = False
|
||||
# encoding of content. e.g. utf-8, None, ...
|
||||
# ---- can be edit by user
|
||||
@ -57,7 +57,7 @@ class Spiegel_DE_all(BasicNewsRecipe):
|
||||
# remove the rubbish (in ebook)
|
||||
auto_cleanup = True
|
||||
# now the content description and URL follows
|
||||
# feel free to add, wipe out what you need ---- can be edit by user
|
||||
# feel free to add, wipe out what you need ---- can be edit by user
|
||||
#
|
||||
# Make some tests, may you first comment all of them out, and step by step you add what you'll need?
|
||||
#
|
||||
|
@ -66,4 +66,4 @@ class StLouisPostDispatch(BasicNewsRecipe):
|
||||
(u'Opinion - Editorial', u'http://www.stltoday.com/search/?c=opinion%2feditorial&d1=&d2=&s=start_time&sd=desc&f=rss&l=25&t=article'),
|
||||
(u'Opinion - Letters to the Editor', u'https://www.stltoday.com/search/?c=opinion%2Fletters&d1=&d2=&s=start_time&sd=desc&f=rss&l=25&t=article'),
|
||||
(u'Opinion - Local Columns', u'https://www.stltoday.com/search/?c=opinion%2fcolumn*&d1=&d2=&s=start_time&sd=desc&nfl=ap&nk=%23noshow,dcc&f=rss&l=25&t=article')
|
||||
]
|
||||
]
|
||||
|
@ -46,7 +46,7 @@ class StraitsTimes(BasicNewsRecipe):
|
||||
,(u'Opinion' , u'https://www.straitstimes.com/news/opinion/rss.xml')
|
||||
,(u'Life' , u'https://www.straitstimes.com/news/life/rss.xml')
|
||||
,(u'Singapore' , u'https://www.straitstimes.com/news/singapore/rss.xml')
|
||||
,(u'Asia' , u'https://www.straitstimes.com/news/asia/rss.xml')
|
||||
,(u'Asia' , u'https://www.straitstimes.com/news/asia/rss.xml')
|
||||
,(u'Multimedia' , u'https://www.straitstimes.com/news/multimedia/rss.xml')
|
||||
,(u'Sport' , u'https://www.straitstimes.com/news/sport/rss.xml')
|
||||
]
|
||||
|
@ -22,7 +22,7 @@ class germant3n(BasicNewsRecipe):
|
||||
# remove the rubbish (in ebook)
|
||||
auto_cleanup = True
|
||||
# now the content description and URL follows
|
||||
# feel free to add, wipe out what you need ---- can be edit by user
|
||||
# feel free to add, wipe out what you need ---- can be edit by user
|
||||
#
|
||||
# some of this are double
|
||||
#
|
||||
|
@ -7,7 +7,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class TInvariant(BasicNewsRecipe):
|
||||
title = 'T-Invariant'
|
||||
title = 'T-Invariant'
|
||||
__author__ = 'bugmen00t'
|
||||
description = 'T-Invariant is a multimedia project of scientists and science journalists. Our task is to be a bridge between the academic community in Russia and outside Russia. Let’s keep in touch!' # noqa
|
||||
publisher = '\u0422-\u0438\u043D\u0432\u0430\u0440\u0438\u0430\u043D\u0442 / T-invariant'
|
||||
|
@ -7,7 +7,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class TInvariant(BasicNewsRecipe):
|
||||
title = 'T-Invariant'
|
||||
title = 'T-Invariant'
|
||||
__author__ = 'bugmen00t'
|
||||
description = '\u041C\u0443\u043B\u044C\u0442\u0438\u043C\u0435\u0434\u0438\u0439\u043D\u044B\u0439 \u043F\u0440\u043E\u0435\u043A\u0442 \u0443\u0447\u0435\u043D\u044B\u0445 \u0438 \u043D\u0430\u0443\u0447\u043D\u044B\u0445 \u0436\u0443\u0440\u043D\u0430\u043B\u0438\u0441\u0442\u043E\u0432.' # noqa
|
||||
publisher = '\u0422-\u0438\u043D\u0432\u0430\u0440\u0438\u0430\u043D\u0442 / T-invariant'
|
||||
|
@ -7,7 +7,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class TInvariant(BasicNewsRecipe):
|
||||
title = 'T-Invariant'
|
||||
title = 'T-Invariant'
|
||||
__author__ = 'bugmen00t'
|
||||
description = 'T-Invariant is a multimedia project of scientists and science journalists. Our task is to be a bridge between the academic community in Russia and outside Russia. Let’s keep in touch!' # noqa
|
||||
publisher = '\u0422-\u0438\u043D\u0432\u0430\u0440\u0438\u0430\u043D\u0442 / T-invariant'
|
||||
|
@ -48,7 +48,7 @@ class TagesspiegelRss(BasicNewsRecipe):
|
||||
from datetime import date
|
||||
cover = 'https://img.kiosko.net/' + date.today().strftime('%Y/%m/%d') + '/de/tagesspiegel.750.jpg'
|
||||
return cover
|
||||
|
||||
|
||||
keep_only_tags = [
|
||||
dict(name = 'header', attrs={'class':'Bo'}),
|
||||
dict(name = 'div', attrs={'id':'story-elements'})
|
||||
|
@ -51,73 +51,73 @@ class PhilippineDailyInquirer(BasicNewsRecipe):
|
||||
|
||||
feeds = [
|
||||
|
||||
('Headlines' , 'http://newsinfo.inquirer.net/category/inquirer-headlines/feed'),
|
||||
('Latest Stories' , 'http://newsinfo.inquirer.net/category/latest-stories/feed'),
|
||||
('Nation' , 'http://newsinfo.inquirer.net/category/nation/feed'),
|
||||
('Nation - Latest Stories' , 'http://newsinfo.inquirer.net/category/latest-stories/nation-latest-stories/feed'),
|
||||
('Metro' , 'http://newsinfo.inquirer.net/category/metro/feed'),
|
||||
('Metro - Latest Stories' , 'http://newsinfo.inquirer.net/category/latest-stories/metro-latest-stories/feed'),
|
||||
('Regions' , 'http://newsinfo.inquirer.net/category/regions/feed'),
|
||||
('Regions - Latest Stories' , 'http://newsinfo.inquirer.net/category/latest-stories/regions-latest-stories/feed'),
|
||||
('News' , 'http://www.inquirer.net/fullfeed'),
|
||||
('More News' , 'http://newsinfo.inquirer.net/feed')
|
||||
('Headlines', 'http://newsinfo.inquirer.net/category/inquirer-headlines/feed'),
|
||||
('Latest Stories' , 'http://newsinfo.inquirer.net/category/latest-stories/feed'),
|
||||
('Nation' , 'http://newsinfo.inquirer.net/category/nation/feed'),
|
||||
('Nation - Latest Stories' , 'http://newsinfo.inquirer.net/category/latest-stories/nation-latest-stories/feed'),
|
||||
('Metro' , 'http://newsinfo.inquirer.net/category/metro/feed'),
|
||||
('Metro - Latest Stories' , 'http://newsinfo.inquirer.net/category/latest-stories/metro-latest-stories/feed'),
|
||||
('Regions' , 'http://newsinfo.inquirer.net/category/regions/feed'),
|
||||
('Regions - Latest Stories' , 'http://newsinfo.inquirer.net/category/latest-stories/regions-latest-stories/feed'),
|
||||
('News' , 'http://www.inquirer.net/fullfeed'),
|
||||
('More News' , 'http://newsinfo.inquirer.net/feed')
|
||||
,
|
||||
('Global Nation' , 'http://globalnation.inquirer.net/feed'),
|
||||
('Global Nation' , 'http://globalnation.inquirer.net/feed'),
|
||||
('Global Nation - Latest Stories', 'http://globalnation.inquirer.net/category/latest-stories/feed'),
|
||||
('Global Nation - Philippines', 'http://globalnation.inquirer.net/category/news/philippines/feed'),
|
||||
('Global Nation - Asia & Pacific', 'http://globalnation.inquirer.net/category/news/asiaaustralia/feed'),
|
||||
('Global Nation - Americas', 'http://globalnation.inquirer.net/category/news/uscanada/feed'),
|
||||
('Global Nation - Middle East & Africa', 'http://globalnation.inquirer.net/category/news/middle-eastafrica/feed'),
|
||||
('Global Nation - Europe' , 'http://globalnation.inquirer.net/category/news/europe/feed'),
|
||||
('Global Nation - Europe' , 'http://globalnation.inquirer.net/category/news/europe/feed'),
|
||||
('Global Nation - Global Pinoy', 'http://globalnation.inquirer.net/category/global-pinoy/feed'),
|
||||
('Global Nation - Events' , 'http://globalnation.inquirer.net/category/events/feed'),
|
||||
('Business' , 'http://business.inquirer.net/feed'),
|
||||
('Business - Latest Stories' , 'http://business.inquirer.net/category/latest-stories/feed'),
|
||||
('Business - Money' , 'http://business.inquirer.net/category/money/feed'),
|
||||
('Global Nation - Events' , 'http://globalnation.inquirer.net/category/events/feed'),
|
||||
('Business' , 'http://business.inquirer.net/feed'),
|
||||
('Business - Latest Stories' , 'http://business.inquirer.net/category/latest-stories/feed'),
|
||||
('Business - Money' , 'http://business.inquirer.net/category/money/feed'),
|
||||
('Business - Science & Health', 'http://business.inquirer.net/category/science-and-health/feed'),
|
||||
('Business - Motoring' , 'http://business.inquirer.net/category/motoring/feed'),
|
||||
('Business - Property Guide' , 'http://business.inquirer.net/category/property-guide/feed'),
|
||||
('Business - Columnists' , 'http://business.inquirer.net/category/columnists/feed'),
|
||||
('Sports' , 'http://sports.inquirer.net/feed'),
|
||||
('Sports - Latest Stories' , 'http://sports.inquirer.net/category/latest-stories/feed'),
|
||||
('Sports - Basketball' , 'http://sports.inquirer.net/category/section/basketball/feed'),
|
||||
('Business - Motoring' , 'http://business.inquirer.net/category/motoring/feed'),
|
||||
('Business - Property Guide' , 'http://business.inquirer.net/category/property-guide/feed'),
|
||||
('Business - Columnists' , 'http://business.inquirer.net/category/columnists/feed'),
|
||||
('Sports' , 'http://sports.inquirer.net/feed'),
|
||||
('Sports - Latest Stories' , 'http://sports.inquirer.net/category/latest-stories/feed'),
|
||||
('Sports - Basketball' , 'http://sports.inquirer.net/category/section/basketball/feed'),
|
||||
('Sports - Boxing & MMA', 'http://sports.inquirer.net/category/section/boxing-mma/feed'),
|
||||
('Sports - Golf' , 'http://sports.inquirer.net/category/section/golf/feed'),
|
||||
('Sports - Football' , 'http://sports.inquirer.net/category/section/other-sports/football/feed'),
|
||||
('Sports - Other Sports' , 'http://sports.inquirer.net/category/section/other-sports/feed'),
|
||||
('Technology' , 'http://technology.inquirer.net/feed'),
|
||||
('Sports - Golf' , 'http://sports.inquirer.net/category/section/golf/feed'),
|
||||
('Sports - Football' , 'http://sports.inquirer.net/category/section/other-sports/football/feed'),
|
||||
('Sports - Other Sports' , 'http://sports.inquirer.net/category/section/other-sports/feed'),
|
||||
('Technology' , 'http://technology.inquirer.net/feed'),
|
||||
('Technology Latest Stories', 'http://technology.inquirer.net/category/latest-stories/feed'),
|
||||
('Entertainment' , 'http://entertainment.inquirer.net/feed'),
|
||||
('Entertainment' , 'http://entertainment.inquirer.net/feed'),
|
||||
('Entertainment - Headlines', 'http://entertainment.inquirer.net/category/headlines/feed'),
|
||||
('Entertainment - Latest Stories', 'http://entertainment.inquirer.net/category/latest-stories/feed'),
|
||||
('Entertainment - Movies' , 'http://movies.inquirer.net/feed'),
|
||||
('Lifestyle' , 'http://lifestyle.inquirer.net/feed'),
|
||||
('Entertainment - Movies' , 'http://movies.inquirer.net/feed'),
|
||||
('Lifestyle' , 'http://lifestyle.inquirer.net/feed'),
|
||||
('Lifestyle - Latest Stories', 'http://lifestyle.inquirer.net/category/latest-stories/feed'),
|
||||
('Lifestyle - Arts & Books' , 'http://lifestyle.inquirer.net/category/arts-and-books/feed'),
|
||||
('Lifestyle - Wellness' , 'http://lifestyle.inquirer.net/category/wellness/feed'),
|
||||
('Lifestyle - Arts & Books' , 'http://lifestyle.inquirer.net/category/arts-and-books/feed'),
|
||||
('Lifestyle - Wellness' , 'http://lifestyle.inquirer.net/category/wellness/feed'),
|
||||
('Lifestyle - Home & Entertaining', 'http://lifestyle.inquirer.net/category/home-and-entertaining/feed'),
|
||||
('Lifestyle - Parenting' , 'http://lifestyle.inquirer.net/category/parenting/feed'),
|
||||
('Lifestyle - Food' , 'http://lifestyle.inquirer.net/category/food/feed'),
|
||||
('Lifestyle - Parenting' , 'http://lifestyle.inquirer.net/category/parenting/feed'),
|
||||
('Lifestyle - Food' , 'http://lifestyle.inquirer.net/category/food/feed'),
|
||||
('Lifestyle - Fashion & Beauty', 'http://lifestyle.inquirer.net/category/fashion-and-beauty/feed'),
|
||||
('Lifestyle - Super' , 'http://lifestyle.inquirer.net/category/super/feed'),
|
||||
('Lifestyle - 2BU' , 'http://lifestyle.inquirer.net/category/2bu/feed'),
|
||||
('Lifestyle - Super' , 'http://lifestyle.inquirer.net/category/super/feed'),
|
||||
('Lifestyle - 2BU' , 'http://lifestyle.inquirer.net/category/2bu/feed'),
|
||||
('Lifestyle - Sunday Lifestyle', 'http://lifestyle.inquirer.net/category/sunday-lifestyle/feed'),
|
||||
('Lifestyle - Wedding' , 'http://lifestyle.inquirer.net/category/sunday-lifestyle/wedding/feed'),
|
||||
('Lifestyle - Travel' , 'http://lifestyle.inquirer.net/category/sunday-lifestyle/travel/feed'),
|
||||
('Lifestyle - Relationship' , 'http://lifestyle.inquirer.net/category/sunday-lifestyle/relationship/feed'),
|
||||
('Opinion' , 'http://opinion.inquirer.net/feed'),
|
||||
('Opinion - Viewpoints' , 'http://opinion.inquirer.net/category/viewpoints/feed'),
|
||||
('Lifestyle - Wedding' , 'http://lifestyle.inquirer.net/category/sunday-lifestyle/wedding/feed'),
|
||||
('Lifestyle - Travel' , 'http://lifestyle.inquirer.net/category/sunday-lifestyle/travel/feed'),
|
||||
('Lifestyle - Relationship' , 'http://lifestyle.inquirer.net/category/sunday-lifestyle/relationship/feed'),
|
||||
('Opinion' , 'http://opinion.inquirer.net/feed'),
|
||||
('Opinion - Viewpoints' , 'http://opinion.inquirer.net/category/viewpoints/feed'),
|
||||
('Opinion - Talk of the Town', 'http://opinion.inquirer.net/category/inquirer-opinion/talk-of-the-town/feed'),
|
||||
('Editorial' , 'http://opinion.inquirer.net/category/editorial/feed'),
|
||||
('Letters to the Editor' , 'http://opinion.inquirer.net/category/letters-to-the-editor/feed'),
|
||||
('Columns' , 'http://opinion.inquirer.net/category/columns/feed'),
|
||||
('Citizens Journalism' , 'http://newsinfo.inquirer.net/category/citizens-journalism/feed'),
|
||||
('Cebu - Daily News' , 'http://newsinfo.inquirer.net/category/cdn/feed'),
|
||||
('Cebu - More News' , 'http://newsinfo.inquirer.net/category/cdn/cdn-news/feed'),
|
||||
('Cebu - Community' , 'http://newsinfo.inquirer.net/category/cdn/cdn-community/feed'),
|
||||
('Cebu - Metro' , 'http://newsinfo.inquirer.net/category/cdn/cdn-metro/feed'),
|
||||
('Cebu - Business' , 'http://newsinfo.inquirer.net/category/cdn/cdn-enterprise/feed'),
|
||||
('Cebu - Sports' , 'http://newsinfo.inquirer.net/category/cdn/cdn-sports/feed'),
|
||||
('Cebu - Visayas' , 'http://newsinfo.inquirer.net/category/cdn/cdn-visayas/feed'),
|
||||
('Cebu - Opinion' , 'http://newsinfo.inquirer.net/category/cdn/cdn-opinion/feed')
|
||||
('Editorial' , 'http://opinion.inquirer.net/category/editorial/feed'),
|
||||
('Letters to the Editor' , 'http://opinion.inquirer.net/category/letters-to-the-editor/feed'),
|
||||
('Columns' , 'http://opinion.inquirer.net/category/columns/feed'),
|
||||
('Citizens Journalism' , 'http://newsinfo.inquirer.net/category/citizens-journalism/feed'),
|
||||
('Cebu - Daily News' , 'http://newsinfo.inquirer.net/category/cdn/feed'),
|
||||
('Cebu - More News' , 'http://newsinfo.inquirer.net/category/cdn/cdn-news/feed'),
|
||||
('Cebu - Community' , 'http://newsinfo.inquirer.net/category/cdn/cdn-community/feed'),
|
||||
('Cebu - Metro' , 'http://newsinfo.inquirer.net/category/cdn/cdn-metro/feed'),
|
||||
('Cebu - Business' , 'http://newsinfo.inquirer.net/category/cdn/cdn-enterprise/feed'),
|
||||
('Cebu - Sports' , 'http://newsinfo.inquirer.net/category/cdn/cdn-sports/feed'),
|
||||
('Cebu - Visayas' , 'http://newsinfo.inquirer.net/category/cdn/cdn-visayas/feed'),
|
||||
('Cebu - Opinion' , 'http://newsinfo.inquirer.net/category/cdn/cdn-opinion/feed')
|
||||
]
|
||||
|
@ -15,10 +15,11 @@ except ImportError:
|
||||
from urllib import urlencode
|
||||
import re
|
||||
|
||||
from mechanize import Request
|
||||
|
||||
from calibre import strftime
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from mechanize import Request
|
||||
|
||||
|
||||
class TheNewCriterion(BasicNewsRecipe):
|
||||
|
@ -69,7 +69,7 @@ class PrivateEyeRecipe(BasicNewsRecipe):
|
||||
article['author'] = author
|
||||
return article
|
||||
|
||||
edition_re = re.compile('(?:-front-cover-)(\d+)-')
|
||||
edition_re = re.compile(r'(?:-front-cover-)(\d+)-')
|
||||
|
||||
# Identify the cover image and extract the edition# from the url
|
||||
def get_cover_url(self):
|
||||
@ -242,8 +242,8 @@ class PrivateEyeRecipe(BasicNewsRecipe):
|
||||
{'name': 'a', 'class': "view-full-screen"},
|
||||
{'name': 'div', 'class': "image-counter"},
|
||||
{'name': 'h2', 'string': "Find out more about The Oldie"},
|
||||
{'name': 'a', 'href': re.compile("^https?:\/\/issuu.com\/")},
|
||||
{'name': 'img', 'src': re.compile("\/assets\/images\/icons\/icon-")},
|
||||
{'name': 'a', 'href': re.compile(r"^https?:\/\/issuu.com\/")},
|
||||
{'name': 'img', 'src': re.compile(r"\/assets\/images\/icons\/icon-")},
|
||||
]
|
||||
|
||||
# The following extra css is to tweak the formatting of various elements of various article pages.
|
||||
|
@ -16,7 +16,7 @@ def re_html(y):
|
||||
|
||||
def get_id(url):
|
||||
rq = browser().open(url)
|
||||
return re.search('\?p=(\S+)>', str(rq.info())).group(1)
|
||||
return re.search(r'\?p=(\S+)>', str(rq.info())).group(1)
|
||||
|
||||
|
||||
class TLS(BasicNewsRecipe):
|
||||
|
@ -29,9 +29,8 @@ class Ugeskriftet(BasicNewsRecipe):
|
||||
h2{font-weight: bold; font-size: large;}
|
||||
h3{font-weight: bold; font-size: large;}
|
||||
h4{font-weight: bold; font-size: large;}
|
||||
"""
|
||||
"""
|
||||
|
||||
feeds = [
|
||||
('Ugeskriftet for læger', 'https://ugeskriftet.dk/rss/forside'),
|
||||
]
|
||||
|
@ -5,7 +5,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class UkrInform(BasicNewsRecipe):
|
||||
title = 'UkrInform (Espa\u00F1ol)'
|
||||
title = 'UkrInform (Espa\u00F1ol)'
|
||||
__author__ = 'bugmen00t'
|
||||
description = 'Agencia de noticias nacional de Ucrania, fuente de informaci\u00F3n sobre la vida pol\u00EDtica, econ\u00F3mica, social, cient\u00EDfica, cultural y p\u00FAblica en Ucrania y en el extranjero.' # noqa
|
||||
publisher = 'Ministerio de Cultura y Pol\u00EDtica de Informaci\u00F3n de Ucrania'
|
||||
|
@ -69,7 +69,7 @@ class USAToday(BasicNewsRecipe):
|
||||
def parse_index(self):
|
||||
index = 'https://www.usatoday.com/'
|
||||
sections = [
|
||||
'news', 'opinion', 'tech', 'entertainment', 'money', 'sports', 'travel', 'life', 'investigations',
|
||||
'news', 'opinion', 'tech', 'entertainment', 'money', 'sports', 'travel', 'life', 'investigations',
|
||||
]
|
||||
feeds = []
|
||||
soup = self.index_to_soup(index)
|
||||
@ -87,7 +87,6 @@ class USAToday(BasicNewsRecipe):
|
||||
if articles:
|
||||
feeds.append((section, articles))
|
||||
return feeds
|
||||
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for img in soup.findAll('img', src=True):
|
||||
|
@ -3,9 +3,10 @@ import json
|
||||
import uuid
|
||||
from contextlib import closing
|
||||
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
from mechanize import Request
|
||||
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
|
||||
|
||||
class Volkskrant(BasicNewsRecipe):
|
||||
title = 'Volkskrant'
|
||||
|
@ -7,7 +7,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class WiComix(BasicNewsRecipe):
|
||||
title = 'Wicomix'
|
||||
title = 'Wicomix'
|
||||
__author__ = 'bugmen00t'
|
||||
description = '\u0418\u043D\u0442\u0435\u0440\u0435\u0441\u043D\u043E \u043F\u0438\u0448\u0435\u043C \u043F\u0440\u043E \u043A\u043E\u043C\u0438\u043A\u0441\u044B \u0438 \u043C\u0430\u043D\u0433\u0443 \u0432 \u0420\u043E\u0441\u0441\u0438\u0438.' # noqa
|
||||
publisher = '\u0421\u0435\u0440\u0433\u0435\u0439 \u041E\u0440\u0435\u0448\u043A\u0438\u043D'
|
||||
|
@ -10,11 +10,12 @@ import time
|
||||
from base64 import standard_b64encode
|
||||
from datetime import date, timedelta
|
||||
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from css_selectors import Select
|
||||
from mechanize import Request
|
||||
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
try:
|
||||
import urllib.parse as urlparse
|
||||
except ImportError:
|
||||
|
@ -216,14 +216,14 @@ save_template_title_series_sorting = 'library_order'
|
||||
# (present only for legacy reasons).
|
||||
per_language_title_sort_articles = {
|
||||
# English
|
||||
'eng' : (r'A\s+', r'The\s+', r'An\s+'),
|
||||
'eng': (r'A\s+', r'The\s+', r'An\s+'),
|
||||
# Esperanto
|
||||
'epo': (r'La\s+', r"L'", 'L´'),
|
||||
# Spanish
|
||||
'spa' : (r'El\s+', r'La\s+', r'Lo\s+', r'Los\s+', r'Las\s+', r'Un\s+',
|
||||
'spa': (r'El\s+', r'La\s+', r'Lo\s+', r'Los\s+', r'Las\s+', r'Un\s+',
|
||||
r'Una\s+', r'Unos\s+', r'Unas\s+'),
|
||||
# French
|
||||
'fra' : (r'Le\s+', r'La\s+', r"L'", u'L´', u'L’', r'Les\s+', r'Un\s+', r'Une\s+',
|
||||
'fra': (r'Le\s+', r'La\s+', r"L'", r'L´', r'L’', r'Les\s+', r'Un\s+', r'Une\s+',
|
||||
r'Des\s+', r'De\s+La\s+', r'De\s+', r"D'", r'D´', r'D’'),
|
||||
# Polish
|
||||
'pol': (),
|
||||
@ -233,32 +233,32 @@ per_language_title_sort_articles = {
|
||||
'Un´', 'Dei\\s+', 'Degli\\s+', 'Delle\\s+', 'Del\\s+',
|
||||
'Della\\s+', 'Dello\\s+', "Dell'", 'Dell´'),
|
||||
# Portuguese
|
||||
'por' : (r'A\s+', r'O\s+', r'Os\s+', r'As\s+', r'Um\s+', r'Uns\s+',
|
||||
'por': (r'A\s+', r'O\s+', r'Os\s+', r'As\s+', r'Um\s+', r'Uns\s+',
|
||||
r'Uma\s+', r'Umas\s+', ),
|
||||
# Romanian
|
||||
'ron' : (r'Un\s+', r'O\s+', r'Nişte\s+', ),
|
||||
'ron': (r'Un\s+', r'O\s+', r'Nişte\s+', ),
|
||||
# German
|
||||
'deu' : (r'Der\s+', r'Die\s+', r'Das\s+', r'Den\s+', r'Ein\s+',
|
||||
'deu': (r'Der\s+', r'Die\s+', r'Das\s+', r'Den\s+', r'Ein\s+',
|
||||
r'Eine\s+', r'Einen\s+', r'Dem\s+', r'Des\s+', r'Einem\s+',
|
||||
r'Eines\s+'),
|
||||
# Dutch
|
||||
'nld' : (r'De\s+', r'Het\s+', r'Een\s+', r"'n\s+", r"'s\s+", r'Ene\s+',
|
||||
'nld': (r'De\s+', r'Het\s+', r'Een\s+', r"'n\s+", r"'s\s+", r'Ene\s+',
|
||||
r'Ener\s+', r'Enes\s+', r'Den\s+', r'Der\s+', r'Des\s+',
|
||||
r"'t\s+"),
|
||||
# Swedish
|
||||
'swe' : (r'En\s+', r'Ett\s+', r'Det\s+', r'Den\s+', r'De\s+', ),
|
||||
'swe': (r'En\s+', r'Ett\s+', r'Det\s+', r'Den\s+', r'De\s+', ),
|
||||
# Turkish
|
||||
'tur' : (r'Bir\s+', ),
|
||||
'tur': (r'Bir\s+', ),
|
||||
# Afrikaans
|
||||
'afr' : (r"'n\s+", r'Die\s+', ),
|
||||
'afr': (r"'n\s+", r'Die\s+', ),
|
||||
# Greek
|
||||
'ell' : (r'O\s+', r'I\s+', r'To\s+', r'Ta\s+', r'Tus\s+', r'Tis\s+',
|
||||
'ell': (r'O\s+', r'I\s+', r'To\s+', r'Ta\s+', r'Tus\s+', r'Tis\s+',
|
||||
r"'Enas\s+", r"'Mia\s+", r"'Ena\s+", r"'Enan\s+", ),
|
||||
# Hungarian
|
||||
'hun' : (r'A\s+', r'Az\s+', r'Egy\s+',),
|
||||
'hun': (r'A\s+', r'Az\s+', r'Egy\s+',),
|
||||
}
|
||||
default_language_for_title_sort = None
|
||||
title_sort_articles=r'^(A|The|An)\s+'
|
||||
title_sort_articles = r'^(A|The|An)\s+'
|
||||
|
||||
#: Specify a folder calibre should connect to at startup
|
||||
# Specify a folder that calibre should connect to at startup using
|
||||
@ -331,8 +331,8 @@ auto_connect_to_folder = ''
|
||||
# The resulting two tweaks are:
|
||||
# sony_collection_renaming_rules={'series':'Series', 'tags':'Tag'}
|
||||
# sony_collection_name_template='{category:||: }{value}'
|
||||
sony_collection_renaming_rules={}
|
||||
sony_collection_name_template='{value}{category:| (|)}'
|
||||
sony_collection_renaming_rules = {}
|
||||
sony_collection_name_template = '{value}{category:| (|)}'
|
||||
|
||||
#: Specify how SONY collections are sorted
|
||||
# Specify how SONY collections are sorted. This tweak is only applicable if
|
||||
@ -402,7 +402,7 @@ vertical_scrolling_per_row = False
|
||||
# Default: locale_for_sorting = '' -- use the language calibre displays in
|
||||
# Example: locale_for_sorting = 'fr' -- sort using French rules.
|
||||
# Example: locale_for_sorting = 'nb' -- sort using Norwegian rules.
|
||||
locale_for_sorting = ''
|
||||
locale_for_sorting = ''
|
||||
|
||||
#: The number of seconds to wait before sending emails
|
||||
# The number of seconds to wait before sending emails when using a
|
||||
|
@ -41,6 +41,10 @@ class Check(Command):
|
||||
|
||||
CACHE = 'check.json'
|
||||
|
||||
def add_options(self, parser):
|
||||
parser.add_option('--fix', '--auto-fix', default=False, action='store_true',
|
||||
help='Try to automatically fix some of the smallest errors')
|
||||
|
||||
def get_files(self):
|
||||
yield from checkable_python_files(self.SRC)
|
||||
|
||||
@ -91,6 +95,10 @@ class Check(Command):
|
||||
p = subprocess.Popen(['python', self.j(self.wn_path, 'whats_new.py'), f])
|
||||
return p.wait() != 0
|
||||
|
||||
def perform_auto_fix(self):
|
||||
p = subprocess.Popen(['ruff', 'check', '--fix-only'], text=True, stdout=subprocess.PIPE)
|
||||
return p.stdout.read()
|
||||
|
||||
def run(self, opts):
|
||||
self.fhash_cache = {}
|
||||
cache = {}
|
||||
@ -102,13 +110,20 @@ class Check(Command):
|
||||
except OSError as err:
|
||||
if err.errno != errno.ENOENT:
|
||||
raise
|
||||
if opts.fix:
|
||||
self.info('\tAuto-fixing')
|
||||
msg = self.perform_auto_fix()
|
||||
self.info(msg)
|
||||
dirty_files = tuple(f for f in self.get_files() if not self.is_cache_valid(f, cache))
|
||||
try:
|
||||
for i, f in enumerate(dirty_files):
|
||||
self.info('\tChecking', f)
|
||||
if self.file_has_errors(f):
|
||||
self.info('%d files left to check' % (len(dirty_files) - i - 1))
|
||||
edit_file(f)
|
||||
try:
|
||||
edit_file(f)
|
||||
except FileNotFoundError:
|
||||
pass # continue if the configured editor fail to be open
|
||||
if self.file_has_errors(f):
|
||||
raise SystemExit(1)
|
||||
cache[f] = self.file_hash(f)
|
||||
|
@ -10,49 +10,49 @@ from calibre.devices.usbms.driver import USBMS
|
||||
|
||||
|
||||
class BOEYE_BEX(USBMS):
|
||||
name = 'BOEYE BEX reader driver'
|
||||
gui_name = 'BOEYE BEX'
|
||||
description = _('Communicate with BOEYE BEX Serial e-book readers.')
|
||||
author = 'szboeye'
|
||||
name = 'BOEYE BEX reader driver'
|
||||
gui_name = 'BOEYE BEX'
|
||||
description = _('Communicate with BOEYE BEX Serial e-book readers.')
|
||||
author = 'szboeye'
|
||||
supported_platforms = ['windows', 'osx', 'linux']
|
||||
|
||||
FORMATS = ['epub', 'mobi', 'fb2', 'lit', 'prc', 'pdf', 'rtf', 'txt', 'djvu', 'doc', 'chm', 'html', 'zip', 'pdb']
|
||||
FORMATS = ['epub', 'mobi', 'fb2', 'lit', 'prc', 'pdf', 'rtf', 'txt', 'djvu', 'doc', 'chm', 'html', 'zip', 'pdb']
|
||||
|
||||
VENDOR_ID = [0x0085]
|
||||
PRODUCT_ID = [0x600]
|
||||
VENDOR_ID = [0x0085]
|
||||
PRODUCT_ID = [0x600]
|
||||
|
||||
VENDOR_NAME = 'LINUX'
|
||||
VENDOR_NAME = 'LINUX'
|
||||
WINDOWS_MAIN_MEM = 'FILE-STOR_GADGET'
|
||||
OSX_MAIN_MEM = 'Linux File-Stor Gadget Media'
|
||||
OSX_MAIN_MEM = 'Linux File-Stor Gadget Media'
|
||||
|
||||
MAIN_MEMORY_VOLUME_LABEL = 'BOEYE BEX Storage Card'
|
||||
|
||||
EBOOK_DIR_MAIN = 'Documents'
|
||||
EBOOK_DIR_MAIN = 'Documents'
|
||||
SUPPORTS_SUB_DIRS = True
|
||||
|
||||
|
||||
class BOEYE_BDX(USBMS):
|
||||
name = 'BOEYE BDX reader driver'
|
||||
gui_name = 'BOEYE BDX'
|
||||
description = _('Communicate with BOEYE BDX serial e-book readers.')
|
||||
author = 'szboeye'
|
||||
name = 'BOEYE BDX reader driver'
|
||||
gui_name = 'BOEYE BDX'
|
||||
description = _('Communicate with BOEYE BDX serial e-book readers.')
|
||||
author = 'szboeye'
|
||||
supported_platforms = ['windows', 'osx', 'linux']
|
||||
|
||||
FORMATS = ['epub', 'mobi', 'fb2', 'lit', 'prc', 'pdf', 'rtf', 'txt', 'djvu', 'doc', 'chm', 'html', 'zip', 'pdb']
|
||||
FORMATS = ['epub', 'mobi', 'fb2', 'lit', 'prc', 'pdf', 'rtf', 'txt', 'djvu', 'doc', 'chm', 'html', 'zip', 'pdb']
|
||||
|
||||
VENDOR_ID = [0x0085]
|
||||
PRODUCT_ID = [0x800]
|
||||
VENDOR_ID = [0x0085]
|
||||
PRODUCT_ID = [0x800]
|
||||
|
||||
VENDOR_NAME = 'LINUX'
|
||||
VENDOR_NAME = 'LINUX'
|
||||
WINDOWS_MAIN_MEM = 'FILE-STOR_GADGET'
|
||||
WINDOWS_CARD_A_MEM = 'FILE-STOR_GADGET'
|
||||
|
||||
OSX_MAIN_MEM = 'Linux File-Stor Gadget Media'
|
||||
OSX_CARD_A_MEM = 'Linux File-Stor Gadget Media'
|
||||
OSX_MAIN_MEM = 'Linux File-Stor Gadget Media'
|
||||
OSX_CARD_A_MEM = 'Linux File-Stor Gadget Media'
|
||||
|
||||
MAIN_MEMORY_VOLUME_LABEL = 'BOEYE BDX Internal Memory'
|
||||
STORAGE_CARD_VOLUME_LABEL = 'BOEYE BDX Storage Card'
|
||||
|
||||
EBOOK_DIR_MAIN = 'Documents'
|
||||
EBOOK_DIR_MAIN = 'Documents'
|
||||
EBOOK_DIR_CARD_A = 'Documents'
|
||||
SUPPORTS_SUB_DIRS = True
|
||||
|
@ -97,8 +97,8 @@ class HANLINV5(HANLINV3):
|
||||
gui_name = 'Hanlin V5'
|
||||
description = _('Communicate with Hanlin V5 e-book readers.')
|
||||
|
||||
VENDOR_ID = [0x0492]
|
||||
PRODUCT_ID = [0x8813]
|
||||
VENDOR_ID = [0x0492]
|
||||
PRODUCT_ID = [0x8813]
|
||||
BCD = [0x319]
|
||||
|
||||
OSX_MAIN_MEM = 'Hanlin V5 Internal Memory'
|
||||
|
@ -11,7 +11,7 @@ class PageGroup:
|
||||
"""Simulate constructor overloading"""
|
||||
def __init__(self, page_locations: Union[int, List[int]], page_number_type: PageNumberTypes, first_value: int,
|
||||
page_labels: Union[str, List[str], None] = None):
|
||||
if page_locations.__class__ == int:
|
||||
if page_locations.__class__ is int:
|
||||
self.page_locations: List[int] = [page_locations]
|
||||
else:
|
||||
self.page_locations: List[int] = page_locations
|
||||
@ -19,7 +19,7 @@ class PageGroup:
|
||||
self.__first_value = first_value
|
||||
if page_number_type == PageNumberTypes.Custom:
|
||||
assert page_labels is not None
|
||||
if page_labels.__class__ == str:
|
||||
if page_labels.__class__ is str:
|
||||
assert 1 == len(self.page_locations) and len(page_labels) > 0
|
||||
self.__page_number_labels: List[str] = [page_labels]
|
||||
else:
|
||||
@ -28,7 +28,7 @@ class PageGroup:
|
||||
self.__page_number_labels: List[str] = page_labels
|
||||
|
||||
def append(self, page_location: Union[int, Tuple[int, str]]) -> None:
|
||||
if page_location.__class__ == int:
|
||||
if page_location.__class__ is int:
|
||||
assert self.__page_number_type != PageNumberTypes.Custom
|
||||
self.page_locations.append(page_location)
|
||||
else:
|
||||
|
@ -11,7 +11,7 @@ from calibre.devices.kindle.apnx_page_generator.page_number_type import PageNumb
|
||||
|
||||
class Pages:
|
||||
def __init__(self, page_locations: Optional[List[int]] = None):
|
||||
if page_locations.__class__ == list:
|
||||
if page_locations.__class__ is list:
|
||||
self.__pages_groups: List[PageGroup] = [PageGroup(page_locations, PageNumberTypes.Arabic, 1)]
|
||||
else:
|
||||
self.__pages_groups: List[PageGroup] = []
|
||||
|
@ -673,7 +673,7 @@ class Device(DeviceConfig, DevicePlugin):
|
||||
hal = get_hal()
|
||||
vols = hal.get_volumes(d)
|
||||
if verbose:
|
||||
print("FBSD: ", vols)
|
||||
print("FBSD:\t", vols)
|
||||
|
||||
ok, mv = hal.mount_volumes(vols)
|
||||
if not ok:
|
||||
|
@ -106,19 +106,19 @@ class HAL:
|
||||
# Mount Point becomes Mount Path
|
||||
mp += '/'
|
||||
if DEBUG:
|
||||
print("FBSD: mounted", vol['label'], "on", mp)
|
||||
print("FBSD:\tmounted", vol['label'], "on", mp)
|
||||
if mtd == 0:
|
||||
ans['_main_prefix'], ans['_main_vol'] = mp, vol['vol']
|
||||
if DEBUG:
|
||||
print("FBSD: main = ", mp)
|
||||
print("FBSD:\tmain = ", mp)
|
||||
elif mtd == 1:
|
||||
ans['_card_a_prefix'], ans['_card_a_vol'] = mp, vol['vol']
|
||||
if DEBUG:
|
||||
print("FBSD: card a = ", mp)
|
||||
print("FBSD:\tcard a = ", mp)
|
||||
elif mtd == 2:
|
||||
ans['_card_b_prefix'], ans['_card_b_vol'] = mp, vol['vol']
|
||||
if DEBUG:
|
||||
print("FBSD: card b = ", mp)
|
||||
print("FBSD:\tcard b = ", mp)
|
||||
break
|
||||
mtd += 1
|
||||
|
||||
|
@ -307,27 +307,27 @@ SPDRP_LOCATION_PATHS = DWORD(0x00000023)
|
||||
|
||||
CR_CODES, CR_CODE_NAMES = {}, {}
|
||||
for line in '''\
|
||||
#define CR_SUCCESS 0x00000000
|
||||
#define CR_SUCCESS 0x00000000
|
||||
#define CR_DEFAULT 0x00000001
|
||||
#define CR_OUT_OF_MEMORY 0x00000002
|
||||
#define CR_INVALID_POINTER 0x00000003
|
||||
#define CR_INVALID_FLAG 0x00000004
|
||||
#define CR_INVALID_DEVNODE 0x00000005
|
||||
#define CR_INVALID_DEVINST CR_INVALID_DEVNODE
|
||||
#define CR_INVALID_DEVINST CR_INVALID_DEVNODE
|
||||
#define CR_INVALID_RES_DES 0x00000006
|
||||
#define CR_INVALID_LOG_CONF 0x00000007
|
||||
#define CR_INVALID_ARBITRATOR 0x00000008
|
||||
#define CR_INVALID_NODELIST 0x00000009
|
||||
#define CR_DEVNODE_HAS_REQS 0x0000000A
|
||||
#define CR_DEVINST_HAS_REQS CR_DEVNODE_HAS_REQS
|
||||
#define CR_DEVINST_HAS_REQS CR_DEVNODE_HAS_REQS
|
||||
#define CR_INVALID_RESOURCEID 0x0000000B
|
||||
#define CR_DLVXD_NOT_FOUND 0x0000000C
|
||||
#define CR_NO_SUCH_DEVNODE 0x0000000D
|
||||
#define CR_NO_SUCH_DEVINST CR_NO_SUCH_DEVNODE
|
||||
#define CR_NO_SUCH_DEVINST CR_NO_SUCH_DEVNODE
|
||||
#define CR_NO_MORE_LOG_CONF 0x0000000E
|
||||
#define CR_NO_MORE_RES_DES 0x0000000F
|
||||
#define CR_ALREADY_SUCH_DEVNODE 0x00000010
|
||||
#define CR_ALREADY_SUCH_DEVINST CR_ALREADY_SUCH_DEVNODE
|
||||
#define CR_ALREADY_SUCH_DEVINST CR_ALREADY_SUCH_DEVNODE
|
||||
#define CR_INVALID_RANGE_LIST 0x00000011
|
||||
#define CR_INVALID_RANGE 0x00000012
|
||||
#define CR_FAILURE 0x00000013
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user