[ivi] Skip s353 for bundled exe
authorSergey M․ <dstftw@gmail.com>
Thu, 21 Nov 2019 18:10:24 +0000 (01:10 +0700)
committerSergey M․ <dstftw@gmail.com>
Thu, 21 Nov 2019 18:10:24 +0000 (01:10 +0700)
See https://github.com/Legrandin/pycryptodome/issues/228

youtube_dl/extractor/ivi.py

index 315ea03faf0dff2d0b75536516295c2e379ed9d1..a502e88066850b14de284e6e3ec7d47ea9397f3d 100644 (file)
@@ -1,8 +1,9 @@
 # coding: utf-8
 from __future__ import unicode_literals
 
-import re
 import json
+import re
+import sys
 
 from .common import InfoExtractor
 from ..utils import (
@@ -93,9 +94,13 @@ class IviIE(InfoExtractor):
             ]
         })
 
+        bundled = hasattr(sys, 'frozen')
+
         for site in (353, 183):
             content_data = (data % site).encode()
             if site == 353:
+                if bundled:
+                    continue
                 try:
                     from Cryptodome.Cipher import Blowfish
                     from Cryptodome.Hash import CMAC
@@ -135,6 +140,10 @@ class IviIE(InfoExtractor):
                     extractor_msg = 'Video %s does not exist'
                 elif site == 353:
                     continue
+                elif bundled:
+                    raise ExtractorError(
+                        'This feature does not work from bundled exe. Run youtube-dl from sources.',
+                        expected=True)
                 elif not pycryptodomex_found:
                     raise ExtractorError(
                         'pycryptodomex not found. Please install it.',