mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 12:01:28 +00:00
[comedycentral] Re-add shortnames
In cc99d4f826
, the shortname feature got deleted by accident. Re-add it as a separate IE.
This commit is contained in:
parent
45408eb075
commit
6a9b3b61ea
|
@ -1,6 +1,7 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .mtv import MTVServicesInfoExtractor
|
from .mtv import MTVServicesInfoExtractor
|
||||||
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
class ComedyCentralIE(MTVServicesInfoExtractor):
|
class ComedyCentralIE(MTVServicesInfoExtractor):
|
||||||
|
@ -96,3 +97,22 @@ def _real_extract(self, url):
|
||||||
webpage, 'mrss url', group='url')
|
webpage, 'mrss url', group='url')
|
||||||
|
|
||||||
return self._get_videos_info_from_url(mrss_url, video_id)
|
return self._get_videos_info_from_url(mrss_url, video_id)
|
||||||
|
|
||||||
|
|
||||||
|
class ComedyCentralShortnameIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'^:(?P<id>tds|thedailyshow)$'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': ':tds',
|
||||||
|
'only_matching': True,
|
||||||
|
}, {
|
||||||
|
'url': ':thedailyshow',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
shortcut_map = {
|
||||||
|
'tds': 'http://www.cc.com/shows/the-daily-show-with-trevor-noah/full-episodes',
|
||||||
|
'thedailyshow': 'http://www.cc.com/shows/the-daily-show-with-trevor-noah/full-episodes',
|
||||||
|
}
|
||||||
|
return self.url_result(shortcut_map[video_id])
|
||||||
|
|
|
@ -159,6 +159,7 @@
|
||||||
from .collegerama import CollegeRamaIE
|
from .collegerama import CollegeRamaIE
|
||||||
from .comedycentral import (
|
from .comedycentral import (
|
||||||
ComedyCentralIE,
|
ComedyCentralIE,
|
||||||
|
ComedyCentralShortnameIE,
|
||||||
ComedyCentralTVIE,
|
ComedyCentralTVIE,
|
||||||
ToshIE,
|
ToshIE,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue