{"record":{"id":"2bb1d0bb6fcf4deb","repo":"soimort/you-get","slug":"s-not-supported","errorCode":null,"errorMessage":"%s not supported","messagePattern":"(.+?) not supported","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"src/you_get/extractors/lizhi.py","lineNumber":47,"sourceCode":"    # at all -- hope all fits on a single page).\n    #\n    # TODO: Use /api/radio?band={radio_id} to get number of episodes\n    # (au_cnt), then handle pagination properly.\n    api_url = 'http://www.lizhi.fm/api/radio_audios?s=0&l=65535&band=%s' % radio_id\n    api_response = json.loads(get_content(api_url))\n    return [(ep['id'], ep['name'], get_url(ep)) for ep in api_response]\n\ndef lizhi_download_audio(audio_id, title, url, output_dir='.', info_only=False):\n    filetype, ext, size = url_info(url)\n    print_info(site_info, title, filetype, size)\n    if not info_only:\n        download_urls([url], title, ext, size, output_dir=output_dir)\n\ndef lizhi_download_playlist(url, output_dir='.', info_only=False, **kwargs):\n    # Sample URL: http://www.lizhi.fm/549759/\n    radio_id = match1(url,r'/(\\d+)')\n    if not radio_id:\n        raise NotImplementedError('%s not supported' % url)\n    for audio_id, title, url in lizhi_extract_playlist_info(radio_id):\n        lizhi_download_audio(audio_id, title, url, output_dir=output_dir, info_only=info_only)\n\ndef lizhi_download(url, output_dir='.', info_only=False, **kwargs):\n    # Sample URL: http://www.lizhi.fm/549759/18864883431656710/\n    m = re.search(r'/(?P<radio_id>\\d+)/(?P<audio_id>\\d+)', url)\n    if not m:\n        raise NotImplementedError('%s not supported' % url)\n    radio_id = m.group('radio_id')\n    audio_id = m.group('audio_id')\n    # Look for the audio_id among the full list of episodes\n    for aid, title, url in lizhi_extract_playlist_info(radio_id):\n        if aid == audio_id:\n            lizhi_download_audio(audio_id, title, url, output_dir=output_dir, info_only=info_only)\n            break\n    else:\n        raise NotImplementedError('Audio #%s not found in playlist #%s' % (audio_id, radio_id))\n","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/soimort/you-get/blob/049548f3f3f35e67ba8d3181c71fdc71d11cf260/src/you_get/extractors/lizhi.py#L29-L65","documentation":"Raised as NotImplementedError in lizhi_download_playlist (src/you_get/extractors/lizhi.py:47). The playlist entrypoint extracts the radio id via match1(url, r'/(\\d+)'); if the URL contains no /<digits> segment there is no radio station id to enumerate, so the URL is rejected.","triggerScenarios":"Calling lizhi_download_playlist (or `you-get -l`) with a lizhi.fm URL containing no numeric path segment, e.g. 'http://www.lizhi.fm/' or a user/profile page like /user/abc — match1 returns None and the raise fires. Note the regex grabs the FIRST /digits segment, so a URL like /user/123/ also wrongly matches.","commonSituations":"Passing the site homepage or a profile URL instead of a radio URL; trailing-slash or uppercase-path variants that hide the digits.","solutions":["Use a canonical radio URL of the form http://www.lizhi.fm/<radio_id>/ (digits only), e.g. /549759/.","In scripts, validate with re.search(r'^https?://[^/]+/(\\d+)/?', url) before calling.","For a single episode, use the two-segment form /<radio_id>/<audio_id>/ via lizhi_download instead."],"exampleFix":"# before\nlizhi_download_playlist('http://www.lizhi.fm/user/panjiayan')\n# NotImplementedError: ... not supported\n\n# after\nlizhi_download_playlist('http://www.lizhi.fm/549759/')","handlingStrategy":"validation","validationCode":"import re\n\ndef lizhi_playlist_url_valid(url):\n    return re.search(r'/(\\d+)', url) is not None","typeGuard":null,"tryCatchPattern":"try:\n    lizhi_download_playlist(url, output_dir)\nexcept NotImplementedError as e:\n    if str(e).endswith('not supported'):\n        ask_user_for_radio_url()  # structural problem: no retry will help\n    else:\n        raise","preventionTips":["Only pass /<radio_id>/ URLs (digits) to the playlist entrypoint.","Beware the loose first-segment regex: profile URLs with digits can slip through and mis-parse."],"tags":["you-get","lizhi","url-pattern","playlist","not-implemented"],"backgroundTag":null,"analyzedSha":"049548f3f3f35e67ba8d3181c71fdc71d11cf260","analyzedAt":"2026-08-15T03:58:15.069Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}