{"record":{"id":"3522f00e76929b41","repo":"ytdl-org/youtube-dl","slug":"no-media-found","errorCode":null,"errorMessage":"No media found","messagePattern":"No media found","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/reddit.py","lineNumber":113,"sourceCode":"        # reddit video @ nm reddit\n        'url': 'https://nm.reddit.com/r/Cricket/comments/8idvby/lousy_cameraman_finds_himself_in_cairns_line_of/',\n        'only_matching': True,\n    }]\n\n    def _real_extract(self, url):\n        mobj = re.match(self._VALID_URL, url)\n        url, video_id = mobj.group('url', 'id')\n\n        video_id = self._match_id(url)\n\n        data = self._download_json(\n            url + '/.json', video_id)[0]['data']['children'][0]['data']\n\n        video_url = data['url']\n\n        # Avoid recursing into the same reddit URL\n        if 'reddit.com/' in video_url and '/%s/' % video_id in video_url:\n            raise ExtractorError('No media found', expected=True)\n\n        over_18 = data.get('over_18')\n        if over_18 is True:\n            age_limit = 18\n        elif over_18 is False:\n            age_limit = 0\n        else:\n            age_limit = None\n\n        thumbnails = []\n\n        def add_thumbnail(src):\n            if not isinstance(src, dict):\n                return\n            thumbnail_url = url_or_none(src.get('url'))\n            if not thumbnail_url:\n                return\n            thumbnails.append({","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/reddit.py#L95-L131","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\nyoutube_dl: download https://www.reddit.com/r/videos/comments/abc123/some_self_post/\n# after\n# inspect the post JSON and pass the real media link\ncurl -s https://www.reddit.com/abc123/.json | jq '.[0].data.children[0].data.url'\n# then: youtube-dl <that url>","handlingStrategy":"validation","validationCode":"import json, urllib.request\ndef reddit_has_media(url):\n    with urllib.request.urlopen(url.rstrip('/') + '/.json', timeout=10) as r:\n        data = json.load(r)[0]['data']['children'][0]['data']\n    vurl = data.get('url', '')\n    vid = url.rstrip('/').split('/')[-3]  # .../comments/<id>/<slug>/ -> id\n    return not ('reddit.com/' in vurl and '/%s/' % vid in vurl)","typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'No media found' in str(e):\n        pass  # self-referencing post: skip, not an outage\n    else:\n        raise","preventionTips":["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."],"tags":["reddit","expected-error","no-media","extractor"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}