From 1e79316e20c26aeb79712ab3f364147d04e28c9f Mon Sep 17 00:00:00 2001 From: LE Date: Sat, 26 Jun 2021 07:44:43 -0400 Subject: [TBS] Support livestreams (#448) Authored by: llacb47 --- yt_dlp/extractor/tbs.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'yt_dlp/extractor/tbs.py') diff --git a/yt_dlp/extractor/tbs.py b/yt_dlp/extractor/tbs.py index e8a7c65e0..f7d7c1836 100644 --- a/yt_dlp/extractor/tbs.py +++ b/yt_dlp/extractor/tbs.py @@ -16,7 +16,7 @@ from ..utils import ( class TBSIE(TurnerBaseIE): - _VALID_URL = r'https?://(?:www\.)?(?Ptbs|tntdrama)\.com(?P/(?:movies|shows/[^/]+/(?:clips|season-\d+/episode-\d+))/(?P[^/?#]+))' + _VALID_URL = r'https?://(?:www\.)?(?Ptbs|tntdrama)\.com(?P/(?:movies|watchtnt|shows/[^/]+/(?:clips|season-\d+/episode-\d+))/(?P[^/?#]+))' _TESTS = [{ 'url': 'http://www.tntdrama.com/shows/the-alienist/clips/monster', 'info_dict': { @@ -45,7 +45,8 @@ class TBSIE(TurnerBaseIE): drupal_settings = self._parse_json(self._search_regex( r']+?data-drupal-selector="drupal-settings-json"[^>]*?>({.+?})', 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 + 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 -- cgit v1.2.3