ytdl-org/youtube-dl · error · ExtractorError

XML playlist is missing the 'track' element

Error message

XML playlist is missing the 'track' element

What it means

Error "XML playlist is missing the 'track' element" thrown in ytdl-org/youtube-dl.

Source

Thrown at youtube_dl/extractor/nosvideo.py:56

            'id': video_id,
            'op': 'download1',
            'method_free': 'Continue to Video',
        }
        req = sanitized_Request(url, urlencode_postdata(fields))
        req.add_header('Content-type', 'application/x-www-form-urlencoded')
        webpage = self._download_webpage(req, video_id,
                                         'Downloading download page')
        if re.search(self._FILE_DELETED_REGEX, webpage) is not None:
            raise ExtractorError('Video %s does not exist' % video_id,
                                 expected=True)

        xml_id = self._search_regex(r'php\|([^\|]+)\|', webpage, 'XML ID')
        playlist_url = self._PLAYLIST_URL.format(xml_id=xml_id)
        playlist = self._download_xml(playlist_url, video_id)

        track = playlist.find(_x('.//xspf:track'))
        if track is None:
            raise ExtractorError(
                'XML playlist is missing the \'track\' element',
                expected=True)
        title = xpath_text(track, _x('./xspf:title'), 'title')
        url = xpath_text(track, _x('./xspf:file'), 'URL', fatal=True)
        thumbnail = xpath_text(track, _x('./xspf:image'), 'thumbnail')
        if title is not None:
            title = title.strip()

        formats = [{
            'format_id': 'sd',
            'url': url,
        }]

        return {
            'id': video_id,
            'title': title,
            'thumbnail': thumbnail,
            'formats': formats,

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Update youtube-dl; the playlist XML structure changed.

When it happens

Trigger: Thrown at youtube_dl/extractor/nosvideo.py:56 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14). Data as JSON: /api/errors/8d868ae67a060957. Report an issue: GitHub.