Skip to content

Commit

Permalink
[comedycentral] new shortcut :theopposition for "The Opposition" show
Browse files Browse the repository at this point in the history
  • Loading branch information
phihag committed Oct 4, 2017
1 parent 6e736d8 commit 6b46285
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion youtube_dl/extractor/comedycentral.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,23 @@ def _real_extract(self, url):


class ComedyCentralShortnameIE(InfoExtractor):
_VALID_URL = r'^:(?P<id>tds|thedailyshow)$'
_VALID_URL = r'^:(?P<id>tds|thedailyshow|theopposition)$'
_TESTS = [{
'url': ':tds',
'only_matching': True,
}, {
'url': ':thedailyshow',
'only_matching': True,
}, {
'url': ':theopposition',
'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',
'theopposition': 'http://www.cc.com/shows/the-opposition-with-jordan-klepper/full-episodes',
}
return self.url_result(shortcut_map[video_id])

0 comments on commit 6b46285

Please sign in to comment.