kodi-pvr / pvr.vuplus

Kodi's Enigma2 client add-on
GNU General Public License v2.0
56 stars 55 forks source link

Stream authentification not working #331

Open romestylez opened 3 years ago

romestylez commented 3 years ago

Hello,

im using a vu+ duo². When im start Kodi and want to watch the TV program from my STB it is working fine when i use "8001" as the streaming port even when the option for authentification for streaming on the STB is activated.

When i switch the port to "8002" (transcoded) stream and have the auth for streaming option activated i cant watch any channel. Sometimes after restarting Kodi or just the PVR Plugin its working. When i deactivate "Stream authentification" i can watch the transcoded stream without any problem.

Is this a know bug/error ? Im wondering that sometimes its working for lets say ARD then i try different channels which arent working lets say RTL, ZDF etc then i try ARD and its also not working but when i then try ZDF its working. Sadly there is no pattern when what is working. Just when i disable the authentification for the stream its working fine.

phunkyfish commented 3 years ago

What do you mean by stream authentication?

Do you mean a username and password?

romestylez commented 3 years ago

What do you mean by stream authentication?

Do you mean a username and password?

Correct there is a setting at the OpenWebif Settings which is called "Enable Authetification for streaming". When i set this to yes its not working via Kodi but its working via VLC.

But i already found out its not a direct problem just with the Enigma2 PVR Client also the PVR IPTV Simple Client has the same problem.

When i check the Kodi log this it how it looks without authentification:

2021-02-27 10:30:01.015 T:8424 INFO : AddOnLog: pvr.vuplus: pvr.vuplus - GetChannelStreamProperties - for >channel: Das Erste HD, set Stream Program Number to 10301 - >http://root:mypassword@192.168.220.44:8002/1:0:19:283D:3FB:1:C00000:0:0:02021-02-27 10:30:01.037 T:8424 INFO >: VideoPlayer::OpenFile: pvr://channels/tv/All%20channels/pvr.vuplus_1472946342.pvr 2021-02-27 10:30:01.038 T:2452 INFO : Creating InputStream 2021-02-27 10:30:07.613 T:2452 INFO : Creating Demuxer 2021-02-27 10:30:07.635 T:2452 INFO : Opening stream: 0 source: 256 2021-02-27 10:30:07.635 T:2452 WARNING : CVideoPlayer::OpenStream - Unsupported stream 0. Stream disabled. 2021-02-27 10:30:07.635 T:2452 INFO : Opening stream: 1 source: 256 2021-02-27 10:30:07.635 T:2452 INFO : Finding audio codec for: 86018 2021-02-27 10:30:07.636 T:2452 INFO : CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac 2021-02-27 10:30:07.637 T:2452 INFO : Creating audio thread 2021-02-27 10:30:07.637 T:10184 INFO : running thread: CVideoPlayerAudio::Process() 2021-02-27 10:30:07.637 T:2452 INFO : Opening stream: 0 source: 256 2021-02-27 10:30:07.637 T:2452 INFO : Creating video codec with codec id: 27 2021-02-27 10:30:07.637 T:2452 INFO : CDVDVideoCodecFFmpeg::Open() Using codec: H.264 / AVC / MPEG-4 AVC / >MPEG-4 part 10 2021-02-27 10:30:07.638 T:2452 INFO : Creating video thread 2021-02-27 10:30:07.638 T:8716 INFO : running thread: video_thread 2021-02-27 10:30:07.638 T:8716 WARNING : DXVA::CContext::CreateContext: using app d3d11 device for decoding >due extended NV12 shared textures it's not supported. 2021-02-27 10:30:07.640 T:8716 INFO : DXVA::CDecoder::Open: Total video memory available is 4161 MB (dedicated >= 128 MB, shared = 4033 MB) 2021-02-27 10:30:07.678 T:8424 INFO : DXVA::CProcessorHD::InitProcessor: supported deinterlace methods: >blend:yes, bob:yes, adaptive:yes, mocomp:yes. 2021-02-27 10:30:07.695 T:8424 WARNING : CRendererHQ::CheckVideoParameters: chosen scaling method 1 is not >supported by renderer 2021-02-27 10:30:07.760 T:8424 INFO : Loading skin file: VideoFullScreen.xml, load type: KEEP_IN_MEMORY 2021-02-27 10:30:07.859 T:8716 INFO : CDVDVideoCodecFFmpeg::CDropControl: calculated diff time: 16666 2021-02-27 10:30:09.113 T:10184 INFO : CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac 2021-02-27 10:30:09.113 T:10184 INFO : Skipped 1 duplicate messages.. 2021-02-27 10:30:09.113 T:10184 INFO : Creating audio stream (codec id: 86018, channels: 2, sample rate: 48000, no >pass-through) 2021-02-27 10:30:09.139 T:1868 INFO : CActiveAESink::OpenSink - initialize sink 2021-02-27 10:30:11.439 T:8424 INFO : DXVA::CProcessorHD::InitProcessor: supported deinterlace methods: >blend:yes, bob:yes, adaptive:yes, mocomp:yes. 2021-02-27 10:30:11.505 T:8424 WARNING : CRendererHQ::CheckVideoParameters: chosen scaling method 1 is not >supported by renderer 2021-02-27 10:30:11.926 T:10184 INFO : CVideoPlayerAudio::Process - stream stalled

