mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-23 06:35:51 -07:00
modify callin
This commit is contained in:
parent
23dbeb8106
commit
290e6961dc
1 changed files with 13 additions and 5 deletions
|
@ -2,7 +2,10 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import traverse_obj
|
from ..utils import (
|
||||||
|
ExtractorError,
|
||||||
|
traverse_obj,
|
||||||
|
)
|
||||||
|
|
||||||
class CallinIE(InfoExtractor):
|
class CallinIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?callin\.com/episode/(?:[^/#?-]+-)*(?P<id>[^/#?-]+)'
|
_VALID_URL = r'https?://(?:www\.)?callin\.com/episode/(?:[^/#?-]+-)*(?P<id>[^/#?-]+)'
|
||||||
|
@ -38,15 +41,20 @@ class CallinIE(InfoExtractor):
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
# webpage_json = self._download_json(url, video_id)
|
# webpage_json = self._download_json(url, video_id)
|
||||||
|
|
||||||
next_data = self._search_nextjs_data(webpage, video_id)['props']['pageProps']['episode']
|
next_data = self._search_nextjs_data(webpage, video_id)
|
||||||
title = next_data.get('title')
|
valid = traverse_obj(next_data, ('props', 'pageProps', 'episode'))
|
||||||
|
if not valid:
|
||||||
|
raise ExtractorError('Failed to find m3u8')
|
||||||
|
|
||||||
|
episode = self._search_nextjs_data(webpage, video_id)['props']['pageProps']['episode']
|
||||||
|
title = episode.get('title')
|
||||||
if not title:
|
if not title:
|
||||||
title = self._og_search_title(webpage)
|
title = self._og_search_title(webpage)
|
||||||
description = next_data.get('description')
|
description = episode.get('description')
|
||||||
if not description:
|
if not description:
|
||||||
description = self._og_search_description(webpage)
|
description = self._og_search_description(webpage)
|
||||||
|
|
||||||
video_url = next_data.get('m3u8')
|
video_url = episode.get('m3u8')
|
||||||
formats = self._extract_m3u8_formats(
|
formats = self._extract_m3u8_formats(
|
||||||
video_url, video_id, 'mp4')
|
video_url, video_id, 'mp4')
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue