Skip to content

Commit

Permalink
NYTMag: Get higher-res cover image [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ping committed Jul 30, 2023
1 parent 4a701f1 commit 873caed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion recipes/nytimes-magazine.recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def parse_index(self):

issue_cover = next(iter(soup.select(".issue-promo .promo-image img")), None)
if issue_cover:
self.cover_url = issue_cover["src"]
# "-superJumbo.jpg" will get an even higher-res version
self.cover_url = issue_cover["src"].replace("-blog480.jpg", "-jumbo.jpg")
issue_url = urljoin(index_url, issue_link["href"])
soup = self.index_to_soup(issue_url)
info = self.get_script_json(soup, r"window.__preloadedData\s*=\s*")
Expand Down

0 comments on commit 873caed

Please sign in to comment.