{"record":{"id":"d7af9cdbd9558fab","repo":"soimort/you-get","slug":"url","errorCode":null,"errorMessage":"url","messagePattern":"url","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"src/you_get/extractors/ximalaya.py","lineNumber":56,"sourceCode":"    urls = [url]\n    print('Site:        %s' % site_info)\n    print('title:       %s' % title)\n    if info_only:\n        if stream_id:\n            print_stream_info(stream_id)\n        else:\n            for item in range(0, len(stream_types)):\n                print_stream_info(item)\n    if not info_only:\n        print('Type:        MPEG-4 audio m4a')\n        print('Size:        N/A')\n        download_urls(urls, title, ext, size, output_dir = output_dir, merge = False)\n\ndef ximalaya_download(url, output_dir = '.', info_only = False, stream_id = None, **kwargs):\n    if re.match(r'http://www\\.ximalaya\\.com/(\\d+)/sound/(\\d+)', url):\n        id = match1(url, r'http://www\\.ximalaya\\.com/\\d+/sound/(\\d+)')\n    else:\n        raise NotImplementedError(url)\n    ximalaya_download_by_id(id, output_dir = output_dir, info_only = info_only, stream_id = stream_id)\n\ndef ximalaya_download_page(playlist_url, output_dir = '.', info_only = False, stream_id = None, **kwargs):\n    if re.match(r'http://www\\.ximalaya\\.com/(\\d+)/album/(\\d+)', playlist_url):\n        page_content = get_content(playlist_url)\n        pattern = re.compile(r'<li sound_id=\"(\\d+)\"')\n        ids = pattern.findall(page_content)\n        for id in ids:\n            try:\n                ximalaya_download_by_id(id, output_dir=output_dir, info_only=info_only, stream_id=stream_id)\n            except(ValueError):\n                print(\"something wrong with %s, perhaps paid item?\" % id)\n    else:\n        raise NotImplementedError(playlist_url)\n    \ndef ximalaya_download_playlist(url, output_dir='.', info_only=False, stream_id=None, **kwargs):\n    match_result = re.match(r'http://www\\.ximalaya\\.com/(\\d+)/album/(\\d+)', url)\n    if not match_result:","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/soimort/you-get/blob/049548f3f3f35e67ba8d3181c71fdc71d11cf260/src/you_get/extractors/ximalaya.py#L38-L74","documentation":"ximalaya_download only accepts URLs matching http://www.ximalaya.com/<uid>/sound/<id> exactly (plain http, with www). Anything else — https links, no-www, m.ximalaya.com mobile pages, or non-sound pages — falls to else and raises NotImplementedError(url), so the exception message is just the raw URL.","triggerScenarios":"Passing 'https://www.ximalaya.com/sound/123' or 'https://m.ximalaya.com/sound/123' (https and mobile hosts fail re.match(r'http://www\\.ximalaya\\.com/(\\d+)/sound/(\\d+)') at src/you_get/extractors/ximalaya.py:55).","commonSituations":"Every modern share link is https, so this fires constantly on copy-pasted URLs; mobile app share links using the m. subdomain; album links (which belong to ximalaya_download_playlist).","solutions":["Normalize the URL to http://www.ximalaya.com/<uid>/sound/<id> before calling","Or widen the regex to r'https?://(?:www\\.|m\\.)?ximalaya\\.com/(\\d+)/sound/(\\d+)' (also allow the modern path without the numeric uid segment if needed)","For album links, call the playlist downloader instead of the single-track downloader"],"exampleFix":"# before\nif re.match(r'http://www\\.ximalaya\\.com/(\\d+)/sound/(\\d+)', url):\n    id = match1(url, r'http://www\\.ximalaya\\.com/\\d+/sound/(\\d+)')\nelse:\n    raise NotImplementedError(url)\n\n# after\nif re.match(r'https?://(?:www\\.|m\\.)?ximalaya\\.com/(?:\\d+/)?sound/(\\d+)', url):\n    id = match1(url, r'sound/(\\d+)')\nelse:\n    raise NotImplementedError(url)","handlingStrategy":"validation","validationCode":"import re\n\ndef ximalaya_sound_url_supported(url):\n    return re.match(r'http://www\\.ximalaya\\.com/\\d+/sound/\\d+', url) is not None","typeGuard":null,"tryCatchPattern":"try:\n    ximalaya_download(url, ...)\nexcept NotImplementedError:\n    print('normalize to http://www.ximalaya.com/<uid>/sound/<id>')","preventionTips":["Rewrite https/m.ximalaya.com links to the plain-http www form the extractor expects","Keep album links and sound links routed to their respective downloaders","Centralize URL normalization upstream so every extractor gets canonical input"],"tags":["ximalaya","url-validation","https","regex"],"backgroundTag":null,"analyzedSha":"049548f3f3f35e67ba8d3181c71fdc71d11cf260","analyzedAt":"2026-08-15T03:58:15.069Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}