Repository: yt-dlp/yt-dlp

Issue:
CBC Gem updated and now download is broken
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2023.02.17** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

Canada

### Provide a description that is worded well enough to be understood

I was able to download videos from CBC Gem a couple of days ago, but they've very recently (possibly only today) updated the website and how it displays the videos. As far as I can tell the URLs remain the same but the video will no longer download.

I tried downloading URLs I knew worked before and trying completely new URLs.


### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['--username', 'PRIVATE', '--password', 'PRIVATE', '--embed-subs', '--embed-metadata', '--embed-thumbnail', '-i', '-vU', 'https://gem.cbc.ca/nadiyas-family-favourites/s01e01']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.02.17 [a0a7c01] (pip)
[debug] Python 3.10.0 (CPython AMD64 64bit) - Windows-10-10.0.19044-SP0 (OpenSSL 1.1.1l  24 Aug 2021)
[debug] exe versions: ffmpeg 2021-10-28-git-e84c83ef98-full_build-www.gyan.dev (setts), ffprobe 2021-10-28-git-e84c83ef98-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.11.0, brotli-1.0.9, certifi-2021.10.08, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.0
[debug] Proxy map: {}
[debug] Loaded 1782 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.02.17, Current version: 2023.02.17
yt-dlp is up to date (2023.02.17)
[generic] Extracting URL: https://gem.cbc.ca/nadiyas-family-favourites/s01e01
[generic] s01e01: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] s01e01: Extracting information
[debug] Looking for embeds
WARNING: [generic] s01e01: Failed to parse JSON: Expecting property name enclosed in double quotes in '': line 1 column 2 (char 1)
ERROR: Unsupported URL: https://gem.cbc.ca/nadiyas-family-favourites/s01e01
Traceback (most recent call last):
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1502, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1578, in __extract_info
    ie_result = ie.extract(url)
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\extractor\common.py", line 693, in extract
    ie_result = self._real_extract(url)
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\extractor\generic.py", line 2509, in _real_extract
    raise UnsupportedError(url)
yt_dlp.utils.UnsupportedError: Unsupported URL: https://gem.cbc.ca/nadiyas-family-favourites/s01e01
```



Discussion:
yt-dlp will still work but since Wednesday it will only download 720p. You have to filter for m3u8 and pump that into your command instead of the old style URL. The metadata tags are now also not support but that's because of the m3u8. If anyone can fix this for 1080p it will be great!
@cagenuts  out of curiosity do you have Gem Premium? I wonder if 1080 is locked behind premium now?
Sadly I don't but I suspect that is the case now. 
@cagenuts  can you please provide command line you used that was successful for 720p?  I've run into a similar issue, but I want to confirm that it is different before raising a ticket.  I've tried a number of things and am now getting a Failed to parse JSON error in all cases.
The Nature of Things S62E08.
`yt-dlp "https://cbcrcott-gem.akamaized.net/be7489d5-5f73-4cd8-b845-1178f98051e7/CBC_THE_NATURE_OF_THINGS_S62E08.ism/desktop_master.m3u8?hdnea=st=1677839512~exp=1677839632~acl=/be7489d5-5f73-4cd8-b845-1178f98051e7/cbc_the_nature_of_things_s62e08.ism/desktop*~hmac=78059e97cfdc35919f4e065929c865f600f71d653357920d70d818961c29e5bb" --downloader aria2c --console-title -o "The Nature of Things.S62E08.mp4"`
It downloads 720p but chooses the audio described track so you have to specify `-f -f "audio-English"` to download the .m4a stream and then mux with the video later or choose the video stream and audio stream like this` 3687+audio-English`

The top command is all one string but somehow it doesn't wrap nicely here.
Thanks @cagenuts, appreciated!
Just got premium to try it out and it looks like this may be a Gem issue.
Switch the stream quality on the website produces no discernable difference in the video, and even with premium I can't find any higher quality streams than 720.
Gem may have removed their 1080 streams. This is concerning for paying customers since they're technically paying for full HD content but getting only 720. I may raise a ticket with CBC to see what they have to say.
@andelius Good idea to open a ticket. Everything is a mess to be honest. Metadata is not available anymore.
I created the CBC Gem downloader currently used by yt-dlp. I can try and look into fixing this issue in the next week or two.
> I created the CBC Gem downloader currently used by yt-dlp. I can try and look into fixing this issue in the next week or two.

Thank you, that would greatly appreciated.
Just add `/media/` after `https://gem.cbc.ca/`. This works with my free account:

```
[gem.cbc.ca] Extracting URL: https://gem.cbc.ca/media/nadiyas-family-favourites/s01e01
[gem.cbc.ca] nadiyas-family-favourites/s01e01: Downloading JSON metadata
[gem.cbc.ca] Downloading JSON metadata
[gem.cbc.ca] Downloading JSON metadata
[gem.cbc.ca] Downloading JSON metadata
[gem.cbc.ca] Downloading JSON metadata
[gem.cbc.ca] nadiyas-family-favourites/s01e01: Downloading JSON metadata
[gem.cbc.ca] nadiyas-family-favourites/s01e01: Downloading m3u8 information
[gem.cbc.ca] nadiyas-family-favourites/s01e01: Downloading secret XML
[info] nadiyas-family-favourites/s01e01: Downloading 1 format(s): sec-1080+hls-audio-English
[info] There's no subtitles for the requested languages
[hlsnative] Downloading m3u8 manifest
[hlsnative] Fragment downloads will be delegated to aria2c
[hlsnative] Total fragments: 291
```

The extractor cannot find subtitles any more, but you can use [CCExtractor](https://github.com/CCExtractor/ccextractor/releases/tag/v0.93) to get an SRT out of the embedded EIA subtitles. I add `--exec "\"C:\Program Files (x86)\CCExtractor\ccextractorwinfull.exe\" -autoprogram -trim --norollup"` to my `yt-dlp` command-line to have them automatically extracted after download.
Ok fix looks very simple, it's just that CBC's URLs changed to no longer have the `/media/` part. Thanks for the tip @JinglingB. Will make a PR today or so.

Resolving patch:
diff --git a/yt_dlp/extractor/cbc.py b/yt_dlp/extractor/cbc.py
--- a/yt_dlp/extractor/cbc.py
+++ b/yt_dlp/extractor/cbc.py
@@ -202,7 +202,7 @@ def _real_extract(self, url):
 
 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',
@@ -245,6 +245,9 @@ class CBCGemIE(InfoExtractor):
         },
         'params': {'format': 'bv'},
         'skip': 'Geo-restricted to Canada',
+    }, {
+        'url': 'https://gem.cbc.ca/nadiyas-family-favourites/s01e01',
+        'only_matching': True,
     }]
 
     _GEO_COUNTRIES = ['CA']


Test patch: