aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshirt <shirt@shirt.rip>2022-08-12 19:40:49 -0400
committerGitHub <noreply@github.com>2022-08-13 05:10:49 +0530
commitffcd62c2899a7d0cd4aeceaed922d3d0a6c1c582 (patch)
treea62da0af26502f52ad2c8bc733c7a1e2b2e07deb
parenta1c5bd82eccf36ed239d368b86ac46db236ff9b1 (diff)
downloadhypervideo-pre-ffcd62c2899a7d0cd4aeceaed922d3d0a6c1c582.tar.lz
hypervideo-pre-ffcd62c2899a7d0cd4aeceaed922d3d0a6c1c582.tar.xz
hypervideo-pre-ffcd62c2899a7d0cd4aeceaed922d3d0a6c1c582.zip
[extractor/tubitv] Extract additional formats (#4646)
Authored by: shirt-dev
-rw-r--r--yt_dlp/extractor/tubitv.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/yt_dlp/extractor/tubitv.py b/yt_dlp/extractor/tubitv.py
index ea38162ae..d91a46500 100644
--- a/yt_dlp/extractor/tubitv.py
+++ b/yt_dlp/extractor/tubitv.py
@@ -70,16 +70,17 @@ class TubiTvIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
video_data = self._download_json(
- 'http://tubitv.com/oz/videos/%s/content' % video_id, video_id)
+ 'https://tubitv.com/oz/videos/%s/content?video_resources=dash&video_resources=hlsv3&video_resources=hlsv6' % video_id, video_id)
title = video_data['title']
formats = []
- url = video_data['url']
- # URL can be sometimes empty. Does this only happen when there is DRM?
- if url:
- formats = self._extract_m3u8_formats(
- self._proto_relative_url(url),
- video_id, 'mp4', 'm3u8_native')
+
+ for resource in video_data['video_resources']:
+ if resource['type'] in ('dash', ):
+ formats += self._extract_mpd_formats(resource['manifest']['url'], video_id, mpd_id=resource['type'], fatal=False)
+ elif resource['type'] in ('hlsv3', 'hlsv6'):
+ formats += self._extract_m3u8_formats(resource['manifest']['url'], video_id, 'mp4', m3u8_id=resource['type'], fatal=False)
+
self._sort_formats(formats)
thumbnails = []