From 6bbbf7954dc80252365b0897bbe8f40e82f2d1bd Mon Sep 17 00:00:00 2001 From: ischmidt20 Date: Sat, 13 Apr 2024 21:34:41 -0400 Subject: [PATCH 1/3] add live truTV support in tbs.py --- yt_dlp/extractor/tbs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/tbs.py b/yt_dlp/extractor/tbs.py index 808c6c73d3..bc39935903 100644 --- a/yt_dlp/extractor/tbs.py +++ b/yt_dlp/extractor/tbs.py @@ -13,7 +13,7 @@ class TBSIE(TurnerBaseIE): - _VALID_URL = r'https?://(?:www\.)?(?Ptbs|tntdrama)\.com(?P/(?:movies|watchtnt|watchtbs|shows/[^/]+/(?:clips|season-\d+/episode-\d+))/(?P[^/?#]+))' + _VALID_URL = r'https?://(?:www\.)?(?Ptbs|tntdrama|trutv)\.com(?P/(?:movies|watchtnt|watchtbs|watchtrutv|shows/[^/]+/(?:clips|season-\d+/episode-\d+))/(?P[^/?#]+))' _TESTS = [{ 'url': 'http://www.tntdrama.com/shows/the-alienist/clips/monster', 'info_dict': { @@ -42,7 +42,7 @@ def _real_extract(self, url): drupal_settings = self._parse_json(self._search_regex( r']+?data-drupal-selector="drupal-settings-json"[^>]*?>({.+?})', webpage, 'drupal setting'), display_id) - isLive = 'watchtnt' in path or 'watchtbs' in path + isLive = 'watchtnt' in path or 'watchtbs' in path or 'watchtrutv' 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'] @@ -53,7 +53,7 @@ def _real_extract(self, url): info = self._extract_ngtv_info( media_id, tokenizer_query, { 'url': url, - 'site_name': site[:3].upper(), + 'site_name': {'tbs': 'TBS', 'tnt': 'TNT', 'trutv': 'truTV'}[site], 'auth_required': video_data.get('authRequired') == '1' or isLive, 'is_live': isLive }) From e942e36a87ac0d30a8481252303cf263ec4efc1f Mon Sep 17 00:00:00 2001 From: ischmidt20 Date: Tue, 16 Apr 2024 18:53:40 -0400 Subject: [PATCH 2/3] add test in extractor --- yt_dlp/extractor/tbs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yt_dlp/extractor/tbs.py b/yt_dlp/extractor/tbs.py index bc39935903..5e5fc44273 100644 --- a/yt_dlp/extractor/tbs.py +++ b/yt_dlp/extractor/tbs.py @@ -34,6 +34,9 @@ class TBSIE(TurnerBaseIE): }, { 'url': 'http://www.tntdrama.com/movies/star-wars-a-new-hope', 'only_matching': True, + }, { + 'url': 'https://www.trutv.com/watchtrutv/east', + 'only_matching': True, }] def _real_extract(self, url): From a8e239bd43fb7ca7644afd9480b4626ff1f58aeb Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Wed, 8 May 2024 22:44:43 +0000 Subject: [PATCH 3/3] add episode test --- yt_dlp/extractor/tbs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yt_dlp/extractor/tbs.py b/yt_dlp/extractor/tbs.py index 5e5fc44273..d1e26e682a 100644 --- a/yt_dlp/extractor/tbs.py +++ b/yt_dlp/extractor/tbs.py @@ -34,6 +34,9 @@ class TBSIE(TurnerBaseIE): }, { 'url': 'http://www.tntdrama.com/movies/star-wars-a-new-hope', 'only_matching': True, + }, { + 'url': 'https://www.trutv.com/shows/impractical-jokers/season-9/episode-1/you-dirty-dog', + 'only_matching': True, }, { 'url': 'https://www.trutv.com/watchtrutv/east', 'only_matching': True,