mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Le Devoir
Fixes #1747422 [Private bug](https://bugs.launchpad.net/calibre/+bug/1747422)
This commit is contained in:
parent
7460aad117
commit
dce369148d
@ -26,46 +26,21 @@ class ledevoir(BasicNewsRecipe):
|
|||||||
timefmt = '[%a, %d %b, %Y]'
|
timefmt = '[%a, %d %b, %Y]'
|
||||||
|
|
||||||
oldest_article = 1
|
oldest_article = 1
|
||||||
max_articles_per_feed = 200
|
max_articles_per_feed = 50
|
||||||
min_articles_per_feed = 0
|
min_articles_per_feed = 0
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
recursion = 10
|
|
||||||
needs_subscription = 'optional'
|
needs_subscription = 'optional'
|
||||||
|
|
||||||
compress_news_images = True
|
compress_news_images = True
|
||||||
compress_news_images_auto_size = 4
|
compress_news_images_auto_size = 4
|
||||||
|
|
||||||
url_list = []
|
|
||||||
|
|
||||||
remove_javascript = True
|
remove_javascript = True
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
|
remove_empty_feeds = True
|
||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
# dict(name='div', attrs={'id':'article_detail'}),
|
dict(name='h1'),
|
||||||
# dict(name='div', attrs={'id':'colonne_principale'}),
|
dict(attrs={'class': 'col-xs-14 col-sm-8 col-md-10'}),
|
||||||
dict(name='article', attrs={'id': 'article', 'class': 'clearfix'}),
|
|
||||||
dict(name='article', attrs={
|
|
||||||
'id': 'article', 'class': 'clearfix portrait'})
|
|
||||||
]
|
|
||||||
|
|
||||||
remove_tags = [
|
|
||||||
dict(name='div', attrs={'id': 'prive'}),
|
|
||||||
dict(name='div', attrs={'class': 'acheter_article'}),
|
|
||||||
dict(name='div', attrs={'id': 'col_complement'}),
|
|
||||||
dict(name='div', attrs={'id': 'raccourcis', 'class': 'clearfix'}),
|
|
||||||
dict(name='div', attrs={'id': 'dialog'}),
|
|
||||||
dict(name='div', attrs={
|
|
||||||
'id': 'liste_photos_article', 'class': 'clearfix'}),
|
|
||||||
dict(name='script', attrs={'type': 'text/javascript'}),
|
|
||||||
dict(name='div', attrs={'class': ['interesse_actions', 'reactions',
|
|
||||||
'taille_du_texte right clearfix', 'partage_sociaux clearfix']}),
|
|
||||||
dict(name='aside', attrs={
|
|
||||||
'class': ['article_actions clearfix', 'partage_sociaux_wrapper']}),
|
|
||||||
dict(name='aside', attrs={'class': 'reactions', 'id': 'reactions'}),
|
|
||||||
dict(name='ul', attrs={'class': 'mots_cles'}),
|
|
||||||
dict(name='ul', attrs={'id': 'commentaires'}),
|
|
||||||
dict(name='a', attrs={'class': 'haut'}),
|
|
||||||
dict(name='h5', attrs={'class': 'interesse_actions'})
|
|
||||||
]
|
]
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
@ -90,8 +65,8 @@ class ledevoir(BasicNewsRecipe):
|
|||||||
def get_browser(self):
|
def get_browser(self):
|
||||||
br = BasicNewsRecipe.get_browser(self)
|
br = BasicNewsRecipe.get_browser(self)
|
||||||
if self.username is not None and self.password is not None:
|
if self.username is not None and self.password is not None:
|
||||||
br.open('http://www.ledevoir.com')
|
br.open('http://www.ledevoir.com/auth/login')
|
||||||
br.select_form(nr=1)
|
br.select_form(action='/auth/login')
|
||||||
br['login[courriel]'] = self.username
|
br['login[courriel]'] = self.username
|
||||||
br['login[password]'] = self.password
|
br['login[password]'] = self.password
|
||||||
br.submit()
|
br.submit()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user