Closed makew0rld closed 3 years ago
Is not because geo-blocking, gem changed url schemes. An old url I have still works, but you can't seem to get it via GEM anymore. I did trhis test on a Toronto VPN
URL retrieved a couple weeks ago--
https://gem.cbc.ca/media/heartland/season-14/episode-1/38e815a-0137fd5e960
URL GEM gives now--
https://gem.cbc.ca/media/heartland/s14e01
Looks like CBC just overhauled their streaming site. They no longer offer 1080p unless you use their app https://cbchelp.cbc.ca/hc/en-ca/articles/115003511913-Is-HD-high-definition-video-available-Adjusting-Gem-streaming-quality-
The geo-blocked
tag does not mean your issue is caused due to geo-blocking, just that I am unable to access the site. If you can give details of a proxy that works, then I can investigate further
I use vpervpn to access cbc, it does only seem to offer up to 720p for videos now. I guess you could use www.vpngate.net for testing though
The fact they don't offer 1080p anymore is irrelevant to my issue. It seems like @jpenguin is right and the URLs that have changed. I'm not sure what this means in terms of the backend, but I might be able to look into it.
yt-dlp can also get rid of the CBCOlympicsIE
class, as olympics.cbc.ca
is no longer used by CBC and the links don't work anymore.
Looks like the backend is totally different as well.
Here's what my browser does, which is easily repeatable with curl as you can see below. The URL is https://gem.cbc.ca/media/schitts-creek/s06e01
# URL for each episode that returns JSON with info.
# It contains all the metadata you'd need, like title, description, thumbnail, season, episode, duration, age rating, and category.
curl -sS https://services.radio-canada.ca/ott/cbc-api/v2/assets/schitts-creek/s06e01 | jq -r '.playSession.url'
https://services.radio-canada.ca/media/validation/v2?appCode=gem&idMedia=163782&manifestType=desktop&output=json&tech=hls
# Now retrieve that URL, and pick out the URL within the JSON it gives
curl -sS https://services.radio-canada.ca/media/validation/v2\?appCode\=gem\&idMedia\=163782\&manifestType\=desktop\&output\=json\&tech\=hls | jq -r '.url'
https://cbcrcott-gem.akamaized.net/293c48a1-3e1b-4818-b65e-db1445af5674/CBC_SCHITTS_CREEK_S06E01.ism/desktop_master.m3u8?hdnea=st=1631727266~exp=1631727386~acl=*~hmac=501f0c05c526ca545d3524b07a919febcb7bac9c1cb9771e00d732c7e1be54de
That final URL returns an m3u8 file that looks like this:
#EXTM3U
#EXT-X-VERSION:4
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="English",LANGUAGE="eng",DEFAULT=YES,AUTOSELECT=YES,URI="QualityLevels(192000)/Manifest(audio_eng_aacl,format=m3u8-aapl,filter=desktop)"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="English (Descriptive)",LANGUAGE="eng",AUTOSELECT=YES,CHARACTERISTICS="public.accessibility.describes-video",URI="QualityLevels(192000)/Manifest(audiodv_eng_aacl,format=m3u8-aapl,filter=desktop)"
#EXT-X-MEDIA:TYPE=CLOSED-CAPTIONS,GROUP-ID="CC",LANGUAGE="en",NAME="English",DEFAULT=YES,AUTOSELECT=YES,INSTREAM-ID="CC1"
#EXT-X-STREAM-INF:BANDWIDTH=2767619,RESOLUTION=1280x720,CODECS="avc1.4d401f,mp4a.40.2",AUDIO="audio",CLOSED-CAPTIONS="CC"
QualityLevels(2500074)/Manifest(video,format=m3u8-aapl,filter=desktop)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=2767619,RESOLUTION=1280x720,CODECS="avc1.4d401f",URI="QualityLevels(2500074)/Manifest(video,format=m3u8-aapl,filter=desktop,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=3687864,RESOLUTION=1280x720,CODECS="avc1.4d401f,mp4a.40.2",AUDIO="audio",CLOSED-CAPTIONS="CC"
QualityLevels(3400509)/Manifest(video,format=m3u8-aapl,filter=desktop)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=3687864,RESOLUTION=1280x720,CODECS="avc1.4d401f",URI="QualityLevels(3400509)/Manifest(video,format=m3u8-aapl,filter=desktop,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=2052428,RESOLUTION=960x540,CODECS="avc1.4d401f,mp4a.40.2",AUDIO="audio",CLOSED-CAPTIONS="CC"
QualityLevels(1800278)/Manifest(video,format=m3u8-aapl,filter=desktop)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=2052428,RESOLUTION=960x540,CODECS="avc1.4d401f",URI="QualityLevels(1800278)/Manifest(video,format=m3u8-aapl,filter=desktop,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=1234564,RESOLUTION=640x360,CODECS="avc1.42c01e,mp4a.40.2",AUDIO="audio",CLOSED-CAPTIONS="CC"
QualityLevels(1000020)/Manifest(video,format=m3u8-aapl,filter=desktop)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=1234564,RESOLUTION=640x360,CODECS="avc1.42c01e",URI="QualityLevels(1000020)/Manifest(video,format=m3u8-aapl,filter=desktop,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=825755,RESOLUTION=640x360,CODECS="avc1.42c01e,mp4a.40.2",AUDIO="audio",CLOSED-CAPTIONS="CC"
QualityLevels(600011)/Manifest(video,format=m3u8-aapl,filter=desktop)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=825755,RESOLUTION=640x360,CODECS="avc1.42c01e",URI="QualityLevels(600011)/Manifest(video,format=m3u8-aapl,filter=desktop,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=621427,RESOLUTION=416x234,CODECS="avc1.42c00d,mp4a.40.2",AUDIO="audio",CLOSED-CAPTIONS="CC"
QualityLevels(400082)/Manifest(video,format=m3u8-aapl,filter=desktop)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=621427,RESOLUTION=416x234,CODECS="avc1.42c00d",URI="QualityLevels(400082)/Manifest(video,format=m3u8-aapl,filter=desktop,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=204384,CODECS="mp4a.40.2",AUDIO="audio",CLOSED-CAPTIONS="CC"
QualityLevels(192000)/Manifest(audiodv_eng_aacl,format=m3u8-aapl,filter=desktop)
As you can see, all the streams are there, with information on each of them. I couldn't get VLC to play from the m3u8 URL, but ffplay
(an ffmpeg tool) handled it just fine.
I'm working on a PR for this. Will update the thread when it's published.
I haven't looked into live streams yet, but will update if I do. Same with getting subtitles.
@pukkandan @Ashish0804 I'm getting a "Requested format is not available" error with my PR code so far. Can you help? Should I open a draft PR or regular PR instead of discussing it here?
The in-progress code is available here. An example of the retrieved m3u8 file is in my comment above. Both ffplay
and mpv
can play the m3u8 file fine, so yt-dlp should be able to get it. I think the issue might be that none of the output formats are recognized as having both audio and video together, even though the m3u8 file indicates they're available. I think it might be because of these lines (not sure though):
try adding
'params': {'format': 'bv',}
To the test
Thanks, that worked. I will submit my PR when it's done.
PR submitted: #1013
Should this support Subtitles?? I don't seem to be getting them anymore but I sure did for the old way things downloaded.
Oh I see it's now embeded in video - will require extraction. Sorry for any confusion!! We may want to do some login code for CBC, but I know my old login code I tried to get working was for clearleap, so that won't work now.
@mshiels yep, the subtitles are embedded in the video. The video comes with multiple subtitle tracks, but it seems only the first one has any content I think.
As for login, it isn't needed anymore. CBC logged-in content can be accessed without a username and password.
I am really glad I checked out yt-dlp since I was about to try and do the exact same thing you just did, which means now I can concentrate on trying to get my acorn.tv one working again - something is wrong and it's been way too long since I worked on it to tell what's up. Thanks for your work on this for sure!!!!
Checklist
Verbose log
Error when downloading live content: (will need a different URL once this stream is no longer live. Live stream links can be obtained from https://gem.cbc.ca but will be geo-blocked to Canada)
Error when downloading non-live news content:
Error when downloading a TV show that does not require login:
I assume additional functionality will be fixed when this is fixed, such as news and TV show playlists, as well as downloading logged in content, which was all working on youtube-dl previously. youtube-dl still has the same issue now though.
Description
None of the videos are downloading, and additionally all the non-live content is not being recognized as CBC, so the generic extractor is being used instead, incorrectly.
Thanks a lot for maintaining yt-dlp!