And this is how it looks when i turn on stream authentification at OpenWebif

2021-02-27 10:33:23.284 T:8424 INFO : AddOnLog: pvr.vuplus: pvr.vuplus - GetChannelStreamProperties - for >channel: Das Erste HD, set Stream Program Number to 10301 - >http://root:mypassword@192.168.220.44:8002/1:0:19:283D:3FB:1:C00000:0:0:0 2021-02-27 10:33:23.306 T:8424 INFO : VideoPlayer::OpenFile: >pvr://channels/tv/All%20channels/pvr.vuplus_1472946342.pvr 2021-02-27 10:33:23.306 T:7892 INFO : Creating InputStream 2021-02-27 10:33:23.502 T:7892 ERROR : CCurlFile::FillBuffer - Failed: HTTP returned error 502 2021-02-27 10:33:23.502 T:7892 ERROR : CCurlFile::Open failed with code 502 for >http://192.168.220.44:8002/1:0:19:283D:3FB:1:C00000:0:0:0:

2021-02-27 10:33:23.503 T:7892 ERROR : CVideoPlayer::OpenInputStream - error opening >[pvr://channels/tv/All%20channels/pvr.vuplus_1472946342.pvr] 2021-02-27 10:33:23.503 T:7892 INFO : CVideoPlayer::OnExit() 2021-02-27 10:33:23.517 T:8424 INFO : Loading skin file: DialogConfirm.xml, load type: KEEP_IN_MEMORY 2021-02-27 10:33:23.520 T:8424 INFO : CVideoPlayer::CloseFile() 2021-02-27 10:33:23.520 T:8424 INFO : VideoPlayer: waiting for threads to exit 2021-02-27 10:33:23.520 T:8424 INFO : VideoPlayer: finished waiting 2021-02-27 10:33:25.332 T:8424 WARNING : CGUIWindowManager - CGUIWindowManager::HandleAction - >ignoring action 107, because topmost modal dialog closing animation is running`

Funny thing is when i copy the URL which Kodi try to open and open it with VLC its working without any problem when i use a m3u8 file like this

EXTM3U

EXTVLCOPT--http-reconnect=true

EXTINF:-1,Das Erste HD

http://root:mypassword@192.168.220.44:8002/1:0:19:283D:3FB:1:C00000:0:0:0:

When i just copy and paste the url in the browser its not working. Must have something to do with the referral or the #EXTVLCOPT--http-reconnect=true parameter at the VLC file

phunkyfish commented 3 years ago

Sending a username and password over an unencrypted URL is not very secure. And I'm afraid I'm not familiar with how OpenATV does this authentication, but it would be classed as basic auth.

I'm not sure the username and password make sense over a local network. If you are doing this from an external network a VPN would be more secure (and not require a username and password). Essentially security on Enigma2 boxes is poor at best.

Can I ask what version of the add-on you are using? Is it on Kodi 18 or Kodi 19? It might make sense to try the Kodi 19 version if you are not already.

BTW a 502 error means it can't reach the network in question.

romestylez commented 3 years ago

Sending a username and password over an unencrypted URL is not very secure. And I'm afraid I'm not familiar with how OpenATV does this authentication, but it would be classed as basic auth.

I'm not sure the username and password make sense over a local network. If you are doing this from an external network a VPN would be more secure (and not require a username and password). Essentially security on Enigma2 boxes is poor at best.

Can I ask what version of the add-on you are using? Is it on Kodi 18 or Kodi 19? It might make sense to try the Kodi 19 version if you are not already.

BTW a 502 error means it can't reach the network in question.

I know about the security ;) Im working as an IT specialist so thats out of question but VPN isnt an option.

