{"record":{"id":"d21d79b7a65130f4","repo":"ytdl-org/youtube-dl","slug":"pycryptodomex-not-found-please-install-it","errorCode":null,"errorMessage":"pycryptodomex not found. Please install it.","messagePattern":"pycryptodomex not found\\. Please install it\\.","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/ivi.py","lineNumber":148,"sourceCode":"                'Downloading video JSON', data=content_data, query=query)\n\n            error = video_json.get('error')\n            if error:\n                origin = error.get('origin')\n                message = error.get('message') or error.get('user_message')\n                extractor_msg = 'Unable to download video %s'\n                if origin == 'NotAllowedForLocation':\n                    self.raise_geo_restricted(message, self._GEO_COUNTRIES)\n                elif origin == 'NoRedisValidData':\n                    extractor_msg = 'Video %s does not exist'\n                elif site == 353:\n                    continue\n                elif bundled:\n                    raise ExtractorError(\n                        'This feature does not work from bundled exe. Run youtube-dl from sources.',\n                        expected=True)\n                elif not pycryptodomex_found:\n                    raise ExtractorError(\n                        'pycryptodomex not found. Please install it.',\n                        expected=True)\n                elif message:\n                    extractor_msg += ': ' + message\n                raise ExtractorError(extractor_msg % video_id, expected=True)\n            else:\n                break\n\n        result = video_json['result']\n        title = result['title']\n\n        quality = qualities(self._KNOWN_FORMATS)\n\n        formats = []\n        for f in result.get('files', []):\n            f_url = f.get('url')\n            content_format = f.get('content_format')\n            if not f_url or '-MDRM-' in content_format or '-FPS-' in content_format:","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/ivi.py#L130-L166","documentation":"Raised by the ivi.ru extractor when the Cryptodome library (pycryptodomex) is not importable. The signed-request variant of ivi's light API requires Cryptodome.Cipher.Blowfish and Cryptodome.Hash.CMAC to compute the request signature; without it the extractor cannot authenticate the request.","triggerScenarios":"from Cryptodome.Cipher import Blowfish / from Cryptodome.Hash import CMAC raise ImportError (pycryptodomex_found = False), the unsigned site-183 request then returns an API error, and the handler reports the missing dependency.","commonSituations":"Minimal Python environments, source installs where only pycrypto (not pycryptodomex) is present, or virtualenvs created without the extras.","solutions":["pip install pycryptodomex","Verify the import works: python -c \"from Cryptodome.Hash import CMAC\"","Do not substitute the old 'pycrypto' package - the code imports the Cryptodome namespace."],"exampleFix":"// before\npip install youtube-dl\nyoutube-dl 'http://www.ivi.ru/watch/12345'\n# => pycryptodomex not found. Please install it.\n\n// after\npip install pycryptodomex\nyoutube-dl 'http://www.ivi.ru/watch/12345'","handlingStrategy":"validation","validationCode":"try:\n    from Cryptodome.Hash import CMAC  # noqa\n    from Cryptodome.Cipher import Blowfish  # noqa\n    pycryptodomex_ok = True\nexcept ImportError:\n    pycryptodomex_ok = False\nif not pycryptodomex_ok and url_host_is('ivi.ru'):\n    raise EnvironmentError('pip install pycryptodomex before extracting ivi')","typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(ivi_url)\nexcept ExtractorError as e:\n    if 'pycryptodomex not found' in str(e):\n        abort_with_hint('pip install pycryptodomex')  # environment fix, then re-run","preventionTips":["Add pycryptodomex to requirements alongside youtube-dl.","Check the Cryptodome import in CI for environments that will touch ivi URLs.","Remember the namespace is Cryptodome, not Crypto - installing old pycrypto does not help."],"tags":["dependency","extractor","ivi","crypto","environment"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}