{"record":{"id":"a6d25b43348c4f40","repo":"ytdl-org/youtube-dl","slug":"invalid-url-a6d25b","errorCode":null,"errorMessage":"Invalid URL","messagePattern":"Invalid URL","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"warning","filePath":"youtube_dl/extractor/francetv.py","lineNumber":232,"sourceCode":"            'thumbnail': urljoin('https://sivideo.webservices.francetelevisions.fr', info.get('image')),\n            'duration': int_or_none(info.get('real_duration')) or parse_duration(info.get('duree')),\n            'timestamp': int_or_none(try_get(info, lambda x: x['diffusion']['timestamp'])),\n            'is_live': is_live,\n            'formats': formats,\n            'subtitles': subtitles,\n        }\n\n    def _real_extract(self, url):\n        mobj = re.match(self._VALID_URL, url)\n        video_id = mobj.group('id')\n        catalog = mobj.group('catalog')\n\n        if not video_id:\n            qs = compat_urlparse.parse_qs(compat_urlparse.urlparse(url).query)\n            video_id = qs.get('idDiffusion', [None])[0]\n            catalog = qs.get('catalogue', [None])[0]\n            if not video_id:\n                raise ExtractorError('Invalid URL', expected=True)\n\n        return self._extract_video(video_id, catalog)\n\n\nclass FranceTVSiteIE(FranceTVBaseInfoExtractor):\n    _VALID_URL = r'https?://(?:(?:www\\.)?france\\.tv|mobile\\.france\\.tv)/(?:[^/]+/)*(?P<id>[^/]+)\\.html'\n\n    _TESTS = [{\n        'url': 'https://www.france.tv/france-2/13h15-le-dimanche/140921-les-mysteres-de-jesus.html',\n        'info_dict': {\n            'id': 'ec217ecc-0733-48cf-ac06-af1347b849d1',\n            'ext': 'mp4',\n            'title': '13h15, le dimanche... - Les mystères de Jésus',\n            'description': 'md5:75efe8d4c0a8205e5904498ffe1e1a42',\n            'timestamp': 1502623500,\n            'upload_date': '20170813',\n        },\n        'params': {","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/francetv.py#L214-L250","documentation":"Raised by FranceTVIE's _real_extract when neither the _VALID_URL 'id' group nor an 'idDiffusion' query parameter yields a video id. The URL matched the loose fallback pattern but carries no usable identifier, so extraction cannot proceed. Marked expected=True — it is a URL problem, not a site problem.","triggerScenarios":"The regex match returns no named 'id' group, and compat_urlparse.parse_qs finds no 'idDiffusion' in the query string. Happens with francetv URLs like bare https://www.france.tv/ or pluton-style links where the id parameter is named differently or empty.","commonSituations":"Users constructing FranceTV URLs by hand and omitting the id; upstream code passing a normalized/stripped URL that lost its query string; test harnesses feeding only_matching URLs.","solutions":["Use the full canonical URL copied from the browser address bar on the video page","For pluton.francetv.fr URLs, ensure the idDiffusion query parameter is present, e.g. ...?idDiffusion=<uuid>","Log the exact URL being passed downstream to find code that strips the query string","Pre-validate URLs against the extractor's _VALID_URL with the id group before calling"],"exampleFix":"# before\nyoutube_dl 'https://www.france.tv/'\n# ERROR: Invalid URL\n\n# after\nyoutube_dl 'https://www.france.tv/france-2/some-show/123456-title.html'","handlingStrategy":"validation","validationCode":"# Validate the URL carries a video id before extraction\nimport re\nfrom youtube_dl.extractor.francetv import FranceTVIE\nm = re.match(FranceTVIE._VALID_URL, url)\nqs_id = re.search(r'[?&]idDiffusion=([^&]+)', url)\nif not (m and m.group('id')) and not qs_id:\n    raise ValueError('URL has no FranceTV video id')","typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if str(e) == 'Invalid URL':\n        reject_url_early(url)  # fix the source of the URL, do not retry","preventionTips":["Validate FranceTV URLs against the extractor regex before queuing","Never strip query strings when normalizing francetv/pluton URLs"],"tags":["francetv","extractor","invalid-url","validation"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}