Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CBCPlayer #7484

Merged
merged 37 commits into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5943aef
On at least one site (CBC), the current method does an excellent job …
trainman261 Jun 22, 2023
4fbac25
...aaand stupid me forgot to take out the debugging code
trainman261 Jun 22, 2023
d00becb
Added tests, made it so that it doesn't only download m3u8 subtitles,…
trainman261 Jun 26, 2023
a4f279a
Merge remote-tracking branch 'origin/master'
trainman261 Jun 26, 2023
6392bd0
Fixed the tests so that they work again. They need thumbnail. chapter…
trainman261 Jun 27, 2023
8a11132
added note that one test video is no longer available
trainman261 Jun 27, 2023
a47c86f
Fixed a stupid mistake while merging changes
trainman261 Jun 27, 2023
4cbbffe
Trying to fix up theplatform tests, but many of these lack proper doc…
trainman261 Jun 28, 2023
dff85ac
Merge branch 'theplatform-fixtests' into cbcplayer
trainman261 Jun 28, 2023
632dfee
Merge branch 'cbcplayer-fixtests' into cbcplayer
trainman261 Jun 28, 2023
5f7df17
The previous fix caused some regressions on other videos. This way ar…
trainman261 Jun 30, 2023
9f5d60f
Fixed some formatting issues identified by flak8
trainman261 Jun 30, 2023
fb74f5f
fixed the double quote issue
trainman261 Jul 1, 2023
b7f7e32
check the URL to see if it's an m3u8 file before actually downloading…
trainman261 Jul 6, 2023
5f08470
Merge branch 'yt-dlp:master' into cbcplayer
trainman261 Jul 6, 2023
a05347c
Merge branch 'yt-dlp:master' into cbcplayer
trainman261 Jul 19, 2023
f7c6713
Update yt_dlp/extractor/theplatform.py
pukkandan Jul 21, 2023
f736560
Merge branch 'yt-dlp:master' into cbcplayer
trainman261 Jul 22, 2023
3b80858
Merge branch 'yt-dlp:master' into cbcplayer
trainman261 Jul 26, 2023
9e34e40
Update yt_dlp/extractor/theplatform.py
trainman261 Jul 26, 2023
a0f4151
Update yt_dlp/extractor/theplatform.py
pukkandan Jul 28, 2023
0ea7897
Updated the test video for subtitles/captions
trainman261 Jul 29, 2023
302403a
Update yt_dlp/extractor/theplatform.py
trainman261 Jul 29, 2023
fe1afea
import
bashonly Jul 29, 2023
acc72e1
Better format_id
bashonly Jul 29, 2023
36253f2
Added a try except block around the check the extension detection, si…
trainman261 Jul 29, 2023
4813bea
Update yt_dlp/extractor/cbc.py
trainman261 Jul 29, 2023
348a018
Update yt_dlp/extractor/theplatform.py
trainman261 Jul 29, 2023
d5c2947
Update yt_dlp/extractor/theplatform.py
trainman261 Jul 29, 2023
80498e2
Update yt_dlp/extractor/theplatform.py
trainman261 Jul 29, 2023
d36f7b9
Revert "Added a try except block around the check the extension detec…
trainman261 Jul 29, 2023
13b56e1
Shortened the commend about prioritising HTTP over HLS
trainman261 Jul 29, 2023
6814cbd
Update yt_dlp/extractor/theplatform.py
trainman261 Jul 29, 2023
fb6646f
Committing just this line for cbcplayer. The rest of the fixes are in…
trainman261 Jul 29, 2023
f82aa89
simplify
bashonly Jul 29, 2023
a37ac8c
Merge branch 'yt-dlp:master' into pr/7484
bashonly Jul 29, 2023
e295fe5
Comment
bashonly Jul 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 27 additions & 1 deletion yt_dlp/extractor/cbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class CBCPlayerIE(InfoExtractor):
'upload_date': '20160210',
'uploader': 'CBCC-NEW',
},
'skip': 'Geo-restricted to Canada',
'skip': 'Geo-restricted to Canada and no longer available',
}, {
# Redirected from http://www.cbc.ca/player/AudioMobile/All%20in%20a%20Weekend%20Montreal/ID/2657632011/
'url': 'http://www.cbc.ca/player/play/2657631896',
Expand All @@ -174,6 +174,9 @@ class CBCPlayerIE(InfoExtractor):
'timestamp': 1425704400,
'upload_date': '20150307',
'uploader': 'CBCC-NEW',
'thumbnail': 'http://thumbnails.cbc.ca/maven_legacy/thumbnails/sonali-karnick-220.jpg',
'chapters': [],
'duration': 494.811,
},
}, {
'url': 'http://www.cbc.ca/player/play/2164402062',
Expand All @@ -186,6 +189,28 @@ class CBCPlayerIE(InfoExtractor):
'timestamp': 1320410746,
'upload_date': '20111104',
'uploader': 'CBCC-NEW',
'thumbnail': 'https://thumbnails.cbc.ca/maven_legacy/thumbnails/277/67/cancer_852x480_2164412612.jpg',
'chapters': [],
'duration': 186.867,
},
}, {
# Has subtitles
# These broadcasts expire after ~1 month, can find new test URL here:
# https://www.cbc.ca/player/news/TV%20Shows/The%20National/Latest%20Broadcast
'url': 'http://www.cbc.ca/player/play/2249992771553',
'md5': '2f2fb675dd4f0f8a5bb7588d1b13bacd',
'info_dict': {
'id': '2249992771553',
'ext': 'mp4',
'title': 'The National | Women’s soccer pay, Florida seawater, Swift quake',
'description': 'md5:adba28011a56cfa47a080ff198dad27a',
'timestamp': 1690596000,
'duration': 2716.333,
'subtitles': {'eng': [{'ext': 'vtt', 'protocol': 'm3u8_native'}]},
'thumbnail': 'https://thumbnails.cbc.ca/maven_legacy/thumbnails/481/326/thumbnail.jpeg',
'uploader': 'CBCC-NEW',
'chapters': 'count:5',
'upload_date': '20230729',
},
}]

