{"record":{"id":"50489350c5ef9588","repo":"soimort/you-get","slug":"the-live-stream-is-not-online-errno-s","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":"warning","filePath":"src/you_get/extractors/douyutv.py","lineNumber":71,"sourceCode":"        room_id = url[url.rfind('/') + 1:]\n\n    api_url = \"http://www.douyutv.com/api/v1/\"\n    args = \"room/%s?aid=wp&client_sys=wp&time=%d\" % (room_id, int(time.time()))\n    auth_md5 = (args + \"zNzMV1y4EMxOHS6I5WKm\").encode(\"utf-8\")\n    auth_str = hashlib.md5(auth_md5).hexdigest()\n    json_request_url = \"%s%s&auth=%s\" % (api_url, args, auth_str)\n\n    content = get_content(json_request_url, headers)\n    json_content = json.loads(content)\n    data = json_content['data']\n    server_status = json_content.get('error', 0)\n    if server_status != 0:\n        raise ValueError(\"Server returned error:%s\" % server_status)\n\n    title = data.get('room_name')\n    show_status = data.get('show_status')\n    if show_status != \"1\":\n        raise ValueError(\"The live stream is not online! (Errno:%s)\" % server_status)\n\n    real_url = data.get('rtmp_url') + '/' + data.get('rtmp_live')\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\n\nsite_info = \"douyu.com\"\ndownload = douyutv_download\ndownload_playlist = playlist_not_supported('douyu')\n","sourceCodeStart":53,"sourceCodeEnd":83,"githubUrl":"https://github.com/soimort/you-get/blob/049548f3f3f35e67ba8d3181c71fdc71d11cf260/src/you_get/extractors/douyutv.py#L53-L83","documentation":"Raised as ValueError in douyutv_download (src/you_get/extractors/douyutv.py:71). The API call succeeded (server_status == 0) but the room's show_status field is not '1', meaning the streamer is offline / the room is not broadcasting, so there is no rtmp stream to record.","triggerScenarios":"Calling douyutv_download for a room whose data.show_status != '1' — i.e. the broadcaster is offline, the room is closed/banned, or Douyu returned an unexpected show_status value (type/format change from string '1').","commonSituations":"Trying to record a live stream after it ended; scheduling a download for a room that rarely streams; Douyu changing show_status semantics so live rooms report a different value.","solutions":["Check the room page on douyu.com — if it shows offline, wait until the streamer is live and retry.","If the room is clearly live in a browser, log data['show_status'] to see what Douyu now returns and update the comparison.","For automation, poll the API until show_status == '1' before calling the downloader."],"exampleFix":"# before\nshow_status = data.get('show_status')\nif show_status != \"1\":\n    raise ValueError(\"The live stream is not online! (Errno:%s)\" % server_status)\n\n# after: wait for live in a scheduler before invoking\ncontent = get_content(json_request_url, headers)\nif json.loads(content)['data'].get('show_status') == \"1\":\n    douyutv_download(url, output_dir=output_dir, merge=merge)","handlingStrategy":"validation","validationCode":"import json, time\n\ndef douyu_room_is_live(room_id, headers):\n    from you_get.common import get_content\n    args = \"room/%s?aid=wp&client_sys=wp&time=%d\" % (room_id, int(time.time()))\n    import hashlib\n    auth = hashlib.md5((args + 'zNzMV1y4EMxOHS6I5WKm').encode('utf-8')).hexdigest()\n    data = json.loads(get_content('http://www.douyutv.com/api/v1/' + args + '&auth=' + auth, headers))\n    return data.get('error', 0) == 0 and data['data'].get('show_status') == '1'","typeGuard":null,"tryCatchPattern":"try:\n    douyutv_download(url, output_dir)\nexcept ValueError as e:\n    if 'not online' in str(e):\n        schedule_retry(url, when='+15min')  # streamer may go live later\n    else:\n        raise","preventionTips":["Poll the room API for show_status == '1' before starting an ffmpeg record.","Treat offline as a scheduling condition, not a bug."],"tags":["you-get","douyu","live-stream","offline","extractor"],"backgroundTag":null,"analyzedSha":"049548f3f3f35e67ba8d3181c71fdc71d11cf260","analyzedAt":"2026-08-15T03:58:15.069Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}