-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
CBC gem unsupported URL error #8382
Comments
Workaround: pass the URL as The CBC Gem extractor and the CBC Gem API always expect a We could do something like this: diff --git a/yt_dlp/extractor/cbc.py b/yt_dlp/extractor/cbc.py
index be2d13e44..c0fd4d888 100644
--- a/yt_dlp/extractor/cbc.py
+++ b/yt_dlp/extractor/cbc.py
@@ -264,7 +264,7 @@ def entries():
class CBCGemIE(InfoExtractor):
IE_NAME = 'gem.cbc.ca'
- _VALID_URL = r'https?://gem\.cbc\.ca/(?:media/)?(?P<id>[0-9a-z-]+/s[0-9]+[a-z][0-9]+)'
+ _VALID_URL = r'https?://gem\.cbc\.ca/(?:media/)?(?P<id>[0-9a-z-]+(?:/s[0-9]+[a-z][0-9]+)?)/?(?:$|[#?])'
_TESTS = [{
# This is a normal, public, TV show video
'url': 'https://gem.cbc.ca/media/schitts-creek/s06e01',
@@ -411,6 +411,8 @@ def _find_secret_formats(self, formats, video_id):
def _real_extract(self, url):
video_id = self._match_id(url)
+ if '/' not in video_id:
+ video_id += '/s01e01'
video_info = self._download_json(
f'https://services.radio-canada.ca/ott/cbc-api/v2/assets/{video_id}',
video_id, expected_status=426) although it would have the side effect of also matching URLs like also, when I was experimenting with the extractor, I noticed that the diff --git a/yt_dlp/extractor/cbc.py b/yt_dlp/extractor/cbc.py
index be2d13e44..d6bc7db02 100644
--- a/yt_dlp/extractor/cbc.py
+++ b/yt_dlp/extractor/cbc.py
@@ -461,8 +461,8 @@ def _real_extract(self, url):
'duration': video_info.get('duration'),
'categories': [video_info.get('category')],
'formats': formats,
- 'release_timestamp': video_info.get('airDate'),
- 'timestamp': video_info.get('availableDate'),
+ 'release_timestamp': int_or_none(video_info.get('airDate'), scale=1000),
+ 'timestamp': int_or_none(video_info.get('availableDate'), scale=1000),
}
|
What does the website append to API calls? Imo we should try to emulate the website when possible
My guess would be that those would currently fail, and would continue to fail, so it doesn't really matter |
it appends
|
Thanks for the workaround. I'm able to download the video this way. As for the proposed fix, if I may add my two cents.. this would also cause urls like https://gem.cbc.ca/the-passionate-eye/ to implicitly go and download s01e01, would it not? May or may not be desirable 🤷♂️ |
Correct. Although full series links are not currently supported, either; only individual season links are supported. Maybe the best solution would be to implement a full series extractor, which would process these films/specials as 1 episode playlists |
Sounds good to me :) |
Working on this now, looks like I can just use the Next.js JSON in the HTML to figure out whether the URL is for a standalone video (like this issue is about) or a series. |
Ok I've opened a PR that should address this: #8790 |
DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
Checklist
Region
Canada
Provide a description that is worded well enough to be understood
I get an "unsupported url" error when trying to download from a supported site, gem.cbc.ca.
Expected outcome: the video should download.
I'll note cbc gem isn't completely broken. I also tried to download https://gem.cbc.ca/the-passionate-eye/s03e06, and that one worked.
Provide verbose output that clearly demonstrates the problem
yt-dlp -vU <your command line>
)'verbose': True
toYoutubeDL
params instead[debug] Command-line config
) and insert it belowComplete Verbose Output
The text was updated successfully, but these errors were encountered: