wernerkarlheisenberg / plex-stieve

Plex Plugin to view Medialaan channels (VTM, Q2, Vitaya, VTM Kzoom, Kadet, CAZ) live using Stievie FREE.
7 stars 1 forks source link

KeyError: 'hls' on playing stream #11

Open idfxken opened 5 years ago

idfxken commented 5 years ago

On starting any channel it spits the KeyError 'hls' and results in a http 500 error in return

This is running on debian stretch. Don't really know where to start looking :S

The relevant error in com.plexapp.system.log output:

2018-08-04 19:21:35,737 (7f55677fe700) :  DEBUG (runtime:717) - Handling request GET /:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.stievie/Stievie/PlayVideo.m3u8?args=Y2VyZWFsMQoxCnR1cGxlCjAKcjAK&kwargs=Y2VyZWFsMQoxCmRpY3QKMQpzMTI4Cmh0dHBzOi8vc3RyZWFtLWxpdmUubWVkaWFsYWFuLmlvL3N0cmVhbS1saXZlL3YxL2NoYW5uZWxzL3Z0bS9icm9hZGNhc3RzL2N1cnJlbnQvdmlkZW8vP2RldmljZUlkPWRlZjQ4MGZmMjVjYTZiYmM2YTBlYTg0ZTVmMGRhODRlczMKdXJscjAK&indirect=1&mediaInfo=%7B%22audio_channels%22%3A%201%2C%20%22protocol%22%3A%20%22hls%22%2C%20%22optimized_for_streaming%22%3A%20true%2C%20%22video_frame_rate%22%3A%20null%2C%20%22duration%22%3A%20null%2C%20%22height%22%3A%20360%2C%20%22width%22%3A%20640%2C%20%22container%22%3A%20%22mpegts%22%2C%20%22audio_codec%22%3A%20%22aac%22%2C%20%22aspect_ratio%22%3A%20null%2C%20%22video_codec%22%3A%20%22h264%22%2C%20%22video_resolution%22%3A%20%22sd%22%2C%20%22bitrate%22%3A%20null%7D
2018-08-04 19:21:35,742 (7f55677fe700) :  DEBUG (runtime:814) - Found route matching /:/plugins/com.plexapp.system/serviceFunction/url/com.plexapp.plugins.stievie/Stievie/PlayVideo.m3u8
2018-08-04 19:21:35,747 (7f55677fe700) :  DEBUG (preferences:178) - Reloaded the user preferences for com.plexapp.plugins.stievie
2018-08-04 19:21:36,823 (7f55677fe700) :  CRITICAL (sandbox:303) - Exception when calling function 'PlayVideo' (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 294, in call_named_function
    result = f(*args, **kwargs)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 85, in __call__
    return self._f(*args, **kwargs)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Stievie.bundle/Contents/Services/URL/Stievie/ServiceCode.pys", line 58, in PlayVideo
    video_url = requests.get(StreamURL(url)).content.split('\n')[3]
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Stievie.bundle/Contents/Services/URL/Stievie/ServiceCode.pys", line 69, in StreamURL
    return  stream_url_resp.json()['response']['url']['hls']
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 108, in <lambda>
    _getitem_           = lambda x, y: x.__getitem__(y),
KeyError: 'hls'

2018-08-04 19:21:36,825 (7f55677fe700) :  CRITICAL (runtime:889) - Exception (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 843, in handle_request
    result = f(**d)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/handlers/services.py", line 150, in call_service_function
    result = self._core.services._call_named_function_in_service(f_name, service, f_args, f_kwargs)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/services.py", line 589, in _call_named_function_in_service
    return self._call_named_function_in_sandbox(service.sandbox, fname, None, f_args, f_kwargs, allow_deferred, raise_exceptions, f_optional)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/services.py", line 573, in _call_named_function_in_sandbox
    result = sandbox.call_named_function(fname, allow_deferred=allow_deferred, raise_exceptions=raise_exceptions, args=f_args, kwargs=f_kwargs, mod_name=mod_name, optional_kwargs=f_optional)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 294, in call_named_function
    result = f(*args, **kwargs)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/runtime.py", line 85, in __call__
    return self._f(*args, **kwargs)
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Stievie.bundle/Contents/Services/URL/Stievie/ServiceCode.pys", line 58, in PlayVideo
    video_url = requests.get(StreamURL(url)).content.split('\n')[3]
  File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Stievie.bundle/Contents/Services/URL/Stievie/ServiceCode.pys", line 69, in StreamURL
    return  stream_url_resp.json()['response']['url']['hls']
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-6fa5e50a8/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 108, in <lambda>
    _getitem_           = lambda x, y: x.__getitem__(y),
KeyError: 'hls'

2018-08-04 19:21:36,828 (7f55677fe700) :  DEBUG (runtime:88) - Sending packed state data (99 bytes)
2018-08-04 19:21:36,828 (7f55677fe700) :  DEBUG (runtime:924) - Response: [500] 2501 `bytes`

Logs:

com.plexapp.plugins.stievie.log com.plexapp.system.log Plex Media Server.log

wernerkarlheisenberg commented 5 years ago

Sorry for late reply. I noticed they changed to hls-aes, hls-aes-linear, ... However, if I change this, it still doesn't work. Having a deeper look, I noticed that Stievie is now using DRM. As Plex doesn't support DRM, I don't think we will get it working again :-(.