soimort/you-get · error · NotImplementedError

%s not supported

Error message

%s not supported

What it means

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.

Source

Thrown at src/you_get/extractors/lizhi.py:47

    # at all -- hope all fits on a single page).
    #
    # TODO: Use /api/radio?band={radio_id} to get number of episodes
    # (au_cnt), then handle pagination properly.
    api_url = 'http://www.lizhi.fm/api/radio_audios?s=0&l=65535&band=%s' % radio_id
    api_response = json.loads(get_content(api_url))
    return [(ep['id'], ep['name'], get_url(ep)) for ep in api_response]

def lizhi_download_audio(audio_id, title, url, output_dir='.', info_only=False):
    filetype, ext, size = url_info(url)
    print_info(site_info, title, filetype, size)
    if not info_only:
        download_urls([url], title, ext, size, output_dir=output_dir)

def lizhi_download_playlist(url, output_dir='.', info_only=False, **kwargs):
    # Sample URL: http://www.lizhi.fm/549759/
    radio_id = match1(url,r'/(\d+)')
    if not radio_id:
        raise NotImplementedError('%s not supported' % url)
    for audio_id, title, url in lizhi_extract_playlist_info(radio_id):
        lizhi_download_audio(audio_id, title, url, output_dir=output_dir, info_only=info_only)

def lizhi_download(url, output_dir='.', info_only=False, **kwargs):
    # Sample URL: http://www.lizhi.fm/549759/18864883431656710/
    m = re.search(r'/(?P<radio_id>\d+)/(?P<audio_id>\d+)', url)
    if not m:
        raise NotImplementedError('%s not supported' % url)
    radio_id = m.group('radio_id')
    audio_id = m.group('audio_id')
    # Look for the audio_id among the full list of episodes
    for aid, title, url in lizhi_extract_playlist_info(radio_id):
        if aid == audio_id:
            lizhi_download_audio(audio_id, title, url, output_dir=output_dir, info_only=info_only)
            break
    else:
        raise NotImplementedError('Audio #%s not found in playlist #%s' % (audio_id, radio_id))

View on GitHub (pinned to 049548f3f3)

Solutions

  1. Use a canonical radio URL of the form http://www.lizhi.fm/<radio_id>/ (digits only), e.g. /549759/.
  2. In scripts, validate with re.search(r'^https?://[^/]+/(\d+)/?', url) before calling.
  3. For a single episode, use the two-segment form /<radio_id>/<audio_id>/ via lizhi_download instead.

Example fix

# before
lizhi_download_playlist('http://www.lizhi.fm/user/panjiayan')
# NotImplementedError: ... not supported

# after
lizhi_download_playlist('http://www.lizhi.fm/549759/')
Defensive patterns

Strategy: validation

Validate before calling

import re

def lizhi_playlist_url_valid(url):
    return re.search(r'/(\d+)', url) is not None

Try / catch

try:
    lizhi_download_playlist(url, output_dir)
except NotImplementedError as e:
    if str(e).endswith('not supported'):
        ask_user_for_radio_url()  # structural problem: no retry will help
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: Passing the site homepage or a profile URL instead of a radio URL; trailing-slash or uppercase-path variants that hide the digits.

Related errors


AI-assisted analysis of soimort/you-get@049548f3f3 (2026-08-15). Data as JSON: /api/errors/2bb1d0bb6fcf4deb. Report an issue: GitHub.