aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-04-16 00:54:21 +0700
committerSergey M․ <dstftw@gmail.com>2018-04-16 00:54:21 +0700
commitc07cb68e7974a2ecd94f4101e6f094414df16e75 (patch)
treec8e867b81bbecac16ff03f47d562a1edf8d961d4 /youtube_dl/extractor
parenta42839e548d81ae20e5164ae690075d2c423477e (diff)
[smotri:broadcast] Fix extraction (closes #16180)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/smotri.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/youtube_dl/extractor/smotri.py b/youtube_dl/extractor/smotri.py
index 370fa8879..45995f30f 100644
--- a/youtube_dl/extractor/smotri.py
+++ b/youtube_dl/extractor/smotri.py
@@ -310,6 +310,7 @@ class SmotriBroadcastIE(InfoExtractor):
IE_DESC = 'Smotri.com broadcasts'
IE_NAME = 'smotri:broadcast'
_VALID_URL = r'https?://(?:www\.)?(?P<url>smotri\.com/live/(?P<id>[^/]+))/?.*'
+ _NETRC_MACHINE = 'smotri'
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
@@ -352,17 +353,18 @@ class SmotriBroadcastIE(InfoExtractor):
adult_content = False
ticket = self._html_search_regex(
- r"window\.broadcast_control\.addFlashVar\('file'\s*,\s*'([^']+)'\)",
- broadcast_page, 'broadcast ticket')
+ (r'data-user-file=(["\'])(?P<ticket>(?!\1).+)\1',
+ r"window\.broadcast_control\.addFlashVar\('file'\s*,\s*'(?P<ticket>[^']+)'\)"),
+ broadcast_page, 'broadcast ticket', group='ticket')
- url = 'http://smotri.com/broadcast/view/url/?ticket=%s' % ticket
+ broadcast_url = 'http://smotri.com/broadcast/view/url/?ticket=%s' % ticket
broadcast_password = self._downloader.params.get('videopassword')
if broadcast_password:
- url += '&pass=%s' % hashlib.md5(broadcast_password.encode('utf-8')).hexdigest()
+ broadcast_url += '&pass=%s' % hashlib.md5(broadcast_password.encode('utf-8')).hexdigest()
broadcast_json_page = self._download_webpage(
- url, broadcast_id, 'Downloading broadcast JSON')
+ broadcast_url, broadcast_id, 'Downloading broadcast JSON')
try:
broadcast_json = json.loads(broadcast_json_page)