ytdl-org/youtube-dl · error · ExtractorError
reason
Error message
reason
What it means
Raised by the Google Drive extractor when get_video_info returns no 'title' but does return a 'reason' — Drive's own error string (e.g. 'This video is not available' or a quota message). Marked expected=True. This is the early bail-out before any format parsing.
Source
Thrown at youtube_dl/extractor/googledrive.py:176
origin_lang_code = track.attrib.get('lang_code')
if not origin_lang_code:
return
return self._get_captions_by_type(
video_id, subtitles_id, 'automatic_captions', origin_lang_code)
def _real_extract(self, url):
video_id = self._match_id(url)
video_info = compat_parse_qs(self._download_webpage(
'https://drive.google.com/get_video_info',
video_id, query={'docid': video_id}))
def get_value(key):
return try_get(video_info, lambda x: x[key][0])
reason = get_value('reason')
title = get_value('title')
if not title and reason:
raise ExtractorError(reason, expected=True)
formats = []
fmt_stream_map = (get_value('fmt_stream_map') or '').split(',')
fmt_list = (get_value('fmt_list') or '').split(',')
if fmt_stream_map and fmt_list:
resolutions = {}
for fmt in fmt_list:
mobj = re.search(
r'^(?P<format_id>\d+)/(?P<width>\d+)[xX](?P<height>\d+)', fmt)
if mobj:
resolutions[mobj.group('format_id')] = (
int(mobj.group('width')), int(mobj.group('height')))
for fmt_stream in fmt_stream_map:
fmt_stream_split = fmt_stream.split('|')
if len(fmt_stream_split) < 2:
continue
format_id, format_url = fmt_stream_split[:2]View on GitHub (pinned to 956b8c5855)
Solutions
- Open the drive.google.com URL in a browser to see the actual reason
- If quota-exceeded, wait 24h or ask the owner to make a copy and share the new link
- Sign in to Google in a browser and use a cookies-from-browser capable tool (yt-dlp --cookies-from-browser)
- If the file is private, get the owner to grant access
Defensive patterns
Strategy: try-catch
Validate before calling
import requests
from urllib.parse import parse_qs
qi = parse_qs(requests.get('https://drive.google.com/get_video_info', params={'docid': fid}).text)
if qi.get('reason') and not qi.get('title'):
print('Drive refusal:', qi['reason'][0]) Type guard
def drive_video_available(video_info_qs):
return bool(video_info_qs.get('title')) and not video_info_qs.get('reason') Try / catch
try:
ydl.extract_info(url)
except DownloadError as e:
if 'quota' in str(e).lower() or 'not available' in str(e).lower():
schedule_retry_24h(url) # quota windows reset daily
else:
raise Prevention
- Pre-check get_video_info for a 'reason' field before queueing downloads
- For shared files, ask owners to provide copies instead of hitting one file's quota
- Use browser cookies for access-controlled files
When it happens
Trigger: Requesting a Drive docid whose get_video_info response contains reason=... and no title: video removed, made private, download-quota-exceeded, or requires sign-in.
Common situations: Shared files that hit Google's daily download quota ('Sorry, you can't view or download this file at this time'), deleted/private videos, or files where the owner disabled downloading.
Related errors
- Video %s is for friends only
- Invalid path
- Unauthorized user "%s"
- Missing "id" field in extractor result
- Missing "title" field in extractor result
AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14).
Data as JSON: /api/errors/decd73e2cbc59cb1.
Report an issue: GitHub.