Im using it on Kodi. Yes i know Error 502 means its not reachable but as i said with the same link in VLC player its working ! I just can create a m3u8 file and paste this in http://root:mypass@192.168.220.44:8002/1:0:19:1198:406:1:C00000:0:0:0: then its working without any problem. So i guess its because its an m3u8 file and the pvr client is doing a web request but it seems like the web request isnt done correctly so the authentification is failing. I cant understand why its working via VLC maybe because its a different request. Also i can just choose "Media -> Open -> Network stream" and just paste the url in the stream will open fine.

Also im wondering why its working via Port 8001 but not via Port 8002.

When i disable the authentification for streaming at OpenWebif then its working even with the same URL as the user/pass is ignored. I will try to check also with Chrome/Firefox whats the problem i just cant understand why there is this option and its working with VLC player but not with the PVR Addon which is for this STB.

phunkyfish commented 3 years ago

You didn’t answer my question. Are you running kodi 18 or 19?

romestylez commented 3 years ago

You didn’t answer my question. Are you running kodi 18 or 19?

Oh sorry wanted to write „Im using it on Kodi 19“ just did a fresh install of Kodi and the PVR Addon on Fire Tv Stick and also on my Windows Pc both got the same error.

Maybe its possible to add an option when Authentification is activated that the stream gets opend the same way VLC does it.

As said when using authentification on port 8001 everything is working fine.

phunkyfish commented 3 years ago

There must be something with the transcoding implementation on OpenATV.

The way the stream is opened is via a kodi API. It’s not possible to just open it like VLC does I’m afraid.

If you open it using curl what happens?

romestylez commented 3 years ago

Yeah i also think its a problem with the openATV streamproxy.

I will test it with curl later but i guess since im getting a Error 502 also with Chrome/Firefox when usin stream authentification and port 8002 curl wont work also. Just wondering which way VLC open the stream aa its working without any problem.

Also vuplusTV on my iPhone is working with port 8002 and authentification.

romestylez commented 3 years ago

Sorry for the waiting time. I now tried again and found out the following problem

Kodi -> Failing with the error

2021-02-27 10:33:23.284 T:8424 INFO : AddOnLog: pvr.vuplus: pvr.vuplus - GetChannelStreamProperties - for >channel: Das Erste HD, set Stream Program Number to 10301 - >http://root:mypassword@192.168.220.44:8002/1:0:19:283D:3FB:1:C00000:0:0:0 2021-02-27 10:33:23.306 T:8424 INFO : VideoPlayer::OpenFile: >pvr://channels/tv/All%20channels/pvr.vuplus_1472946342.pvr 2021-02-27 10:33:23.306 T:7892 INFO : Creating InputStream 2021-02-27 10:33:23.502 T:7892 ERROR : CCurlFile::FillBuffer - Failed: HTTP returned error 502 2021-02-27 10:33:23.502 T:7892 ERROR : CCurlFile::Open failed with code 502 for http://192.168.220.44:8002/1:0:19:283D:3FB:1:C00000:0:0:0: 2021-02-27 10:33:23.503 T:7892 ERROR : CVideoPlayer::OpenInputStream - error opening >[pvr://channels/tv/All%20channels/pvr.vuplus_1472946342.pvr] 2021-02-27 10:33:23.503 T:7892 INFO : CVideoPlayer::OnExit() 2021-02-27 10:33:23.517 T:8424 INFO : Loading skin file: DialogConfirm.xml, load type: KEEP_IN_MEMORY 2021-02-27 10:33:23.520 T:8424 INFO : CVideoPlayer::CloseFile() 2021-02-27 10:33:23.520 T:8424 INFO : VideoPlayer: waiting for threads to exit 2021-02-27 10:33:23.520 T:8424 INFO : VideoPlayer: finished waiting 2021-02-27 10:33:25.332 T:8424 WARNING : CGUIWindowManager - CGUIWindowManager::HandleAction - >ignoring action 107, because topmost modal dialog closing animation is running`

