aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/tbs.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-10-18 15:24:21 -0500
committerJesús <heckyel@hyperbola.info>2021-10-18 15:24:21 -0500
commit5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e (patch)
tree65209bc739db35e31f1c9b5b868eb5df4fe12ae3 /hypervideo_dl/extractor/tbs.py
parent27fe903c511691c078942bef5ee9a05a43b15c8f (diff)
downloadhypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.tar.lz
hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.tar.xz
hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.zip
update from upstream
Diffstat (limited to 'hypervideo_dl/extractor/tbs.py')
-rw-r--r--hypervideo_dl/extractor/tbs.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/hypervideo_dl/extractor/tbs.py b/hypervideo_dl/extractor/tbs.py
index e8a7c65..c7d62ff 100644
--- a/hypervideo_dl/extractor/tbs.py
+++ b/hypervideo_dl/extractor/tbs.py
@@ -16,7 +16,7 @@ from ..utils import (
class TBSIE(TurnerBaseIE):
- _VALID_URL = r'https?://(?:www\.)?(?P<site>tbs|tntdrama)\.com(?P<path>/(?:movies|shows/[^/]+/(?:clips|season-\d+/episode-\d+))/(?P<id>[^/?#]+))'
+ _VALID_URL = r'https?://(?:www\.)?(?P<site>tbs|tntdrama)\.com(?P<path>/(?:movies|watchtnt|watchtbs|shows/[^/]+/(?:clips|season-\d+/episode-\d+))/(?P<id>[^/?#]+))'
_TESTS = [{
'url': 'http://www.tntdrama.com/shows/the-alienist/clips/monster',
'info_dict': {
@@ -40,12 +40,13 @@ class TBSIE(TurnerBaseIE):
}]
def _real_extract(self, url):
- site, path, display_id = re.match(self._VALID_URL, url).groups()
+ site, path, display_id = self._match_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 = next(v for v in drupal_settings['turner_playlist'] if v.get('url') == path)
+ isLive = 'watchtnt' in path or 'watchtbs' in path
+ video_data = next(v for v in drupal_settings['turner_playlist'] if isLive or v.get('url') == path)
media_id = video_data['mediaID']
title = video_data['title']
@@ -56,7 +57,8 @@ class TBSIE(TurnerBaseIE):
media_id, tokenizer_query, {
'url': url,
'site_name': site[:3].upper(),
- 'auth_required': video_data.get('authRequired') == '1',
+ 'auth_required': video_data.get('authRequired') == '1' or isLive,
+ 'is_live': isLive
})
thumbnails = []
@@ -85,5 +87,6 @@ class TBSIE(TurnerBaseIE):
'season_number': int_or_none(video_data.get('season')),
'episode_number': int_or_none(video_data.get('episode')),
'thumbnails': thumbnails,
+ 'is_live': isLive
})
return info