ytdl-org/youtube-dl · error · ExtractorError
No media found
Error message
No media found
What it means
Raised by the Reddit extractor when the JSON API response for a reddit link resolves to another URL that is the same reddit thread (the extracted video_url contains 'reddit.com/' and '/<video_id>/'). It is a recursion guard: reddit posts frequently just wrap another link to themselves (self-referencing media), so there is no playable media to extract. Marked expected=True, so youtube-dl reports it as an expected extraction failure rather than a bug.
Source
Thrown at youtube_dl/extractor/reddit.py:113
# reddit video @ nm reddit
'url': 'https://nm.reddit.com/r/Cricket/comments/8idvby/lousy_cameraman_finds_himself_in_cairns_line_of/',
'only_matching': True,
}]
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
url, video_id = mobj.group('url', 'id')
video_id = self._match_id(url)
data = self._download_json(
url + '/.json', video_id)[0]['data']['children'][0]['data']
video_url = data['url']
# Avoid recursing into the same reddit URL
if 'reddit.com/' in video_url and '/%s/' % video_id in video_url:
raise ExtractorError('No media found', expected=True)
over_18 = data.get('over_18')
if over_18 is True:
age_limit = 18
elif over_18 is False:
age_limit = 0
else:
age_limit = None
thumbnails = []
def add_thumbnail(src):
if not isinstance(src, dict):
return
thumbnail_url = url_or_none(src.get('url'))
if not thumbnail_url:
return
thumbnails.append({View on GitHub (pinned to 956b8c5855)
Solutions
- Verify the reddit post actually contains media (open it in a browser); self posts and removed posts have no video.
- Pass the direct media URL (the imgur/streamable/youtube link inside the post) instead of the reddit comments URL.
- If you must extract from reddit, resolve the post's 'url_overridden_by_dest' field yourself before handing it to youtube-dl.
- If this happens for posts that do contain media, the reddit JSON layout changed - update youtube-dl (or the extractor) and report the regression.
Example fix
# before youtube_dl: download https://www.reddit.com/r/videos/comments/abc123/some_self_post/ # after # inspect the post JSON and pass the real media link curl -s https://www.reddit.com/abc123/.json | jq '.[0].data.children[0].data.url' # then: youtube-dl <that url>
Defensive patterns
Strategy: validation
Validate before calling
import json, urllib.request
def reddit_has_media(url):
with urllib.request.urlopen(url.rstrip('/') + '/.json', timeout=10) as r:
data = json.load(r)[0]['data']['children'][0]['data']
vurl = data.get('url', '')
vid = url.rstrip('/').split('/')[-3] # .../comments/<id>/<slug>/ -> id
return not ('reddit.com/' in vurl and '/%s/' % vid in vurl) Try / catch
try:
ydl.extract_info(url)
except ExtractorError as e:
if 'No media found' in str(e):
pass # self-referencing post: skip, not an outage
else:
raise Prevention
- Resolve reddit posts to their real media URL (imgur, streamable, youtube) before passing to youtube-dl.
- Filter self posts via the post JSON's 'is_self' or missing 'url_overridden_by_dest' field.
- In bulk jobs over reddit listings, pre-check post JSON as above and drop self-referencing entries.
When it happens
Trigger: Calling youtube-dl on a reddit URL (comments/thread page) whose 'url' field in the .json API response points back to the same thread (e.g. a self post or a crosspost whose target is itself, or a URL param variant like ?ref=... on the same id). The check 'reddit.com/' in video_url and '/<video_id>/' in video_url both match.
Common situations: Users pass a reddit permalink that is a text/self post, a deleted media post redirecting to the thread, or a URL whose video_id appears in the redirect URL by coincidence. Also occurs when reddit changes its JSON shape so that data['url'] no longer holds the real media target.
Related errors
- Episode %s is not currently available
- No media links available for %s
- %s said: %s
- Video %s is for friends only
- %s said: %s
AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14).
Data as JSON: /api/errors/3522f00e76929b41.
Report an issue: GitHub.