Chrome/Firefox/Internet Explorer: When i open this link which i get from the openWebif Backend -> http://root:mypass@192.168.220.44:8002/1:0:19:1198:406:1:C00000:0:0:0: i get a 502 Error (same like when open with KODI)

When using curl its downloading the file and i can open that file with VLC to watch the stream

C:\Users\rome>curl http://root:mypassword@192.168.220.44:8002/1:0:19:1198:406:1:C00000:0:0:0: --output C:\Users\rome\Desktop\stream2.mkv % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1695k 0 1695k 0 0 113k 0 --:--:-- 0:00:15 --:--:-- 335k

I dont know but it seems like the PVR Client is using a "normal Chrome/Firefox/Internet Explorer" request to open the stream as its working with CURL and VLC

In the log i see this request

2021-02-27 10:33:23.502 T:7892 ERROR : CCurlFile::Open failed with code 502 for http://192.168.220.44:8002/1:0:19:283D:3FB:1:C00000:0:0:0:

For sure this request fails as the Username and Password isnt in so it gets a error 502 because its not allowed to open that "site"

romestylez commented 3 years ago

I have now tested very often and switched channels etc. sometimes for one channel its working also in KODI using the PVR Client. Right now i was able to open RTL when i try to switch to another channel it fails with the same error in the log file i showed above. Here is the log the first 2 channels it couldnt open the third random channel (kabel 1 hd) i clicked was played fine. Here is the log i marked fat from where it was working.

