soimort/you-get · error · ValueError

The live stream is not online! (Errno:%s)

Error message

The live stream is not online! (Errno:%s)

What it means

Raised by zhibo_download when the fetched live-stream page reports window.videoIsLive != '1'. It means the zhibo.tv channel URL is valid but no live broadcast is currently running, so there is no stream to download. The offending value captured from the page is interpolated into the message via %s.

Source

Thrown at src/you_get/extractors/zhibo.py:38

    ext = video_url.split('.')[-1]

    print_info(site_info, title, ext, total_size)
    if not info_only:
        download_urls(part_urls, title, ext, total_size, output_dir=output_dir, merge=merge)


def zhibo_download(url, output_dir = '.', merge = True, info_only = False, **kwargs):
    if 'video.zhibo.tv' in url:
        zhibo_vedio_download(url, output_dir=output_dir, merge=merge, info_only=info_only, **kwargs)
        return

    # if 'v.zhibo.tv' in url:
    # http://v.zhibo.tv/31609372
    html = get_html(url)
    title = r1(r'<title>([\s\S]*)</title>', html)
    is_live = r1(r"window.videoIsLive=\'([s\S'\s\.]*)\'\;[\s\S]*window.resDomain", html)
    if is_live != "1":
        raise ValueError("The live stream is not online! (Errno:%s)" % is_live)

    match = re.search(r"""
    ourStreamName .*?
    '(.*?)' .*?
    rtmpHighSource .*?
    '(.*?)' .*?
    '(.*?)'
    """, html, re.S | re.X)
    real_url = match.group(3) + match.group(1) + match.group(2)

    print_info(site_info, title, 'flv', float('inf'))
    if not info_only:
        download_url_ffmpeg(real_url, title, 'flv', params={}, output_dir=output_dir, merge=merge)

site_info = "zhibo.tv"
download = zhibo_download
download_playlist = playlist_not_supported('zhibo')

View on GitHub (pinned to 049548f3f3)

Solutions

  1. Verify the channel is actually broadcasting live by opening the same URL in a browser; if not live, retry later — nothing is wrong with the code.
  2. If the page shows live in a browser but the error persists, inspect the fetched HTML (print get_html(url)) to see if the window.videoIsLive JS variable was renamed or the markup changed, and update the r1 regex in src/you_get/extractors/zhibo.py:20 accordingly.
  3. If the HTML came back as a captcha/anti-bot page, fetch with faker=True / custom headers so zhibo serves the real page.
  4. Handle ValueError in your calling code to skip offline channels gracefully.

Example fix

# before
from you_get.extractors.zhibo import zhibo_download
zhibo_download('http://www.zhibo.tv/123456')  # raises ValueError if offline

# after
try:
    zhibo_download('http://www.zhibo.tv/123456')
except ValueError as e:
    print('skipping offline channel:', e)
Defensive patterns

Strategy: validation

Validate before calling

from you_get.common import get_html, r1

def zhibo_is_live(url):
    html = get_html(url)
    return r1(r"window.videoIsLive='([s\S'\s\.]*)';", html) == '1'

Type guard

null

Try / catch

try:
    zhibo_download(url)
except ValueError as e:
    if 'live stream is not online' in str(e):
        log.info('channel offline, skipping: %s', url)
    else:
        raise

Prevention

When it happens

Trigger: Calling you_get on a zhibo.tv channel page (e.g. http://www.zhibo.tv/<channel>) where the regex window.videoIsLive='([s\S'\s\.]*)' matches a value other than '1', or matches an empty/None value because the page markup changed or the page is a placeholder for an offline channel.

Common situations: Stream ended between discovery and download; channel simply offline; page served differently to the scraper (bot detection, geo-block, HTML layout change breaking the videoIsLive regex so is_live is None); using a v.zhibo.tv URL whose commented-out branch is skipped and falls through to the generic path.

Related errors


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