mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Set 'needs_subscription' to 'optional' and add get_browser() method
This commit is contained in:
parent
44e257224f
commit
71b858f0c5
@ -43,7 +43,7 @@ class Fokus(BasicNewsRecipe):
|
|||||||
masthead_url = 'https://cdn.fokus.se/app/uploads/fokus/2022/05/12214931/fokus-logo.svg'
|
masthead_url = 'https://cdn.fokus.se/app/uploads/fokus/2022/05/12214931/fokus-logo.svg'
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
compress_news_images = True
|
compress_news_images = True
|
||||||
needs_subscription = False
|
needs_subscription = 'optional'
|
||||||
max_age = 7 # days
|
max_age = 7 # days
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
extra_css = 'img { display: block; width: 100%; height: auto }'
|
extra_css = 'img { display: block; width: 100%; height: auto }'
|
||||||
@ -88,6 +88,16 @@ class Fokus(BasicNewsRecipe):
|
|||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
BasicNewsRecipe.__init__(self, *args, **kwargs)
|
||||||
|
|
||||||
|
def get_browser(self):
|
||||||
|
br = BasicNewsRecipe.get_browser(self)
|
||||||
|
if self.username and self.password:
|
||||||
|
br.open('https://www.fokus.se/auth/logga-in')
|
||||||
|
br.select_form(name='loginForm')
|
||||||
|
br['j_username'] = self.username
|
||||||
|
br['j_password'] = self.password
|
||||||
|
br.submit()
|
||||||
|
return br
|
||||||
|
|
||||||
def parse_article_blurb(self, article_blurb):
|
def parse_article_blurb(self, article_blurb):
|
||||||
desc = ''
|
desc = ''
|
||||||
if a_tag := article_blurb.find('a', href=True):
|
if a_tag := article_blurb.find('a', href=True):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user