Repository: yt-dlp/yt-dlp

Issue:
[ina.fr] some link structures come up as unsupported, while others work
### Checklist

- [X] I'm reporting a bug unrelated to a specific site
- [X] I've verified that I'm running yt-dlp version **2022.07.18** ([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/ytdl-org/youtube-dl#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 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)

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


Test link:
https://www.ina.fr/ina-eclaire-actu/arletty-carriere-conseils-actrice-marcel-carne

Results as unsupported, while other's seem to work. Maybe, some improvement in regex of test case needed..

Manually extracted and downloaded video via this link eventually: 
https://media-hub.ina.fr/video/z3tU1+BVR4+BmI7Y9JILCUg77yNX7/0QvIXegFnUfrHlyAUAYHiClCbJ6GkrC9SftbgzUW5iC+v3tfYyWWjwWOUt0rJCu5N7K/rUD9neBj2n53PFBKPj9eZN8kVoOM6h/sl_iv/nq9SttsGT5I8j7lWy03cRg==/sl_hm/jptv3fl8Y2UpHPIwNABCb0EsLk2LQu1tmwI8afa4LqbUA2D7b7a34J5qRF+zRk/g+pfSRwweBcBARq4UjbPqhw==/sl_e/1659798528

However this link and some other with the same link structure seem to work fine:
https://www.ina.fr/ina-eclaire-actu/video/i12055569/francois-hollande-je-crois-que-c-est-clair


### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
./yt-dlp -vU -F "https://www.ina.fr/ina-eclaire-actu/arletty-carriere-conseils-actrice-marcel-carne"
[debug] Command-line config: ['-vU', '-F', 'https://www.ina.fr/ina-eclaire-actu/arletty-carriere-conseils-actrice-marcel-carne']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.06.29 [9d339c41e] (zip)
[debug] Plugins: ['SamplePluginIE', 'SamplePluginPP']
[debug] Python 3.9.13 (CPython 64bit) - macOS-12.4-arm64-arm-64bit 
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: avconv -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] Checking exe version: avprobe -bsfs
[debug] exe versions: none
[debug] Optional libraries: sqlite3-2.6.0
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2022.07.18, Current version: 2022.06.29
[debug] Downloading _update_spec from https://github.com/yt-dlp/yt-dlp/releases/download/2022.07.18/_update_spec
Current Build Hash f79b9efc8afc0f5169475e1c6b60fa5083497315b83d54b603aecc5813c46f6a
Updating to version 2022.07.18 ...
[debug] Downloading yt-dlp from https://github.com/yt-dlp/yt-dlp/releases/download/2022.07.18/yt-dlp
[debug] Downloading SHA2-256SUMS from https://github.com/yt-dlp/yt-dlp/releases/download/2022.07.18/SHA2-256SUMS
Updated yt-dlp to version 2022.07.18
WARNING: Restart yt-dlp to use the updated version
[debug] [generic] Extracting URL: https://www.ina.fr/ina-eclaire-actu/arletty-carriere-conseils-actrice-marcel-carne
[generic] arletty-carriere-conseils-actrice-marcel-carne: Downloading webpage
WARNING: [generic] Falling back on generic information extractor.
[generic] arletty-carriere-conseils-actrice-marcel-carne: Extracting information
[debug] Looking for video embeds
ERROR: Unsupported URL: https://www.ina.fr/ina-eclaire-actu/arletty-carriere-conseils-actrice-marcel-carne
Traceback (most recent call last):
  File "./yt-dlp/yt_dlp/YoutubeDL.py", line 1431, in wrapper
  File "./yt-dlp/yt_dlp/YoutubeDL.py", line 1506, in __extract_info
  File "./yt-dlp/yt_dlp/extractor/common.py", line 645, in extract
  File "./yt-dlp/yt_dlp/extractor/generic.py", line 4108, in _real_extract
yt_dlp.utils.UnsupportedError: Unsupported URL: https://www.ina.fr/ina-eclaire-actu/arletty-carriere-conseils-actrice-marcel-carne
```



Discussion:
The webpage format is the same but the `video_id` has to be extracted from the page, eg from 'og:image' meta element.

Resolving patch:
diff --git a/yt_dlp/extractor/ina.py b/yt_dlp/extractor/ina.py
--- a/yt_dlp/extractor/ina.py
+++ b/yt_dlp/extractor/ina.py
@@ -3,7 +3,7 @@
 
 
 class InaIE(InfoExtractor):
-    _VALID_URL = r'https?://(?:(?:www|m)\.)?ina\.fr/(?:[^/]+/)?(?:video|audio)/(?P<id>\w+)'
+    _VALID_URL = r'https?://(?:(?:www|m)\.)?ina\.fr/(?:[^?#]+/)(?P<id>[\w-]+)'
     _TESTS = [{
         'url': 'https://www.ina.fr/video/I12055569/francois-hollande-je-crois-que-c-est-clair-video.html',
         'md5': 'c5a09e5cb5604ed10709f06e7a377dda',
@@ -11,7 +11,7 @@ class InaIE(InfoExtractor):
             'id': 'I12055569',
             'ext': 'mp4',
             'title': 'François Hollande "Je crois que c\'est clair"',
-            'description': 'md5:08201f1c86fb250611f0ba415d21255a',
+            'description': 'md5:19f61e2b4844ed4bb2e3df9ab9f527ff',
             'upload_date': '20070712',
             'thumbnail': 'https://cdn-hub.ina.fr/notice/690x517/3c4/I12055569.jpeg',
         }
@@ -38,21 +38,42 @@ class InaIE(InfoExtractor):
             'upload_date': '19821204',
             'duration': 657,
             'thumbnail': 'https://cdn-hub.ina.fr/notice/690x517/203/CPB8205116303.jpeg',
-        }
+        },
+    }, {
+        'url': 'https://www.ina.fr/ina-eclaire-actu/arletty-carriere-conseils-actrice-marcel-carne',
+        'md5': '743d6f069a00e19dda0da166a54eeccb',
+        'info_dict': {
+            'id': 'I22203233',
+            'ext': 'mp4',
+            'title': 'Arletty sur le métier d\'actrice',
+            'description': 'md5:3d89b5e419d8514c934f146045ccdbad',
+            'upload_date': '19581128',
+            'thumbnail': 'https://cdn-hub.ina.fr/notice/690x517/082/I22203233.jpeg',
+        },
+    }, {
+        'url': 'https://www.ina.fr/ina-eclaire-actu/chasse-croise-sncf-gare-d-austerlitz-vacances-d-ete',
+        'md5': 'a96fb85e9ba3b5c5b2eeb0c5daa55f2f',
+        'info_dict': {
+            'id': 'CAF91038285',
+            'ext': 'mp4',
+            'title': 'Les grands départs : les trains',
+            'description': 'md5:1630ee819d8d4da97df53459e99f72bb',
+            'upload_date': '19740801',
+            'thumbnail': 'https://cdn-hub.ina.fr/notice/690x517/2cf/CAF91038285.jpeg',
+        },
     }]
 
     def _real_extract(self, url):
-        video_id = self._match_id(url).upper()
-        webpage = self._download_webpage(url, video_id)
+        display_id = self._match_id(url)
+        webpage = self._download_webpage(url, display_id)
 
-        api_url = self._html_search_regex(
-            r'asset-details-url\s*=\s*["\'](?P<api_url>[^"\']+)',
-            webpage, 'api_url').replace(video_id, f'{video_id}.json')
+        api_url = self._html_search_regex(r'asset-details-url\s*=\s*["\'](?P<api_url>[^"\']+)', webpage, 'api_url')
+        asset_id = self._search_regex(r'assets/([^?/]+)', api_url, 'asset_id')
 
-        api_response = self._download_json(api_url, video_id)
+        api_response = self._download_json(api_url.replace(asset_id, f'{asset_id}.json'), asset_id)
 
         return {
-            'id': video_id,
+            'id': asset_id,
             'url': api_response['resourceUrl'],
             'ext': {'video': 'mp4', 'audio': 'mp3'}.get(api_response.get('type')),
             'title': api_response.get('title'),


Test patch: