[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:
scrat5h 2022-11-21 15:38:09 +00:00
parent 1138e33ac5
commit 6887f87208

View File

@ -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')