Repository: yt-dlp/yt-dlp
Issue category: Bug Report

Issue:
New domain for ccma (ccma.cat -> 3cat.cat)
### 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 that yt-dlp is broken on a **supported** site
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [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

World

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

The site changed the domain from ccma.cat to 3cat.cat
If you put any url in the browser from ccma.cat it redirects to the 3cat.cat one
If you put a 3cat.cat link in yt-dlp it doesn't work, but if the link is the old ccma.cat it works

### 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
yt-dlp.exe https://www.3cat.cat/3cat/lespot-de-la-marato-de-tv3/video/5630208/ -vU
[debug] Command-line config: ['https://www.3cat.cat/3cat/lespot-de-la-marato-de-tv3/video/5630208/', '-vU']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.09.27 from yt-dlp/yt-dlp [c6387abc1] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg git-2020-04-20-cacdac8, ffprobe git-2020-04-20-cacdac8
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.08.30, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.35.5, urllib3-2.2.3, websockets-13.1
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1838 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.09.27 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.09.27 from yt-dlp/yt-dlp)
[generic] Extracting URL: https://www.3cat.cat/3cat/lespot-de-la-marato-de-tv3/video/5630208/
[generic] 5630208: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] 5630208: Extracting information
[debug] Looking for embeds
ERROR: Unsupported URL: https://www.3cat.cat/3cat/lespot-de-la-marato-de-tv3/video/5630208/
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1626, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1761, in __extract_info
  File "yt_dlp\extractor\common.py", line 741, in extract
  File "yt_dlp\extractor\generic.py", line 2526, in _real_extract
yt_dlp.utils.UnsupportedError: Unsupported URL: https://www.3cat.cat/3cat/lespot-de-la-marato-de-tv3/video/5630208/
```



Hints:

Patch:
diff --git a/yt_dlp/extractor/ccma.py b/yt_dlp/extractor/ccma.py
index ffe4b49c15d9..7014c208d43a 100644
--- a/yt_dlp/extractor/ccma.py
+++ b/yt_dlp/extractor/ccma.py
@@ -12,53 +12,86 @@
 
 
 class CCMAIE(InfoExtractor):
-    _VALID_URL = r'https?://(?:www\.)?ccma\.cat/(?:[^/]+/)*?(?P<type>video|audio)/(?P<id>\d+)'
+    IE_DESC = '3Cat, TV3 and Catalunya Ràdio'
+    _VALID_URL = r'https?://(?:www\.)?3cat\.cat/(?:3cat|tv3/sx3)/[^/?#]+/(?P<type>video|audio)/(?P<id>\d+)'
     _TESTS = [{
-        'url': 'http://www.ccma.cat/tv3/alacarta/lespot-de-la-marato-de-tv3/lespot-de-la-marato-de-tv3/video/5630208/',
+        # ccma.cat/tv3/alacarta/ URLs redirect to 3cat.cat/3cat/
+        'url': 'https://www.3cat.cat/3cat/lespot-de-la-marato-de-tv3/video/5630208/',
         'md5': '7296ca43977c8ea4469e719c609b0871',
         'info_dict': {
             'id': '5630208',
             'ext': 'mp4',
-            'title': 'L\'espot de La Marató de TV3',
+            'title': 'L\'espot de La Marató 2016: Ictus i les lesions medul·lars i cerebrals traumàtiques',
             'description': 'md5:f12987f320e2f6e988e9908e4fe97765',
             'timestamp': 1478608140,
             'upload_date': '20161108',
             'age_limit': 0,
+            'alt_title': 'EsportMarató2016WEB_PerPublicar',
+            'duration': 79,
+            'thumbnail': 'https://img.3cat.cat/multimedia/jpg/4/6/1478536106664.jpg',
+            'series': 'Dedicada a l\'ictus i les lesions medul·lars i cerebrals traumàtiques',
+            'categories': ['Divulgació'],
         },
     }, {
-        'url': 'http://www.ccma.cat/catradio/alacarta/programa/el-consell-de-savis-analitza-el-derbi/audio/943685/',
+        # ccma.cat/catradio/alacarta/ URLs redirect to 3cat.cat/3cat/
+        'url': 'https://www.3cat.cat/3cat/el-consell-de-savis-analitza-el-derbi/audio/943685/',
         'md5': 'fa3e38f269329a278271276330261425',
         'info_dict': {
             'id': '943685',
             'ext': 'mp3',
             'title': 'El Consell de Savis analitza el derbi',
             'description': 'md5:e2a3648145f3241cb9c6b4b624033e53',
-            'upload_date': '20170512',
-            'timestamp': 1494622500,
+            'upload_date': '20161217',
+            'timestamp': 1482011700,
             'vcodec': 'none',
             'categories': ['Esports'],
+            'series': 'Tot gira',
+            'duration': 821,
+            'thumbnail': 'https://img.3cat.cat/multimedia/jpg/8/9/1482002602598.jpg',
         },
     }, {
-        'url': 'http://www.ccma.cat/tv3/alacarta/crims/crims-josep-tallada-lespereu-me-capitol-1/video/6031387/',
-        'md5': 'b43c3d3486f430f3032b5b160d80cbc3',
+        'url': 'https://www.3cat.cat/3cat/crims-josep-tallada-lespereu-me-part-1/video/6031387/',
+        'md5': '27493513d08a3e5605814aee9bb778d2',
         'info_dict': {
             'id': '6031387',
             'ext': 'mp4',
-            'title': 'Crims - Josep Talleda, l\'"Espereu-me" (capítol 1)',
+            'title': 'T1xC5 - Josep Talleda, l\'"Espereu-me" (part 1)',
             'description': 'md5:7cbdafb640da9d0d2c0f62bad1e74e60',
-            'timestamp': 1582577700,
+            'timestamp': 1582577919,
             'upload_date': '20200224',
-            'subtitles': 'mincount:4',
-            'age_limit': 16,
+            'subtitles': 'mincount:1',
+            'age_limit': 13,
             'series': 'Crims',
+            'thumbnail': 'https://img.3cat.cat/multimedia/jpg/1/9/1582564376991.jpg',
+            'duration': 3203,
+            'categories': ['Divulgació'],
+            'alt_title': 'Crims - 5 - Josep Talleda, l\'"Espereu-me" (1a part) - Josep Talleda, l\'"Espereu-me" (part 1)',
+            'episode_number': 5,
+            'episode': 'Episode 5',
+        },
+    }, {
+        'url': 'https://www.3cat.cat/tv3/sx3/una-mosca-volava-per-la-llum/video/5759227/',
+        'info_dict': {
+            'id': '5759227',
+            'ext': 'mp4',
+            'title': 'Una mosca volava per la llum',
+            'alt_title': '17Z004Ç UNA MOSCA VOLAVA PER LA LLUM',
+            'description': 'md5:9ab64276944b0825336f4147f13f7854',
+            'series': 'Mic',
+            'upload_date': '20180411',
+            'timestamp': 1523440105,
+            'duration': 160,
+            'age_limit': 0,
+            'thumbnail': 'https://img.3cat.cat/multimedia/jpg/6/1/1524071667216.jpg',
+            'categories': ['Música'],
         },
     }]
 
     def _real_extract(self, url):
-        media_type, media_id = self._match_valid_url(url).groups()
+        media_type, media_id = self._match_valid_url(url).group('type', 'id')
 
         media = self._download_json(
-            'http://dinamics.ccma.cat/pvideo/media.jsp', media_id, query={
+            'http://api-media.3cat.cat/pvideo/media.jsp', media_id, query={
                 'media': media_type,
                 'idint': media_id,
                 'format': 'dm',


Test patch: