Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/archiveorg.py (Python)

Code before:
            }
        }
    ]

    def _real_extract(self, url):
        video_id = self._match_id(url)
        # Use link translator mentioned in https://github.com/ytdl-org/youtube-dl/issues/13655
        internal_fake_url = self._INTERNAL_URL_TEMPLATE % video_id
        video_file_webpage = self._request_webpage(
            HEADRequest(internal_fake_url), video_id, errnote='Video is not archived or issue with web.archive.org')
        video_file_url = compat_urllib_parse_unquote(video_file_webpage.url)
        video_file_url_qs = compat_parse_qs(compat_urlparse.urlparse(video_file_url).query)

        # Attempt to recover any ext & format info from playback url
        format = {'url': video_file_url}
        itag = try_get(video_file_url_qs, lambda x: x['itag'][0])
        if itag and itag in YoutubeIE._formats:  # Naughty access but it works
            format.update(YoutubeIE._formats[itag])
            format.update({'format_id': itag})
        else:
            mime = try_get(video_file_url_qs, lambda x: x['mime'][0])
            ext = mimetype2ext(mime) or determine_ext(video_file_url)
            format.update({'ext': ext})
        return {
            'id': video_id,
            'title': 'Unknown Video',  # In this case we are not able to get a title reliably.
            'formats': [format],
            'webpage_url': url,
            'duration': str_to_int(try_get(video_file_url_qs, lambda x: x['dur'][0]))
        }


Review comment (suggestion):
```suggestion
            'title': id,  # We are not able to get a title
```

Code after:
                'ext': 'unknown_video',
                'title': 'Me at the zoo'
            }
        },
        {
            # Flash video with .flv extension (itag 34). Title has prefix "YouTube         -"
            # Title has some weird unicode characters too.
            'url': 'https://web.archive.org/web/20110712231407/http://www.youtube.com/watch?v=lTx3G6h2xyA',
            'info_dict': {
                'id': 'lTx3G6h2xyA',
                'ext': 'flv',
                'title': '‪Madeon - Pop Culture (live mashup)‬‏'
            }
        },
        {   # Some versions of Youtube have have "YouTube" as page title in html (and later rewritten by js).
            'url': 'https://web.archive.org/web/http://www.youtube.com/watch?v=kH-G_aIBlFw',
            'info_dict': {
                'id': 'kH-G_aIBlFw',
                'ext': 'mp4',
                'title': 'kH-G_aIBlFw'
            },
            'expected_warnings': [
                'unable to extract title',
            ]
        },
        {
            # First capture is a 302 redirect intermediary page.
            'url': 'https://web.archive.org/web/20050214000000/http://www.youtube.com/watch?v=0altSZ96U4M',
            'info_dict': {
                'id': '0altSZ96U4M',
                'ext': 'mp4',
                'title': '0altSZ96U4M'
            },
            'expected_warnings': [
                'unable to extract title',
            ]
        },
        {
            # Video not archived, only capture is unavailable video page
            'url': 'https://web.archive.org/web/20210530071008/https://www.youtube.com/watch?v=lHJTf93HL1s&spfreload=10',
            'only_matching': True,
        },
        {   # Encoded url
            'url': 'https://web.archive.org/web/20120712231619/http%3A//www.youtube.com/watch%3Fgl%3DUS%26v%3DAkhihxRKcrs%26hl%3Den',
            'only_matching': True,
        },
        {
            'url': 'https://web.archive.org/web/20120712231619/http%3A//www.youtube.com/watch%3Fv%3DAkhihxRKcrs%26gl%3DUS%26hl%3Den',
            'only_matching': True,
        }
    ]