aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/tbs.py
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2018-12-05 07:03:00 +0100
committerRemita Amine <remitamine@gmail.com>2018-12-05 07:03:00 +0100
commit8bb0c9cc16b841ab89e15e620e00ee954ab316ed (patch)
treeb2dba82e54e0070611289d552410cfc6f5f1cc12 /youtube_dl/extractor/tbs.py
parent5547014ad972a4364c4d4a613db6d3a18f25950e (diff)
[tbs] fix info extraction(fixes #18403)
Diffstat (limited to 'youtube_dl/extractor/tbs.py')
-rw-r--r--youtube_dl/extractor/tbs.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube_dl/extractor/tbs.py b/youtube_dl/extractor/tbs.py
index 784f8ed66..e8a7c65e0 100644
--- a/youtube_dl/extractor/tbs.py
+++ b/youtube_dl/extractor/tbs.py
@@ -16,7 +16,7 @@ from ..utils import (
class TBSIE(TurnerBaseIE):
- _VALID_URL = r'https?://(?:www\.)?(?P<site>tbs|tntdrama)\.com/(?:movies|shows/[^/]+/(?:clips|season-\d+/episode-\d+))/(?P<id>[^/?#]+)'
+ _VALID_URL = r'https?://(?:www\.)?(?P<site>tbs|tntdrama)\.com(?P<path>/(?:movies|shows/[^/]+/(?:clips|season-\d+/episode-\d+))/(?P<id>[^/?#]+))'
_TESTS = [{
'url': 'http://www.tntdrama.com/shows/the-alienist/clips/monster',
'info_dict': {
@@ -40,12 +40,12 @@ class TBSIE(TurnerBaseIE):
}]
def _real_extract(self, url):
- site, display_id = re.match(self._VALID_URL, url).groups()
+ site, path, display_id = re.match(self._VALID_URL, url).groups()
webpage = self._download_webpage(url, display_id)
drupal_settings = self._parse_json(self._search_regex(
r'<script[^>]+?data-drupal-selector="drupal-settings-json"[^>]*?>({.+?})</script>',
webpage, 'drupal setting'), display_id)
- video_data = drupal_settings['turner_playlist'][0]
+ video_data = next(v for v in drupal_settings['turner_playlist'] if v.get('url') == path)
media_id = video_data['mediaID']
title = video_data['title']