aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorEnes <enessolak99@gmail.com>2018-04-24 22:48:40 +0300
committerSergey M․ <dstftw@gmail.com>2018-05-26 01:53:11 +0700
commitf4d261b765a17ef2beccec78680ec693c7df014c (patch)
tree6052ab5a60d4950fd13d27e542137e2c796b505c /youtube_dl
parentaee36ca832ec3a5696c40707098d97be0353e997 (diff)
[izlesene] Fix extraction (closes #16233)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/izlesene.py33
1 files changed, 10 insertions, 23 deletions
diff --git a/youtube_dl/extractor/izlesene.py b/youtube_dl/extractor/izlesene.py
index b1d72177d..5b2095490 100644
--- a/youtube_dl/extractor/izlesene.py
+++ b/youtube_dl/extractor/izlesene.py
@@ -1,8 +1,6 @@
# coding: utf-8
from __future__ import unicode_literals
-import re
-
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import (
@@ -72,7 +70,7 @@ class IzleseneIE(InfoExtractor):
'uploadDate', webpage, 'upload date'))
duration = float_or_none(self._html_search_regex(
- r'"videoduration"\s*:\s*"([^"]+)"',
+ r'videoduration\s*=\s*\'([^\']+)\'',
webpage, 'duration', fatal=False), scale=1000)
view_count = str_to_int(get_element_by_id('videoViewCount', webpage))
@@ -80,29 +78,18 @@ class IzleseneIE(InfoExtractor):
r'comment_count\s*=\s*\'([^\']+)\';',
webpage, 'comment_count', fatal=False)
- content_url = self._html_search_meta(
- 'contentURL', webpage, 'content URL', fatal=False)
- ext = determine_ext(content_url, 'mp4')
-
- # Might be empty for some videos.
- streams = self._html_search_regex(
- r'"qualitylevel"\s*:\s*"([^"]+)"', webpage, 'streams', default='')
+ streams_json = self._html_search_regex(
+ r'_videoObj\s*=\s*(.+);', webpage, 'streams')
+ streams = self._parse_json(streams_json, video_id)
formats = []
- if streams:
- for stream in streams.split('|'):
- quality, url = re.search(r'\[(\w+)\](.+)', stream).groups()
- formats.append({
- 'format_id': '%sp' % quality if quality else 'sd',
- 'url': compat_urllib_parse_unquote(url),
- 'ext': ext,
- })
- else:
- stream_url = self._search_regex(
- r'"streamurl"\s*:\s*"([^"]+)"', webpage, 'stream URL')
+ for stream in streams.get('media').get('level'):
+ url = stream.get('source')
+ ext = determine_ext(url, 'mp4')
+ quality = stream.get('value')
formats.append({
- 'format_id': 'sd',
- 'url': compat_urllib_parse_unquote(stream_url),
+ 'format_id': '%sp' % quality,
+ 'url': compat_urllib_parse_unquote(url),
'ext': ext,
})