From 7b4840f54ececb837bbfa371e2e596114336a0c9 Mon Sep 17 00:00:00 2001 From: Fabian Schuller <59508074+fabsch225@users.noreply.github.com> Date: Thu, 26 Mar 2026 22:18:38 +0100 Subject: [PATCH 1/3] Update recipe for My Zeit EPUB subscription --- recipes/zeitde_sub.recipe | 62 ++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/recipes/zeitde_sub.recipe b/recipes/zeitde_sub.recipe index e7f46b8d9d..6bdb743fbd 100644 --- a/recipes/zeitde_sub.recipe +++ b/recipes/zeitde_sub.recipe @@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext de' __version__ = '1.5' ''' -Die Zeit EPUB +My Zeit EPUB ''' import io @@ -28,15 +28,16 @@ from contextlib import closing from calibre.utils.magick.draw import save_cover_data_to +from mechanize import Cookie class ZeitEPUBAbo(BasicNewsRecipe): - title = u'Die Zeit' - description = u'Das EPUB Abo der Zeit (needs subscription)' + title = u'My Zeit' + description = u'Das EPUB Abo der Zeit (needs subscription - use session-cookie as password)' language = 'de' lang = 'de-DE' - __author__ = 'Steffen Siebert, revised by Tobias Isenberg (with some code by Kovid Goyal), updated by Henning Losert' + __author__ = 'Steffen Siebert, revised by Tobias Isenberg (with some code by Kovid Goyal), updated by Henning Losert and Fabian Schuller' needs_subscription = True conversion_options = { @@ -184,20 +185,25 @@ class ZeitEPUBAbo(BasicNewsRecipe): ] def build_index(self): - url = 'https://meine.zeit.de/anmelden?url=https%3A//epaper.zeit.de/abo/diezeit' + url = 'https://epaper.zeit.de/abo/diezeit' browser = self.get_browser() - # new login process + c = Cookie( + version=0, + name='zeit_sso_201501', + value=self.password, + port=None, port_specified=False, + domain='.zeit.de', domain_specified=True, domain_initial_dot=True, + path='/', path_specified=True, + secure=True, + expires=None, + discard=True, + comment=None, + comment_url=None, + rest={} + ) + browser.cookiejar.set_cookie(c) browser.open(url) - browser.select_form(nr=0) - browser.form['email'] = self.username - browser.form['pass'] = self.password - browser.submit() - # change into abo section - not needed between late 2016 and May 2017, and again starting from March 2020 - # browser.open(url) - # abolink = browser.find_link(text_regex=re.compile( - # '.*E-Paper.*')) # used to be '.*Abo-Bereich.*' - # browser.follow_link(abolink) # find page for latest issue latestlink = browser.find_link(text_regex=re.compile(r'.*ZUR AKTUELLEN AUSGABE.*')) browser.follow_link(latestlink) @@ -248,15 +254,26 @@ class ZeitEPUBAbo(BasicNewsRecipe): self.log.warning('Downloading cover') try: self.log.warning('Trying PDF-based cover') - url = 'https://meine.zeit.de/anmelden?url=https%3A//epaper.zeit.de/abo/diezeit' + url = 'https://epaper.zeit.de/abo/diezeit' browser = self.get_browser() - # new login process + c = Cookie( + version=0, + name='zeit_sso_201501', + value=self.password, + port=None, port_specified=False, + domain='.zeit.de', domain_specified=True, domain_initial_dot=True, + path='/', path_specified=True, + secure=True, + expires=None, + discard=True, + comment=None, + comment_url=None, + rest={} + ) + browser.cookiejar.set_cookie(c) browser.open(url) - browser.select_form(nr=0) - browser.form['email'] = self.username - browser.form['pass'] = self.password - browser.submit() + # change into abo section - not needed at the moment # browser.open(url) # abolink = browser.find_link(text_regex=re.compile( @@ -295,3 +312,6 @@ class ZeitEPUBAbo(BasicNewsRecipe): self.log.warning('Using static old low-res cover') cover_url = 'http://images.zeit.de/bilder/titelseiten_zeit/1946/001_001.jpg' return cover_url + + +calibre_most_common_ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36' From efb764110f48cab7000e32ebdbb2cdc3f5a1a3d6 Mon Sep 17 00:00:00 2001 From: Fabian Schuller <59508074+fabsch225@users.noreply.github.com> Date: Thu, 26 Mar 2026 22:19:12 +0100 Subject: [PATCH 2/3] Cleanup --- recipes/zeitde_sub.recipe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/zeitde_sub.recipe b/recipes/zeitde_sub.recipe index 6bdb743fbd..017fe64257 100644 --- a/recipes/zeitde_sub.recipe +++ b/recipes/zeitde_sub.recipe @@ -32,7 +32,7 @@ from mechanize import Cookie class ZeitEPUBAbo(BasicNewsRecipe): - title = u'My Zeit' + title = u'Die Zeit' description = u'Das EPUB Abo der Zeit (needs subscription - use session-cookie as password)' language = 'de' lang = 'de-DE' From d072d16819d9e5d71c147c66d6f287cbe75e318a Mon Sep 17 00:00:00 2001 From: Fabian Schuller <59508074+fabsch225@users.noreply.github.com> Date: Thu, 26 Mar 2026 22:23:12 +0100 Subject: [PATCH 3/3] Cleanup --- recipes/zeitde_sub.recipe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/zeitde_sub.recipe b/recipes/zeitde_sub.recipe index 017fe64257..a52420cbe5 100644 --- a/recipes/zeitde_sub.recipe +++ b/recipes/zeitde_sub.recipe @@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext de' __version__ = '1.5' ''' -My Zeit EPUB +Die Zeit EPUB ''' import io