diff options
author | Giedrius Statkevičius <giedrius.statkevicius@gmail.com> | 2015-11-29 02:58:52 +0200 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2015-12-26 20:02:54 +0100 |
commit | 339b1944e7c8c28d1fc7cc8721af73fd23937a1c (patch) | |
tree | 3f434e006a42eb9e28d39c37c59c2c986caf647b /youtube_dl | |
parent | 85367c3a478241a9d47be76ff5418b512cd40eed (diff) |
[lrt] fix the rest of extractor
Closes #7690.
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/lrt.py | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/youtube_dl/extractor/lrt.py b/youtube_dl/extractor/lrt.py index 24a9a4c91..42e768ce7 100644 --- a/youtube_dl/extractor/lrt.py +++ b/youtube_dl/extractor/lrt.py @@ -1,12 +1,8 @@ # coding: utf-8 from __future__ import unicode_literals -import re - from .common import InfoExtractor from ..utils import ( - determine_ext, - js_to_json, parse_duration, remove_end, ) @@ -25,7 +21,7 @@ class LRTIE(InfoExtractor): 'duration': 1783, }, 'params': { - 'skip_download': True, # HLS download + 'skip_download': True, # m3u8 download }, } @@ -39,23 +35,8 @@ class LRTIE(InfoExtractor): duration = parse_duration(self._search_regex( r"var record_len = '([0-9]+:[0-9]+:[0-9]+)';", webpage, 'record_len', fatal=False, default=None)) - formats = [] - for js in re.findall(r'(?s)config:\s*(\{.*?\})', webpage): - data = self._parse_json(js, video_id, transform_source=js_to_json) - if 'provider' not in data: - continue - if data['provider'] == 'rtmp': - formats.append({ - 'format_id': 'rtmp', - 'ext': determine_ext(data['file']), - 'url': data['streamer'], - 'play_path': 'mp4:%s' % data['file'], - 'preference': -1, - 'rtmp_real_time': True, - }) - else: - formats.extend( - self._extract_m3u8_formats(data['file'], video_id, 'mp4')) + link = self._search_regex(r'file: "(.*)" \+ location\.hash\.substring\(1\)', webpage, 'link to m3u8') + formats = self._extract_m3u8_formats(link, video_id, "mp4") return { 'id': video_id, |