{"record":{"id":"14f82fc7620b2d15","repo":"ytdl-org/youtube-dl","slug":"unknown-function-s","errorCode":null,"errorMessage":"Unknown function %s","messagePattern":"Unknown function (.+?)","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/iqiyi.py","lineNumber":153,"sourceCode":"            'handleSum': sdk.handleSum,\n            'handleInput8': sdk.handle_input8,\n            'handleInput16': sdk.handle_input16,\n            'splitTimeEvenOdd': sdk.split_time_even_odd,\n            'splitTimeOddEven': sdk.split_time_odd_even,\n            'splitIpTimeSum': sdk.split_ip_time_sum,\n            'splitTimeIpSum': sdk.split_time_ip_sum,\n        }\n        for function in functions:\n            if re.match(r'mod\\d+', function):\n                sdk.mod(int(function[3:]))\n            elif re.match(r'date[ymd]{3}', function):\n                sdk.date(function[4:])\n            elif re.match(r'split\\d+', function):\n                sdk.split(int(function[5:]))\n            elif function in other_functions:\n                other_functions[function]()\n            else:\n                raise ExtractorError('Unknown function %s' % function)\n\n        return sdk.target\n\n\nclass IqiyiIE(InfoExtractor):\n    IE_NAME = 'iqiyi'\n    IE_DESC = '爱奇艺'\n\n    _VALID_URL = r'https?://(?:(?:[^.]+\\.)?iqiyi\\.com|www\\.pps\\.tv)/.+\\.html'\n\n    _NETRC_MACHINE = 'iqiyi'\n\n    _TESTS = [{\n        'url': 'http://www.iqiyi.com/v_19rrojlavg.html',\n        # MD5 checksum differs on my machine and Travis CI\n        'info_dict': {\n            'id': '9c1fb1b99d192b21c559e5a1a2cb3c73',\n            'ext': 'mp4',","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/iqiyi.py#L135-L171","documentation":"Raised by IqiyiSDKInterpreter.run when the server-delivered, packer-obfuscated auth SDK code references a function name that the interpreter's dispatch table does not know. The interpreter only implements mod<NN>, date[ymd]{3}, split<NN> and seven named helpers (handleSum, handleInput8/16, splitTimeEvenOdd/OddEven, splitIpTimeSum, splitTimeIpSum); anything else is fatal.","triggerScenarios":"iQiyi ships an updated player SDK whose 'input=FN(input)' calls include a new or renamed hashing/mixing function; the extractor's re.findall on the decoded SDK code surfaces that unknown name and the loop hits the else branch.","commonSituations":"iQiyi rotates its anti-scraping signature algorithm; an old youtube-dl build then fails on every iQiyi URL with 'Unknown function ...'. Almost always a stale-extractor symptom, not a per-URL problem.","solutions":["Update youtube-dl (or switch to yt-dlp) - iQiyi's SDK changes are handled by extractor updates.","If maintaining a fork, decode the new sdk_code (decode_packed_codes) and implement the missing function in IqiyiSDK, then register it in other_functions.","Retry later; iQiyi sometimes serves different SDK variants per region/CDN."],"exampleFix":"// before (extractor internals): server SDK calls e.g. 'handleInput32(input)\nraise ExtractorError('Unknown function %s' % function)\n\n// after: implement and register the new helper in IqiyiSDK + other_functions\nother_functions = {\n    ...\n    'handleInput32': sdk.handle_input32,\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(iqiyi_url)\nexcept ExtractorError as e:\n    if str(e).startswith('Unknown function '):\n        # extractor/SDK drift: switch tool, do not retry with same version\n        run_via_yt_dlp(iqiyi_url)","preventionTips":["Pin a youtube-dl version known to work for iQiyi and monitor upstream extractor commits.","Treat 'Unknown function' as a site-side algorithm change requiring a code update, not a per-URL issue.","Run iQiyi jobs through the most recently updated tool (yt-dlp)."],"tags":["extractor","iqiyi","anti-scraping","obfuscation","stale-version","auth"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}