2021-03-01 17:56:12.780 T:11600 INFO : AddOnLog: pvr.vuplus: pvr.vuplus - GetChannelStreamProperties - for channel: SUPER RTL HD, set Stream Program Number to 11931 - http://root:mypassword@192.168.220.44:8002/1:0:19:2E9B:411:1:C00000:0:0:0 2021-03-01 17:56:12.800 T:11600 INFO : VideoPlayer::OpenFile: pvr://channels/tv/Alle%20Kan%c3%a4le/pvr.vuplus_122519432.pvr 2021-03-01 17:56:12.800 T:10988 INFO : Creating InputStream 2021-03-01 17:56:13.362 T:10988 ERROR : CCurlFile::FillBuffer - Failed: HTTP returned error 502 2021-03-01 17:56:13.362 T:10988 ERROR : CCurlFile::Open failed with code 502 for http://192.168.220.44:8002/1:0:19:2E9B:411:1:C00000:0:0:0: 2021-03-01 17:56:13.362 T:10988 ERROR : CVideoPlayer::OpenInputStream - error opening [pvr://channels/tv/Alle%20Kan%c3%a4le/pvr.vuplus_122519432.pvr] 2021-03-01 17:56:13.362 T:10988 INFO : CVideoPlayer::OnExit() 2021-03-01 17:56:13.379 T:11600 INFO : CVideoPlayer::CloseFile() 2021-03-01 17:56:13.379 T:11600 INFO : VideoPlayer: waiting for threads to exit 2021-03-01 17:56:13.379 T:11600 INFO : VideoPlayer: finished waiting 2021-03-01 17:56:15.758 T:11600 WARNING : CGUIWindowManager - CGUIWindowManager::HandleAction - ignoring action 107, because topmost modal dialog closing animation is running 2021-03-01 17:56:36.075 T:11600 INFO : AddOnLog: pvr.vuplus: pvr.vuplus - GetChannelStreamProperties - for channel: SWR BW HD, set Stream Program Number to 10303 - http://root:mypassword@192.168.220.44:8002/1:0:19:283F:3FB:1:C00000:0:0:0 2021-03-01 17:56:36.094 T:11600 INFO : VideoPlayer::OpenFile: pvr://channels/tv/Alle%20Kan%c3%a4le/pvr.vuplus_1146824350.pvr 2021-03-01 17:56:36.094 T:9652 INFO : Creating InputStream 2021-03-01 17:56:36.685 T:9652 ERROR : CCurlFile::FillBuffer - Failed: HTTP returned error 502 2021-03-01 17:56:36.685 T:9652 ERROR : CCurlFile::Open failed with code 502 for http://192.168.220.44:8002/1:0:19:283F:3FB:1:C00000:0:0:0: 2021-03-01 17:56:36.685 T:9652 ERROR : CVideoPlayer::OpenInputStream - error opening [pvr://channels/tv/Alle%20Kan%c3%a4le/pvr.vuplus_1146824350.pvr] 2021-03-01 17:56:36.685 T:9652 INFO : CVideoPlayer::OnExit() 2021-03-01 17:56:36.702 T:11600 INFO : CVideoPlayer::CloseFile() 2021-03-01 17:56:36.702 T:11600 INFO : VideoPlayer: waiting for threads to exit 2021-03-01 17:56:36.702 T:11600 INFO : VideoPlayer: finished waiting 2021-03-01 17:56:39.185 T:11600 INFO : AddOnLog: pvr.vuplus: pvr.vuplus - GetChannelStreamProperties - for channel: TELE 5 HD, set Stream Program Number to 5401 - http://root:mypassword@192.168.220.44:8002/1:0:19:1519:455:1:C00000:0:0:0 2021-03-01 17:56:39.207 T:11600 INFO : VideoPlayer::OpenFile: pvr://channels/tv/Alle%20Kan%c3%a4le/pvr.vuplus_77072100.pvr 2021-03-01 17:56:39.207 T:548 INFO : Creating InputStream 2021-03-01 17:56:40.403 T:548 ERROR : CCurlFile::FillBuffer - Failed: HTTP returned error 502 2021-03-01 17:56:40.403 T:548 ERROR : CCurlFile::Open failed with code 502 for http://192.168.220.44:8002/1:0:19:1519:455:1:C00000:0:0:0:
2021-03-01 17:56:40.403 T:548 ERROR : CVideoPlayer::OpenInputStream - error opening [pvr://channels/tv/Alle%20Kan%c3%a4le/pvr.vuplus_77072100.pvr] 2021-03-01 17:56:40.403 T:548 INFO : CVideoPlayer::OnExit() 2021-03-01 17:56:40.434 T:11600 INFO : CVideoPlayer::CloseFile() 2021-03-01 17:56:40.434 T:11600 INFO : VideoPlayer: waiting for threads to exit 2021-03-01 17:56:40.434 T:11600 INFO : VideoPlayer: finished waiting 2021-03-01 17:56:41.899 T:11600 WARNING : CGUIWindowManager - CGUIWindowManager::HandleAction - ignoring action 107, because topmost modal dialog closing animation is running 2021-03-01 17:56:46.478 T:11600 INFO : Skipped 3 duplicate messages.. 2021-03-01 17:56:46.478 T:11600 INFO : AddOnLog: pvr.vuplus: pvr.vuplus - GetChannelStreamProperties - for channel: kabel eins HD, set Stream Program Number to 61302 - http://root:mypassword@192.168.220.44:8002/1:0:19:EF76:3F9:1:C00000:0:0:0 2021-03-01 17:56:46.500 T:11600 INFO : VideoPlayer::OpenFile: pvr://channels/tv/Alle%20Kan%c3%a4le/pvr.vuplus_637682361.pvr 2021-03-01 17:56:46.500 T:3312 INFO : Creating InputStream 2021-03-01 17:56:56.180 T:10608 ERROR : AddOnLog: pvr.vuplus: pvr.vuplus - GetTunerSignal Could not parse e2ber from result! 2021-03-01 17:56:56.180 T:10608 ERROR : SignalQuality: Add-on 'Duo²:192.168.220.44' returned an error: server error 2021-03-01 17:56:56.756 T:10608 ERROR : AddOnLog: pvr.vuplus: pvr.vuplus - GetTunerSignal Could not parse e2ber from result! 2021-03-01 17:56:56.756 T:10608 ERROR : SignalQuality: Add-on 'Duo²:192.168.220.44' returned an error: server error 2021-03-01 17:56:56.962 T:3312 INFO : Creating Demuxer 2021-03-01 17:56:56.963 T:3312 INFO : Opening stream: 0 source: 256 2021-03-01 17:56:56.963 T:3312 WARNING : CVideoPlayer::OpenStream - Unsupported stream 0. Stream disabled. 2021-03-01 17:56:56.963 T:3312 INFO : Opening stream: 1 source: 256 2021-03-01 17:56:56.963 T:3312 INFO : Finding audio codec for: 86018 2021-03-01 17:56:56.963 T:3312 INFO : CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac 2021-03-01 17:56:56.963 T:3312 INFO : Creating audio thread 2021-03-01 17:56:56.964 T:13032 INFO : running thread: CVideoPlayerAudio::Process() 2021-03-01 17:56:56.964 T:3312 INFO : Opening stream: 0 source: 256 2021-03-01 17:56:56.964 T:3312 INFO : Creating video codec with codec id: 27 2021-03-01 17:56:56.964 T:3312 INFO : CDVDVideoCodecFFmpeg::Open() Using codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 2021-03-01 17:56:56.964 T:3312 INFO : Creating video thread 2021-03-01 17:56:56.964 T:12100 INFO : running thread: video_thread 2021-03-01 17:56:56.965 T:12100 WARNING : DXVA::CContext::CreateContext: using app d3d11 device for decoding due extended NV12 shared textures it's not supported. 2021-03-01 17:56:56.965 T:12100 INFO : DXVA::CDecoder::Open: Total video memory available is 4161 MB (dedicated = 128 MB, shared = 4033 MB) 2021-03-01 17:56:56.974 T:11600 INFO : DXVA::CProcessorHD::InitProcessor: supported deinterlace methods: blend:yes, bob:yes, adaptive:yes, mocomp:yes. 2021-03-01 17:56:56.988 T:11600 WARNING : CRendererHQ::CheckVideoParameters: chosen scaling method 1 is not supported by renderer 2021-03-01 17:56:57.101 T:12100 INFO : CDVDVideoCodecFFmpeg::CDropControl: calculated diff time: 16666 2021-03-01 17:56:57.336 T:10608 ERROR : AddOnLog: pvr.vuplus: pvr.vuplus - GetTunerSignal Could not parse e2ber from result! 2021-03-01 17:56:57.336 T:10608 ERROR : SignalQuality: Add-on 'Duo²:192.168.220.44' returned an error: server error 2021-03-01 17:56:57.737 T:13032 INFO : CDVDAudioCodecFFmpeg::Open() Successful opened audio decoder aac 2021-03-01 17:56:57.738 T:13032 INFO : Skipped 1 duplicate messages.. 2021-03-01 17:56:57.738 T:13032 INFO : Creating audio stream (codec id: 86018, channels: 2, sample rate: 48000, no pass-through) 2021-03-01 17:56:57.738 T:13096 INFO : CActiveAESink::OpenSink - initialize sink

romestylez commented 3 years ago

Is it possbile to change tha standard player which is used by Kod or the PVR Plugin ? Maybe its working if i change it to VLC as its working with VLC on Pc/mobile phone without any problem. Maybe its a problem of the default player i dont know but would be a try.

phunkyfish commented 3 years ago

Please use a paste site if you are posting logs.

FYI, kodi is a player. There is no option to play with something else.

romestylez commented 3 years ago

Yeah Kodi is a player i thought its possible to use a external player inread something at google where you can set rules etc

phunkyfish commented 3 years ago

Maybe on android, but I don’t really know.

phunkyfish commented 2 years ago

Did you ever progress this? I ran a test on my device (VU+ Ultimo) running OpenVix latest and it works for me ok.