{"record":{"id":"7c6b2beb5543895b","repo":"ytdl-org/youtube-dl","slug":"invalid-url-s","errorCode":null,"errorMessage":"Invalid url %s","messagePattern":"Invalid url (.+?)","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/audiomack.py","lineNumber":62,"sourceCode":"            # }\n        },\n    ]\n\n    def _real_extract(self, url):\n        # URLs end with [uploader name]/song/[uploader title]\n        # this title is whatever the user types in, and is rarely\n        # the proper song title.  Real metadata is in the api response\n        album_url_tag = self._match_id(url).replace('/song/', '/')\n\n        # Request the extended version of the api for extra fields like artist and title\n        api_response = self._download_json(\n            'http://www.audiomack.com/api/music/url/song/%s?extended=1&_=%d' % (\n                album_url_tag, time.time()),\n            album_url_tag)\n\n        # API is inconsistent with errors\n        if 'url' not in api_response or not api_response['url'] or 'error' in api_response:\n            raise ExtractorError('Invalid url %s' % url)\n\n        # Audiomack wraps a lot of soundcloud tracks in their branded wrapper\n        # if so, pass the work off to the soundcloud extractor\n        if SoundcloudIE.suitable(api_response['url']):\n            return self.url_result(api_response['url'], SoundcloudIE.ie_key())\n\n        return {\n            'id': compat_str(api_response.get('id', album_url_tag)),\n            'uploader': api_response.get('artist'),\n            'title': api_response.get('title'),\n            'url': api_response['url'],\n        }\n\n\nclass AudiomackAlbumIE(InfoExtractor):\n    _VALID_URL = r'https?://(?:www\\.)?audiomack\\.com/(?:album/|(?=.+/album/))(?P<id>[\\w/-]+)'\n    IE_NAME = 'audiomack:album'\n    _TESTS = [","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/audiomack.py#L44-L80","documentation":"Raised by the Audiomack extractor when the song API response lacks a truthy 'url' key or contains an 'error' key — the comment notes the API is 'inconsistent with errors'. It guards against both explicit API error objects and silent failures where no stream URL is returned.","triggerScenarios":"GET http://www.audiomack.com/api/music/url/song/<tag>?extended=1 returns {'url': null} or includes 'error'; song/album removed; slug typo after the /song/ → album normalization; API endpoint deprecated or redirecting.","commonSituations":"Dead Audiomack links; track taken down for copyright; API moved after site updates (this http:// endpoint is fragile in old youtube-dl); wrong url_tag from an unusual URL shape.","solutions":["Open the Audiomack page in a browser to confirm the track still exists","Ensure the URL slug is exactly as shown on the site (typos produce silent nulls)","If all Audiomack URLs fail, the legacy API is likely dead — upgrade to yt-dlp which uses the current API","For wrapped Soundcloud tracks, using the Soundcloud URL directly can bypass Audiomack"],"exampleFix":"# before (old youtube-dl with legacy API)\nyoutube-dl 'http://www.audiomack.com/song/some-artist/removed-track'\n\n# after\nyt-dlp 'https://audiomack.com/some-artist/song/removed-track'  # current API implementation","handlingStrategy":"validation","validationCode":"# Pre-check the legacy Audiomack API the same way the extractor does\nimport requests\napi = requests.get('http://www.audiomack.com/api/music/url/song/%s' % tag,\n                   params={'extended': 1}).json()\nif not api.get('url') or 'error' in api:\n    skip(url, reason=api.get('error', 'no stream url returned'))","typeGuard":"def is_audiomack_response_playable(api_response):\n    \"\"\"Audiomack API response is playable only with a truthy 'url' and no 'error' key.\"\"\"\n    return isinstance(api_response, dict) and bool(api_response.get('url')) and 'error' not in api_response","tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'Invalid url' in str(e):\n        mark_url_dead(url)  # track removed or API rejected the slug; occasionally a takedown","preventionTips":["Verify the Audiomack slug against the live page before queueing","Prefer yt-dlp for Audiomack — this youtube-dl path uses a fragile legacy http:// API","For Soundcloud-wrapped tracks, extract the underlying Soundcloud URL and download directly"],"tags":["audiomack","api-error","content-missing","legacy-api"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}