Skip to content

Commit

Permalink
[ie/substack] Fix embed extraction (#8218)
Browse files Browse the repository at this point in the history
Authored by: handlerug
  • Loading branch information
handlerug committed Oct 6, 2023
1 parent 48cceec commit fbcc299
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yt_dlp/extractor/substack.py
Expand Up @@ -50,7 +50,7 @@ def _extract_embed_urls(cls, url, webpage):
if not re.search(r'<script[^>]+src=["\']https://substackcdn.com/[^"\']+\.js', webpage):
return

mobj = re.search(r'{[^}]*["\']subdomain["\']\s*:\s*["\'](?P<subdomain>[^"]+)', webpage)
mobj = re.search(r'{[^}]*\\?["\']subdomain\\?["\']\s*:\s*\\?["\'](?P<subdomain>[^\\"\']+)', webpage)
if mobj:
parsed = urllib.parse.urlparse(url)
yield parsed._replace(netloc=f'{mobj.group("subdomain")}.substack.com').geturl()
Expand Down

0 comments on commit fbcc299

Please sign in to comment.