Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/smipi1/calibre
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Dec 28, 2024
2 parents 93ab239 + bfbd83b commit d2ca137
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion recipes/lwn_weekly.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ class WeeklyLWN(BasicNewsRecipe):
oldest_article = 7.0
needs_subscription = 'optional'

recipe_specific_options = {
'issue': {
'short': 'The ID of the edition to download',
'long': 'For example, 998950\nHint: The ID can be found within the edition URL'
}
}

def get_browser(self):
br = BasicNewsRecipe.get_browser(self)
if self.username is not None and self.password is not None:
Expand Down Expand Up @@ -76,7 +83,10 @@ class WeeklyLWN(BasicNewsRecipe):
return url

def parse_index(self):
if self.username is not None and self.password is not None:
past_edition = self.recipe_specific_options.get('issue')
if past_edition and isinstance(past_edition, str):
index_url = self.print_version(f'/Articles/{past_edition}/bigpage')
elif self.username is not None and self.password is not None:
index_url = self.print_version('/current/bigpage')
else:
index_url = self.print_version('/free/bigpage')
Expand Down

0 comments on commit d2ca137

Please sign in to comment.