Compare commits

...

6 Commits

Author SHA1 Message Date
ischmidt20
4edb2fb2ad
Merge 3d60559deb into 4b5eec0aaa 2024-11-25 08:32:59 +05:30
Jakob Kruse
4b5eec0aaa
[ie/chaturbate] Fix support for non-public streams (#11624)
Fix bug in 720b3dc453

Closes #11623
Authored by: jkruse
2024-11-24 22:20:30 +00:00
bashonly
3d60559deb
Merge branch 'master' into trutv 2024-06-12 01:23:55 -05:00
bashonly
a8e239bd43
add episode test 2024-05-08 22:44:43 +00:00
ischmidt20
e942e36a87
add test in extractor 2024-04-16 18:53:40 -04:00
ischmidt20
6bbbf7954d
add live truTV support in tbs.py 2024-04-13 21:34:41 -04:00
2 changed files with 16 additions and 11 deletions

View File

@ -59,16 +59,15 @@ def _extract_from_api(self, video_id, tld):
'Accept': 'application/json',
}, fatal=False, impersonate=True) or {}
status = response.get('room_status')
if status != 'public':
if error := self._ERROR_MAP.get(status):
raise ExtractorError(error, expected=True)
self.report_warning('Falling back to webpage extraction')
return None
m3u8_url = response.get('url')
if not m3u8_url:
status = response.get('room_status')
if error := self._ERROR_MAP.get(status):
raise ExtractorError(error, expected=True)
if status == 'public':
self.raise_geo_restricted()
self.report_warning(f'Got status "{status}" from API; falling back to webpage extraction')
return None
return {
'id': video_id,

View File

@ -10,7 +10,7 @@
class TBSIE(TurnerBaseIE):
_VALID_URL = r'https?://(?:www\.)?(?P<site>tbs|tntdrama)\.com(?P<path>/(?:movies|watchtnt|watchtbs|shows/[^/]+/(?:clips|season-\d+/episode-\d+))/(?P<id>[^/?#]+))'
_VALID_URL = r'https?://(?:www\.)?(?P<site>tbs|tntdrama|trutv)\.com(?P<path>/(?:movies|watchtnt|watchtbs|watchtrutv|shows/[^/]+/(?:clips|season-\d+/episode-\d+))/(?P<id>[^/?#]+))'
_TESTS = [{
'url': 'http://www.tntdrama.com/shows/the-alienist/clips/monster',
'info_dict': {
@ -31,6 +31,12 @@ 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,
}]
def _real_extract(self, url):
@ -39,7 +45,7 @@ def _real_extract(self, url):
drupal_settings = self._parse_json(self._search_regex(
r'<script[^>]+?data-drupal-selector="drupal-settings-json"[^>]*?>({.+?})</script>',
webpage, 'drupal setting'), display_id)
is_live = 'watchtnt' in path or 'watchtbs' in path
is_live = 'watchtnt' in path or 'watchtbs' in path or 'watchtrutv' in path
video_data = next(v for v in drupal_settings['turner_playlist'] if is_live or v.get('url') == path)
media_id = video_data['mediaID']
@ -50,7 +56,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 is_live,
'is_live': is_live,
})