1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-02 17:22:31 +01:00

[extractor/common] Use source URL as Referer for HTML5 entries (closes #16849)

This commit is contained in:
Sergey M․ 2018-06-29 01:25:05 +07:00
parent d4a24f4091
commit 5e8e2fa51f
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -2437,6 +2437,8 @@ def _media_formats(src, cur_media_type, type_info={}):
media_info['subtitles'].setdefault(lang, []).append({
'url': absolute_url(src),
})
for f in media_info['formats']:
f.setdefault('http_headers', {})['Referer'] = base_url
if media_info['formats'] or media_info['subtitles']:
entries.append(media_info)
return entries