{"record":{"id":"32b2076ba3f340c9","repo":"soimort/you-get","slug":"the-live-stream-is-not-online-errno-s-32b207","errorCode":null,"errorMessage":"The live stream is not online! (Errno:%s)","messagePattern":"The live stream is not online! \\(Errno:(.+?)\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/you_get/extractors/zhibo.py","lineNumber":38,"sourceCode":"    ext = video_url.split('.')[-1]\n\n    print_info(site_info, title, ext, total_size)\n    if not info_only:\n        download_urls(part_urls, title, ext, total_size, output_dir=output_dir, merge=merge)\n\n\ndef zhibo_download(url, output_dir = '.', merge = True, info_only = False, **kwargs):\n    if 'video.zhibo.tv' in url:\n        zhibo_vedio_download(url, output_dir=output_dir, merge=merge, info_only=info_only, **kwargs)\n        return\n\n    # if 'v.zhibo.tv' in url:\n    # http://v.zhibo.tv/31609372\n    html = get_html(url)\n    title = r1(r'<title>([\\s\\S]*)</title>', html)\n    is_live = r1(r\"window.videoIsLive=\\'([s\\S'\\s\\.]*)\\'\\;[\\s\\S]*window.resDomain\", html)\n    if is_live != \"1\":\n        raise ValueError(\"The live stream is not online! (Errno:%s)\" % is_live)\n\n    match = re.search(r\"\"\"\n    ourStreamName .*?\n    '(.*?)' .*?\n    rtmpHighSource .*?\n    '(.*?)' .*?\n    '(.*?)'\n    \"\"\", html, re.S | re.X)\n    real_url = match.group(3) + match.group(1) + match.group(2)\n\n    print_info(site_info, title, 'flv', float('inf'))\n    if not info_only:\n        download_url_ffmpeg(real_url, title, 'flv', params={}, output_dir=output_dir, merge=merge)\n\nsite_info = \"zhibo.tv\"\ndownload = zhibo_download\ndownload_playlist = playlist_not_supported('zhibo')\n","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/soimort/you-get/blob/049548f3f3f35e67ba8d3181c71fdc71d11cf260/src/you_get/extractors/zhibo.py#L20-L56","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","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.","If the HTML came back as a captcha/anti-bot page, fetch with faker=True / custom headers so zhibo serves the real page.","Handle ValueError in your calling code to skip offline channels gracefully."],"exampleFix":"# before\nfrom you_get.extractors.zhibo import zhibo_download\nzhibo_download('http://www.zhibo.tv/123456')  # raises ValueError if offline\n\n# after\ntry:\n    zhibo_download('http://www.zhibo.tv/123456')\nexcept ValueError as e:\n    print('skipping offline channel:', e)","handlingStrategy":"validation","validationCode":"from you_get.common import get_html, r1\n\ndef zhibo_is_live(url):\n    html = get_html(url)\n    return r1(r\"window.videoIsLive='([s\\S'\\s\\.]*)';\", html) == '1'","typeGuard":"null","tryCatchPattern":"try:\n    zhibo_download(url)\nexcept ValueError as e:\n    if 'live stream is not online' in str(e):\n        log.info('channel offline, skipping: %s', url)\n    else:\n        raise","preventionTips":["Check channel live status before calling the extractor.","For scheduled captures, poll the page until videoIsLive=='1' rather than assuming the schedule is exact.","Treat a None is_live value as a sign the page markup changed; verify the regex against current HTML.","Wrap batch jobs in per-channel ValueError handling so one offline channel doesn't abort the run."],"tags":["live-stream","zhibo","extractor","valueerror"],"backgroundTag":null,"analyzedSha":"049548f3f3f35e67ba8d3181c71fdc71d11cf260","analyzedAt":"2026-08-15T03:58:15.069Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}