ytdl-org/youtube-dl · warning · ExtractorError

Stream is offline

Error message

Stream is offline

What it means

Raised by PicartoIE (live-stream site) when the GraphQL channel metadata reports online == 0. It is an expected error meaning the channel exists but is not currently broadcasting, so there is no live stream to record. It fires before any CDN/load-balancer requests are made.

Source

Thrown at youtube_dl/extractor/picarto.py:50

        data = self._download_json(
            'https://ptvintern.picarto.tv/ptvapi', channel_id, query={
                'query': '''{
  channel(name: "%s") {
    adult
    id
    online
    stream_name
    title
  }
  getLoadBalancerUrl(channel_name: "%s") {
    url
  }
}''' % (channel_id, channel_id),
            })['data']
        metadata = data['channel']

        if metadata.get('online') == 0:
            raise ExtractorError('Stream is offline', expected=True)
        title = metadata['title']

        cdn_data = self._download_json(
            data['getLoadBalancerUrl']['url'] + '/stream/json_' + metadata['stream_name'] + '.js',
            channel_id, 'Downloading load balancing info')

        formats = []
        for source in (cdn_data.get('source') or []):
            source_url = source.get('url')
            if not source_url:
                continue
            source_type = source.get('type')
            if source_type == 'html5/application/vnd.apple.mpegurl':
                formats.extend(self._extract_m3u8_formats(
                    source_url, channel_id, 'mp4', m3u8_id='hls', fatal=False))
            elif source_type == 'html5/video/mp4':
                formats.append({
                    'url': source_url,

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Retry when the channel is actually live — check picarto.tv in a browser first
  2. Wrap the call in a polling loop with a long interval (e.g. re-check every 60s) and start recording once online != 0
  3. Use --live-from-start or a monitoring script that waits for the channel to come online

Example fix

# before
youtube_dl 'https://picarto.tv/SomeOfflineChannel'
# after
# poll until live, then record
while ! youtube_dl --simulate 'https://picarto.tv/SomeOfflineChannel' 2>/dev/null; do sleep 60; done
youtube_dl 'https://picarto.tv/SomeOfflineChannel'
Defensive patterns

Strategy: retry

Try / catch

while True:
    try:
        ydl.download(['https://picarto.tv/%s' % channel])
        break
    except ExtractorError as e:
        if e.expected and 'offline' in str(e):
            time.sleep(60)
            continue
        raise

Prevention

When it happens

Trigger: Running yt-dlp/youtube-dl on a picarto.tv/channel URL while the streamer is offline. The GraphQL query for channel_id returns metadata with 'online': 0.

Common situations: Scheduled recordings that start before the streamer goes live; following channels across time zones; channel ended the stream moments before the check.

Related errors


AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14). Data as JSON: /api/errors/d205329fded8915b. Report an issue: GitHub.