[extractor/common] Use source URL as Referer for HTML5 entries (closes #16849)
authorSergey M․ <dstftw@gmail.com>
Thu, 28 Jun 2018 18:25:05 +0000 (01:25 +0700)
committerSergey M․ <dstftw@gmail.com>
Thu, 28 Jun 2018 18:25:05 +0000 (01:25 +0700)
youtube_dl/extractor/common.py

index 394f34372ea414bfe9d6e44b16a465d54c455b0d..f3fec160dcd0795840725227edcbfbfe3f3673c3 100644 (file)
@@ -2437,6 +2437,8 @@ class InfoExtractor(object):
                         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