{"record":{"id":"21e43ec2aa002b52","repo":"ytdl-org/youtube-dl","slug":"live-stream-is-offline","errorCode":null,"errorMessage":"Live stream is offline","messagePattern":"Live stream is offline","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/douyutv.py","lineNumber":92,"sourceCode":"\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n\n        if video_id.isdigit():\n            room_id = video_id\n        else:\n            page = self._download_webpage(url, video_id)\n            room_id = self._html_search_regex(\n                r'\"room_id\\\\?\"\\s*:\\s*(\\d+),', page, 'room id')\n\n        # Grab metadata from mobile API\n        room = self._download_json(\n            'http://m.douyu.com/html5/live?roomId=%s' % room_id, video_id,\n            note='Downloading room info')['data']\n\n        # 1 = live, 2 = offline\n        if room.get('show_status') == '2':\n            raise ExtractorError('Live stream is offline', expected=True)\n\n        # Grab the URL from PC client API\n        # The m3u8 url from mobile API requires re-authentication every 5 minutes\n        tt = int(time.time())\n        signContent = 'lapi/live/thirdPart/getPlay/%s?aid=pcclient&rate=0&time=%d9TUk5fjjUjg9qIMH3sdnh' % (room_id, tt)\n        sign = hashlib.md5(signContent.encode('ascii')).hexdigest()\n        video_url = self._download_json(\n            'http://coapi.douyucdn.cn/lapi/live/thirdPart/getPlay/' + room_id,\n            video_id, note='Downloading video URL info',\n            query={'rate': 0}, headers={\n                'auth': sign,\n                'time': str(tt),\n                'aid': 'pcclient'\n            })['data']['live_url']\n\n        title = self._live_title(unescapeHTML(room['room_name']))\n        description = room.get('show_details')\n        thumbnail = room.get('room_src')","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/douyutv.py#L74-L110","documentation":"Error \"Live stream is offline\" thrown in ytdl-org/youtube-dl.","triggerScenarios":"Thrown at youtube_dl/extractor/douyutv.py:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The live stream is offline; wait for the broadcaster to start streaming and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}