Skip to content

Commit

Permalink
[ie/PatreonCampaign] Fix campaign_id extraction (yt-dlp#10070)
Browse files Browse the repository at this point in the history
Closes yt-dlp#10013
Authored by: bashonly
  • Loading branch information
bashonly authored May 30, 2024
1 parent 5fdd130 commit 2e5a47d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion yt_dlp/extractor/patreon.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ def _real_extract(self, url):
campaign_id, vanity = self._match_valid_url(url).group('campaign_id', 'vanity')
if campaign_id is None:
webpage = self._download_webpage(url, vanity, headers={'User-Agent': self.USER_AGENT})
campaign_id = self._search_regex(r'https://www.patreon.com/api/campaigns/(\d+)/?', webpage, 'Campaign ID')
campaign_id = self._search_nextjs_data(
webpage, vanity)['props']['pageProps']['bootstrapEnvelope']['pageBootstrap']['campaign']['data']['id']

params = {
'json-api-use-default-includes': 'false',
Expand Down

0 comments on commit 2e5a47d

Please sign in to comment.