beardypig/streamlink-portable

aes key error on launch

Closed this issue · 4 comments

Hello @beardypig

With streamlink portable latest build, message below is displayed when it is started with aes key.
Is there any chance for workaround ?

Exception in thread Thread-1:
Traceback (most recent call last):
  File "threading.py", line 914, in _bootstrap_inner
  File "C:\Users\Ddr\Downloads\Temp\streamlink\packages\streamlink\stream\segmen
ted.py", line 160, in run
    self.write(segment, result)
  File "C:\Users\Ddr\Downloads\Temp\streamlink\packages\streamlink\stream\hls.py
", line 91, in write
    sequence.num)
     return AES.new(key_data, AES.MODE_CBC, iv)
  File "C:\Users\Ddr\Downloads\Temp\streamlink\packages\Crypto\Cipher\AES.py", l
ine 260, in new
    return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs)
  File "C:\Users\Ddr\Downloads\Temp\streamlink\packages\Crypto\Cipher\__init__.p
y", line 130, in _create_cipher
    return modes[mode](factory, **kwargs)
  File "C:\Users\Ddr\Downloads\Temp\streamlink\packages\Crypto\Cipher\_mode_cbc.
py", line 232, in _create_cbc_cipher
    cipher_state = factory._create_base_cipher(kwargs)
  File "C:\Users\Ddr\Downloads\Temp\streamlink\packages\Crypto\Cipher\AES.py", l
ine 127, in _create_base_cipher
    expect_byte_string(key)
  File "C:\Users\Ddr\Downloads\Temp\streamlink\packages\Crypto\Util\_raw_api.py"
, line 172, in expect_byte_string
    raise TypeError("Only byte strings can be passed to C code")
TypeError: Only byte strings can be passed to C code

You got an example URL so I can reproduce?

Take a look at E-Mail. ;)

I suspect it's because you are passing a string as the AES and you will need to pass bytes for Python3. eg. b"\xf3\x12\x32...", should be a simple fix.

Thanks.;)