mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-22 20:20:09 +09:00
apply suggested improvements
This commit is contained in:
parent
6ff4cde8e8
commit
bdd0cf4611
@ -2,13 +2,11 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import (
|
from ..compat import compat_urlparse
|
||||||
compat_str,
|
|
||||||
compat_urlparse,
|
|
||||||
)
|
|
||||||
|
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
determine_ext,
|
determine_ext,
|
||||||
|
urljoin,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -40,24 +38,18 @@ class VideoCdnIE(InfoExtractor):
|
|||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
formats = []
|
|
||||||
|
|
||||||
thumbnail = self._search_regex(
|
thumbnail = self._search_regex(
|
||||||
r'\"thumbnailUrl\":\"(?P<thumbnail>[^\"]+)',
|
r'\"thumbnailUrl\":\"(?P<thumbnail>[^\"]+)',
|
||||||
webpage, 'thumbnail', group='thumbnail',
|
webpage, 'thumbnail', group='thumbnail',
|
||||||
default=None)
|
default=None)
|
||||||
|
|
||||||
title = self._search_regex(
|
title = self._search_regex(r'"name"\s*:\s*"((?:\\"|[^"])+)', webpage, 'title')
|
||||||
r'\"name\":\"(?P<title>[^\"]+)',
|
|
||||||
webpage, 'title', group='title')
|
|
||||||
|
|
||||||
manifest_url = self._search_regex(
|
manifest_url = self._search_regex(r'"contentUrl"\s*:\s*"((?:\\"|[^"])+)', webpage, 'manifest_url')
|
||||||
r'\"contentUrl\":\"(?P<manifesturl>[^\"]+)',
|
manifest_url = urljoin(url, manifest_url)
|
||||||
webpage,
|
|
||||||
'manifest_url', group='manifesturl'
|
|
||||||
)
|
|
||||||
|
|
||||||
if isinstance(manifest_url, compat_str) and determine_ext(manifest_url) == 'm3u8':
|
formats = []
|
||||||
|
if manifest_url and determine_ext(manifest_url) == 'm3u8':
|
||||||
formats.extend(self._extract_m3u8_formats(
|
formats.extend(self._extract_m3u8_formats(
|
||||||
compat_urlparse.urljoin(url, manifest_url),
|
compat_urlparse.urljoin(url, manifest_url),
|
||||||
video_id, 'mp4',
|
video_id, 'mp4',
|
||||||
|
Loading…
Reference in New Issue
Block a user