mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-23 06:35:51 -07:00
[Callin] resolve issues and add new fields
This commit is contained in:
parent
4337d0eee4
commit
0567dd5b99
1 changed files with 18 additions and 14 deletions
|
@ -2,6 +2,7 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..compat import compat_str
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
traverse_obj,
|
traverse_obj,
|
||||||
|
@ -19,6 +20,8 @@ class CallinIE(InfoExtractor):
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'FCC Commissioner Brendan Carr on Elon’s Starlink',
|
'title': 'FCC Commissioner Brendan Carr on Elon’s Starlink',
|
||||||
'description': 'Or, why the government doesn’t like SpaceX',
|
'description': 'Or, why the government doesn’t like SpaceX',
|
||||||
|
'channel': 'The Pull Request',
|
||||||
|
'channel_url': 'https://callin.com/show/the-pull-request-ucnDJmEKAa',
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://www.callin.com/episode/episode-81-elites-melt-down-over-student-debt-lzxMidUnjA',
|
'url': 'https://www.callin.com/episode/episode-81-elites-melt-down-over-student-debt-lzxMidUnjA',
|
||||||
|
@ -28,6 +31,8 @@ class CallinIE(InfoExtractor):
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Episode 81- Elites MELT DOWN over Student Debt Victory? Rumble in NYC?',
|
'title': 'Episode 81- Elites MELT DOWN over Student Debt Victory? Rumble in NYC?',
|
||||||
'description': 'Let’s talk todays episode about the primary election shake up in NYC and the elites melting down over student debt cancelation.',
|
'description': 'Let’s talk todays episode about the primary election shake up in NYC and the elites melting down over student debt cancelation.',
|
||||||
|
'channel': 'The DEBRIEF With Briahna Joy Gray',
|
||||||
|
'channel_url': 'https://callin.com/show/the-debrief-with-briahna-joy-gray-siiFDzGegm',
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
@ -43,27 +48,26 @@ class CallinIE(InfoExtractor):
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
next_data = self._search_nextjs_data(webpage, video_id)
|
next_data = self._search_nextjs_data(webpage, video_id)
|
||||||
valid = traverse_obj(next_data, ('props', 'pageProps', 'episode'))
|
episode = traverse_obj(next_data, ('props', 'pageProps', 'episode'), expected_type=dict)
|
||||||
if not valid:
|
if not episode:
|
||||||
raise ExtractorError('Failed to find m3u8')
|
raise ExtractorError('Failed to find episode data')
|
||||||
|
|
||||||
episode = try_get(next_data, lambda x: x['props']['pageProps']['episode'], dict)
|
title = episode.get('title') or self._og_search_title(webpage)
|
||||||
title = episode.get('title')
|
description = episode.get('description') or self._og_search_description(webpage)
|
||||||
if not title:
|
|
||||||
title = self._og_search_title(webpage)
|
|
||||||
description = episode.get('description')
|
|
||||||
if not description:
|
|
||||||
description = self._og_search_description(webpage)
|
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
m3u8_url = episode.get('m3u8')
|
|
||||||
if m3u8_url:
|
|
||||||
formats.extend(self._extract_m3u8_formats(
|
formats.extend(self._extract_m3u8_formats(
|
||||||
m3u8_url, video_id, 'mp4', fatal=False))
|
episode.get('m3u8'), video_id, 'mp4', fatal=False))
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
channel = try_get(episode, lambda x: x['show']['title'], compat_str)
|
||||||
|
channel_url = try_get(episode, lambda x: x['show']['linkObj']['resourceUrl'], compat_str)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': description,
|
'description': description,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
|
'channel': channel,
|
||||||
|
'channel_url': channel_url,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue