mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-20 05:47:24 +01:00
[extractor/pornhub] URL to subtitles is relative
`closedCaptionsFile` field on the page is not absolute URL (anymore?) but relative one. This change makes extracting subtitles working again.
This commit is contained in:
parent
1138e33ac5
commit
6887f87208
@ -11,6 +11,7 @@
|
||||
from ..utils import (
|
||||
NO_DEFAULT,
|
||||
ExtractorError,
|
||||
base_url,
|
||||
clean_html,
|
||||
determine_ext,
|
||||
format_field,
|
||||
@ -23,6 +24,7 @@
|
||||
update_url_query,
|
||||
url_or_none,
|
||||
urlencode_postdata,
|
||||
urljoin,
|
||||
)
|
||||
|
||||
|
||||
@ -325,10 +327,10 @@ def dl_webpage(platform):
|
||||
r'var\s+flashvars_\d+\s*=\s*({.+?});', webpage, 'flashvars', default='{}'),
|
||||
video_id)
|
||||
if flashvars:
|
||||
subtitle_url = url_or_none(flashvars.get('closedCaptionsFile'))
|
||||
subtitle_url = flashvars.get('closedCaptionsFile')
|
||||
if subtitle_url:
|
||||
subtitles.setdefault('en', []).append({
|
||||
'url': subtitle_url,
|
||||
'url': urljoin(base_url(url), subtitle_url),
|
||||
'ext': 'srt',
|
||||
})
|
||||
thumbnail = flashvars.get('image_url')
|
||||
|
Loading…
Reference in New Issue
Block a user