1
mirror of https://github.com/yt-dlp/yt-dlp synced 2024-11-27 05:13:39 +01:00

[ie/PatreonCampaign] Fix campaign_id extraction (#10070)

Closes #10013
Authored by: bashonly
This commit is contained in:
bashonly 2024-05-30 18:04:27 -05:00 committed by GitHub
parent 5fdd13006a
commit 2e5a47da40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -486,7 +486,8 @@ class PatreonCampaignIE(PatreonBaseIE):
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',