{"record":{"id":"8a0ad622ad7e6227","repo":"soimort/you-get","slug":"playlist-url","errorCode":null,"errorMessage":"playlist_url","messagePattern":"playlist_url","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"src/you_get/extractors/ximalaya.py","lineNumber":70,"sourceCode":"def 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:\n        raise NotImplementedError(url)\n    pages = []\n    page_content = get_content(url)\n    if page_content.find('<div class=\"pagingBar_wrapper\"') == -1:\n        pages.append(url)\n    else:\n        base_url = 'http://www.ximalaya.com/' + match_result.group(1) + '/album/' + match_result.group(2)\n        html_str = '<a href=(\\'|\")\\/' + match_result.group(1) + '\\/album\\/' + match_result.group(2) + '\\?page='\n        count = len(re.findall(html_str, page_content))\n        for page_num in range(count):\n            pages.append(base_url + '?page=' +str(page_num+1))\n            print(pages[-1])\n    for page in pages:\n        ximalaya_download_page(page, output_dir=output_dir, info_only=info_only, stream_id=stream_id)","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/soimort/you-get/blob/049548f3f3f35e67ba8d3181c71fdc71d11cf260/src/you_get/extractors/ximalaya.py#L52-L88","documentation":"ximalaya_download_page accepts only playlist URLs shaped http://www.ximalaya.com/<uid>/album/<id> (plain http, www, numeric uid). Any other form — https, mobile host, or a sound page — raises NotImplementedError(playlist_url) with the raw URL as the message.","triggerScenarios":"Calling ximalaya_download_page with 'https://www.ximalaya.com/album/123' or 'http://m.ximalaya.com/123/album/456'; both fail re.match at src/you_get/extractors/ximalaya.py:70 and hit the else raise.","commonSituations":"Copying album links from browsers (https) or the mobile app; passing a single-sound URL where an album URL is required; site path redesign dropping the uid segment.","solutions":["Normalize the URL to http://www.ximalaya.com/<uid>/album/<id> before calling","Or update the regex to r'https?://(?:www\\.|m\\.)?ximalaya\\.com/(?:\\d+/)?album/(\\d+)'","Prefer ximalaya_download_playlist, the public entry point, which handles paging on top of the same pattern"],"exampleFix":"# before\nif re.match(r'http://www\\.ximalaya\\.com/(\\d+)/album/(\\d+)', playlist_url):\n    ...\nelse:\n    raise NotImplementedError(playlist_url)\n\n# after\nif re.match(r'https?://(?:www\\.|m\\.)?ximalaya\\.com/(?:\\d+/)?album/(\\d+)', playlist_url):\n    ...\nelse:\n    raise NotImplementedError(playlist_url)","handlingStrategy":"validation","validationCode":"import re\n\ndef ximalaya_album_url_supported(url):\n    return re.match(r'http://www\\.ximalaya\\.com/\\d+/album/\\d+', url) is not None","typeGuard":null,"tryCatchPattern":"try:\n    ximalaya_download_page(url, ...)\nexcept NotImplementedError:\n    print('normalize to http://www.ximalaya.com/<uid>/album/<id>')","preventionTips":["Normalize album URLs to plain-http www form before calling","Prefer the public ximalaya_download_playlist entry over download_page","Validate the /album/\\d+ shape at input boundaries in batch scripts"],"tags":["ximalaya","url-validation","playlist","https"],"backgroundTag":null,"analyzedSha":"049548f3f3f35e67ba8d3181c71fdc71d11cf260","analyzedAt":"2026-08-15T03:58:15.069Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}