mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-30 18:34:36 +01:00
Changed to use _smuggle_referer
Removed `std_headers` import to satisfy flake8
This commit is contained in:
parent
41290c1ccc
commit
457f046c3c
@ -2,7 +2,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from .vimeo import VHXEmbedIE
|
from .vimeo import VHXEmbedIE, VimeoIE
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
clean_html,
|
clean_html,
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
@ -11,8 +11,7 @@ from ..utils import (
|
|||||||
get_elements_by_class,
|
get_elements_by_class,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
unified_strdate,
|
unified_strdate,
|
||||||
urlencode_postdata,
|
urlencode_postdata
|
||||||
std_headers
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -139,8 +138,6 @@ class DropoutIE(InfoExtractor):
|
|||||||
raise ExtractorError('Incorrect username/password')
|
raise ExtractorError('Incorrect username/password')
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
std_headers['Referer'] = 'https://www.dropout.tv' # See issue 2858
|
|
||||||
|
|
||||||
display_id = self._match_id(url)
|
display_id = self._match_id(url)
|
||||||
try:
|
try:
|
||||||
logged_in = self._login(display_id)
|
logged_in = self._login(display_id)
|
||||||
@ -166,7 +163,7 @@ class DropoutIE(InfoExtractor):
|
|||||||
return {
|
return {
|
||||||
'_type': 'url_transparent',
|
'_type': 'url_transparent',
|
||||||
'ie_key': VHXEmbedIE.ie_key(),
|
'ie_key': VHXEmbedIE.ie_key(),
|
||||||
'url': embed_url,
|
'url': VimeoIE._smuggle_referrer(embed_url, 'https://www.dropout.tv'),
|
||||||
'id': self._search_regex(r'embed.vhx.tv/videos/(.+?)\?', embed_url, 'id'),
|
'id': self._search_regex(r'embed.vhx.tv/videos/(.+?)\?', embed_url, 'id'),
|
||||||
'display_id': display_id,
|
'display_id': display_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
|
@ -1146,8 +1146,15 @@ class VHXEmbedIE(VimeoBaseInfoExtractor):
|
|||||||
return unescapeHTML(mobj.group(1)) if mobj else None
|
return unescapeHTML(mobj.group(1)) if mobj else None
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
url, data = unsmuggle_url(url, {})
|
||||||
|
headers = std_headers.copy()
|
||||||
|
if 'http_headers' in data:
|
||||||
|
headers.update(data['http_headers'])
|
||||||
|
if 'Referer' not in headers:
|
||||||
|
headers['Referer'] = url
|
||||||
|
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id, headers=headers)
|
||||||
config_url = self._parse_json(self._search_regex(
|
config_url = self._parse_json(self._search_regex(
|
||||||
r'window\.OTTData\s*=\s*({.+})', webpage,
|
r'window\.OTTData\s*=\s*({.+})', webpage,
|
||||||
'ott data'), video_id, js_to_json)['config_url']
|
'ott data'), video_id, js_to_json)['config_url']
|
||||||
|
Loading…
Reference in New Issue
Block a user