mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Die Zeit (subscription)
Fixes #1650014 [recipe for Die Zeit (subscription only) doesn't work after URL changes](https://bugs.launchpad.net/calibre/+bug/1650014)
This commit is contained in:
parent
ee9877dc9d
commit
03c3b139db
@ -186,9 +186,18 @@ class ZeitEPUBAbo(BasicNewsRecipe):
|
|||||||
browser.form['email'] = self.username
|
browser.form['email'] = self.username
|
||||||
browser.form['password'] = self.password
|
browser.form['password'] = self.password
|
||||||
browser.submit()
|
browser.submit()
|
||||||
|
# change into abo section
|
||||||
|
browser.open(url)
|
||||||
|
abolink = browser.find_link(text_regex=re.compile(
|
||||||
|
'.*Abo-Bereich.*'))
|
||||||
|
browser.follow_link(abolink)
|
||||||
|
# find page for latest issue
|
||||||
|
latestlink = browser.find_link(text_regex=re.compile(
|
||||||
|
'.*ZUR AKTUELLEN AUSGABE.*'))
|
||||||
|
browser.follow_link(latestlink)
|
||||||
# now find the correct file, we will still use the ePub file
|
# now find the correct file, we will still use the ePub file
|
||||||
epublink = browser.find_link(text_regex=re.compile(
|
epublink = browser.find_link(text_regex=re.compile(
|
||||||
'.*Download als Datei im ePub-Format für eReader.*'))
|
'.*EPUB FÜR E-READER LADEN.*'))
|
||||||
response = browser.follow_link(epublink)
|
response = browser.follow_link(epublink)
|
||||||
self.report_progress(1, _('next step'))
|
self.report_progress(1, _('next step'))
|
||||||
|
|
||||||
@ -243,9 +252,18 @@ class ZeitEPUBAbo(BasicNewsRecipe):
|
|||||||
browser.form['email'] = self.username
|
browser.form['email'] = self.username
|
||||||
browser.form['password'] = self.password
|
browser.form['password'] = self.password
|
||||||
browser.submit()
|
browser.submit()
|
||||||
|
# change into abo section
|
||||||
|
browser.open(url)
|
||||||
|
abolink = browser.find_link(text_regex=re.compile(
|
||||||
|
'.*Abo-Bereich.*'))
|
||||||
|
browser.follow_link(abolink)
|
||||||
|
# find page for latest issue
|
||||||
|
latestlink = browser.find_link(text_regex=re.compile(
|
||||||
|
'.*ZUR AKTUELLEN AUSGABE.*'))
|
||||||
|
browser.follow_link(latestlink)
|
||||||
# actual cover search
|
# actual cover search
|
||||||
pdflink = browser.find_link(text_regex=re.compile(
|
pdflink = browser.find_link(text_regex=re.compile(
|
||||||
'.*Download der gesamten Ausgabe als PDF Datei.*'))
|
'.*GESAMT-PDF LADEN.*'))
|
||||||
cover_url = urlparse(pdflink.base_url)[0] + '://' + urlparse(pdflink.base_url)[1] + '' + (
|
cover_url = urlparse(pdflink.base_url)[0] + '://' + urlparse(pdflink.base_url)[1] + '' + (
|
||||||
urlparse(pdflink.url)[2]).replace('ePaper_', '').replace('.pdf', '_001.pdf')
|
urlparse(pdflink.url)[2]).replace('ePaper_', '').replace('.pdf', '_001.pdf')
|
||||||
self.log.warning('PDF link found:')
|
self.log.warning('PDF link found:')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user