mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #3926 (Get list of books on device fails with Kindle DX with 0.6.20)
This commit is contained in:
parent
4ab7c54c67
commit
3c66674bd8
@ -1,25 +1,24 @@
|
|||||||
import re
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class Cyberpresse(BasicNewsRecipe):
|
class Cyberpresse(BasicNewsRecipe):
|
||||||
|
|
||||||
title = u'Cyberpresse'
|
title = u'Cyberpresse'
|
||||||
__author__ = 'balok'
|
__author__ = 'balok and Sujata Raman'
|
||||||
description = 'Canadian news in French'
|
description = 'Canadian news in French'
|
||||||
language = 'fr'
|
language = 'fr'
|
||||||
|
|
||||||
oldest_article = 7
|
oldest_article = 7
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
remove_javascript = True
|
remove_javascript = True
|
||||||
html2lrf_options = ['--left-margin=0','--right-margin=0','--top-margin=0','--bottom-margin=0']
|
html2lrf_options = ['--left-margin=0','--right-margin=0','--top-margin=0','--bottom-margin=0']
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
|
|
||||||
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'class':'article-page'}),
|
keep_only_tags = [dict(name='div', attrs={'class':'article-page'}),
|
||||||
dict(name='div', attrs={'id':'articlePage'}),
|
dict(name='div', attrs={'id':'articlePage'}),
|
||||||
]
|
]
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
.photodata{font-family:Arial,Helvetica,Verdana,sans-serif;color: #999999; font-size: 90%; }
|
.photodata{font-family:Arial,Helvetica,Verdana,sans-serif;color: #999999; font-size: 90%; }
|
||||||
h1{font-family:Georgia,Times,serif ; font-size: large; }
|
h1{font-family:Georgia,Times,serif ; font-size: large; }
|
||||||
@ -33,14 +32,14 @@ class Cyberpresse(BasicNewsRecipe):
|
|||||||
.minithumb-auteurs{font-family:Arial,Helvetica,Verdana,sans-serif; font-size: 90%; }
|
.minithumb-auteurs{font-family:Arial,Helvetica,Verdana,sans-serif; font-size: 90%; }
|
||||||
a{color:#003399; font-weight:bold; }
|
a{color:#003399; font-weight:bold; }
|
||||||
'''
|
'''
|
||||||
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name='div', attrs={'class':['centerbar','colspan','share-module']}),
|
dict(name='div', attrs={'class':['centerbar','colspan','share-module']}),
|
||||||
dict(name='p', attrs={'class':['zoom']}),
|
dict(name='p', attrs={'class':['zoom']}),
|
||||||
dict(name='ul', attrs={'class':['stories']}),
|
dict(name='ul', attrs={'class':['stories']}),
|
||||||
dict(name='h4', attrs={'class':['general-cat']}),
|
dict(name='h4', attrs={'class':['general-cat']}),
|
||||||
]
|
]
|
||||||
|
|
||||||
feeds = [(u'Manchettes', u'http://www.cyberpresse.ca/rss/225.xml'),
|
feeds = [(u'Manchettes', u'http://www.cyberpresse.ca/rss/225.xml'),
|
||||||
(u'Capitale nationale', u'http://www.cyberpresse.ca/rss/501.xml'),
|
(u'Capitale nationale', u'http://www.cyberpresse.ca/rss/501.xml'),
|
||||||
(u'Opinions', u'http://www.cyberpresse.ca/rss/977.xml'),
|
(u'Opinions', u'http://www.cyberpresse.ca/rss/977.xml'),
|
||||||
@ -48,10 +47,10 @@ class Cyberpresse(BasicNewsRecipe):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def postprocess_html(self, soup, first):
|
def postprocess_html(self, soup, first):
|
||||||
|
|
||||||
for tag in soup.findAll(name=['i','strong']):
|
for tag in soup.findAll(name=['i','strong']):
|
||||||
tag.name = 'div'
|
tag.name = 'div'
|
||||||
|
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class NUUT2(USBMS):
|
|||||||
supported_platforms = ['windows', 'osx', 'linux']
|
supported_platforms = ['windows', 'osx', 'linux']
|
||||||
|
|
||||||
# Ordered list of supported formats
|
# Ordered list of supported formats
|
||||||
FORMATS = ['epub', 'pdft', 'txt']
|
FORMATS = ['epub', 'pdf', 'txt']
|
||||||
DRM_FORMATS = ['epub']
|
DRM_FORMATS = ['epub']
|
||||||
|
|
||||||
VENDOR_ID = [0x140e]
|
VENDOR_ID = [0x140e]
|
||||||
|
@ -34,6 +34,7 @@ def metadata_from_formats(formats):
|
|||||||
mi = metadata_from_filename(list(iter(formats))[0])
|
mi = metadata_from_filename(list(iter(formats))[0])
|
||||||
if not mi.authors:
|
if not mi.authors:
|
||||||
mi.authors = [_('Unknown')]
|
mi.authors = [_('Unknown')]
|
||||||
|
return mi
|
||||||
|
|
||||||
def _metadata_from_formats(formats):
|
def _metadata_from_formats(formats):
|
||||||
mi = MetaInformation(None, None)
|
mi = MetaInformation(None, None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user