Expand All @@ -199,6 +224,7 @@ def _real_extract(self, url):
'force_smil_url': True
}),
'id': video_id,
'_format_sort_fields': ('res', 'proto') # Prioritize direct http formats over HLS
}


Expand Down
1 change: 1 addition & 0 deletions yt_dlp/extractor/scrippsnetworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class ScrippsNetworksIE(InfoExtractor):
'uploader': 'SCNI-SCND',
},
'add_ie': ['ThePlatform'],
'expected_warnings': ['No HLS formats found'],
}, {
'url': 'https://www.diynetwork.com/videos/diy-barnwood-tablet-stand-0265790',
'only_matching': True,
Expand Down
22 changes: 20 additions & 2 deletions yt_dlp/extractor/theplatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
xpath_with_ns,
mimetype2ext,
find_xpath_attr,
traverse_obj,
update_url,
urlhandle_detect_ext,
pukkandan marked this conversation as resolved.
Show resolved Hide resolved
)
from ..networking import HEADRequest

default_ns = 'http://www.w3.org/2005/SMIL21/Language'
_x = lambda p: xpath_with_ns(p, {'smil': default_ns})
Expand Down Expand Up @@ -162,7 +166,8 @@ class ThePlatformIE(ThePlatformBaseIE, AdobePassIE):
'params': {
# rtmp download
'skip_download': True,
}
},
'skip': '404 Not Found',
}, {
'url': 'https://player.theplatform.com/p/D6x-PC/pulse_preview/embed/select/media/yMBg9E8KFxZD',
'info_dict': {
Expand All @@ -171,7 +176,8 @@ class ThePlatformIE(ThePlatformBaseIE, AdobePassIE):
'description': 'md5:644ad9188d655b742f942bf2e06b002d',
'title': 'HIGHLIGHTS: USA bag first ever series Cup win',
'uploader': 'EGSM',
}
},
'skip': '404 Not Found',
}, {
'url': 'http://player.theplatform.com/p/NnzsPC/widget/select/media/4Y0TlYUr_ZT7',
'only_matching': True,
Expand All @@ -189,6 +195,7 @@ class ThePlatformIE(ThePlatformBaseIE, AdobePassIE):
'upload_date': '20150701',
'uploader': 'NBCU-NEWS',
},
'skip': '404 Not Found',
}, {
# From http://www.nbc.com/the-blacklist/video/sir-crispin-crandall/2928790?onid=137781#vc137781=1
# geo-restricted (US), HLS encrypted with AES-128
Expand Down Expand Up @@ -295,6 +302,17 @@ def _real_extract(self, url):

formats, subtitles = self._extract_theplatform_smil(smil_url, video_id)

# With some sites, manifest URL must be forced to extract HLS formats
if not traverse_obj(formats, lambda _, v: v['format_id'].startswith('hls')):
m3u8_url = update_url(url, query='mbr=true&manifest=m3u', fragment=None)
urlh = self._request_webpage(
HEADRequest(m3u8_url), video_id, 'Checking for HLS formats', 'No HLS formats found', fatal=False)
if urlh and urlhandle_detect_ext(urlh) == 'm3u8':
m3u8_fmts, m3u8_subs = self._extract_m3u8_formats_and_subtitles(
m3u8_url, video_id, m3u8_id='hls', fatal=False)
formats.extend(m3u8_fmts)
self._merge_subtitles(m3u8_subs, target=subtitles)

ret = self._extract_theplatform_metadata(path, video_id)
combined_subtitles = self._merge_subtitles(ret.get('subtitles', {}), subtitles)
ret.update({
Expand Down