Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some streams fail with "415 Unsupported Media Type" #307

Open
dagwieers opened this issue Jun 14, 2019 · 24 comments
Open

Some streams fail with "415 Unsupported Media Type" #307

dagwieers opened this issue Jun 14, 2019 · 24 comments
Labels
bug Something isn't working confirmed The issue has been confirmed by upstream project vrtmax Related to VRT MAX

Comments

@dagwieers
Copy link
Collaborator

dagwieers commented Jun 14, 2019

Describe the bug

There is an outstanding issue at VRT NU where some episodes do not work when using HLS streams (i.e. when not using Widevine). The problem has been reported a few times to VRT and they have confirmed this general issue. In most cases they will fix the faulty stream by hand when reported, but the root cause is yet unknown and unfixed.

This relates to #308, #311 and #538

To reproduce

Steps to reproduce the behavior:

  1. Disable Widevine (and restart the add-on)
  2. Go to program 24 hours in police custody
  3. Click on episode S04E05
  4. See error 415 Unsupported Media Type

Fix

  • Verify this issue on the VRT NU website (Apple Safari?) or in the VRT NU app (Iphone/Ipad?)
  • Report the stream to VRT NU at: https://www.vrt.be/vrtnu/help/
  • Do mention the error "415 Unsupported Media Type" and it is related to the HLS stream only.
  • Wait for VRT to fix the stream.

Work around

Enable Widevine in the settings so the VRT NU add-on selects te MPEG-DASH stream that is unaffected by this issue.

Additional context

  • Operating system: LibreELEC 9.0.2
  • Kodi version: Leia 18.2
  • Addon version: 1.10.0
  • Using a VPN: no
  • Country you are using the addon from: Belgium

Log (if available)

This is an example log from an earlier identical issue.

2019-06-14 02:24:56.218 T:1321550704  NOTICE: [plugin.video.vrt.nu] Got cached token '/storage/.kodi/userdata/addon_data/plugin.video.vrt.nu/ondemand_vrtPlayerToken.tkn'
2019-06-14 02:24:56.219 T:1321550704  NOTICE: [plugin.video.vrt.nu] URL get: https://media-services-public.vrt.be/vualto-video-aggregator-web/rest/external/v1/videos/pbs-pub-cd09cc3c-5178-49c1-9387-715cb9ad98ff$
vid-d0b7cfaa-fd96-448e-9923-281b10261bfa?vrtPlayerToken=b10@b04c02c93691e93774a02025a289e44ce86e4ef8fc3f9d567d427964d37a1c4c&client=vrtvideo
2019-06-14 02:24:56.466 T:1321550704  NOTICE: [plugin.video.vrt.nu] URL get: https://remix-cf-vrt.akamaized.net/remix/18f7b87b-2715-490c-9ac6-8f05fbf5c7e4/remix_aes.ism/.m3u8?hd
2019-06-14 02:24:56.655 T:1321550704   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'urllib2.HTTPError'>
                                            Error Contents: HTTP Error 415: Unsupported Media Type
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.vrt.nu/addon.py", line 13, in <module>
                                                router.router(sys.argv)
                                              File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/router.py", line 70, in router
                                                _vrtplayer.play(params)
                                              File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/vrtplayer.py", line 222, in play
                                                stream = _streamservice.get_stream(params)
                                              File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/streamservice.py", line 245, in get_stream
                                                stream = StreamURLS(*self._select_hls_substreams(manifest_url))
                                              File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/streamservice.py", line 276, in _select_hls_substreams
                                                hls_playlist = urlopen(master_hls_url).read().decode('utf-8')
                                              File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
                                              File "/usr/lib/python2.7/urllib2.py", line 435, in open
                                              File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
                                              File "/usr/lib/python2.7/urllib2.py", line 473, in error
                                              File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
                                              File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
                                            HTTPError: HTTP Error 415: Unsupported Media Type
                                            -->End of Python script error report<--
2019-06-14 02:24:56.679 T:1937156496   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.vrt.nu/?publication_id=pbs-pub-cd09cc3c-5178-49c1-9387-715cb9ad98ff&action=play&video_id=vi
d-d0b7cfaa-fd96-448e-9923-281b10261bfa&video_url=https%3A%2F%2Fwww.vrt.be%2Fvrtnu%2Fa-z%2Fappel-d-urgence%2F2%2Fappel-d-urgence-s2a1%2F]
@dagwieers dagwieers added the bug Something isn't working label Jun 14, 2019
@dagwieers dagwieers added this to the v1.10.1 milestone Jun 14, 2019
@michaelarnauts
Copy link
Contributor

I saw this also with an episode of Karrewiet. This also occured on the vrt.nu website. I reported this to vrt and they had fixed this.

This might have nothing to do with the add-on...

@mediaminister
Copy link
Collaborator

mediaminister commented Jun 14, 2019

Indeed, it doesn't play on VRT NU website either:
https://www.vrt.be/vrtnu/a-z/appel-d-urgence/2/appel-d-urgence-s2a1/
And this error was reported to VRT NU, but they denied that there was a problem. Unbelievable!
https://twitter.com/bertvandepoel/status/1138232737263960064

This problem only occurs with the HLS-stream, the MPEG-DASH stream is working, when you enable inputstream adaptive, the stream plays fine.

@dagwieers
Copy link
Collaborator Author

dagwieers commented Jun 14, 2019

@mediaminister I did try using inputstream.adaptive though, but maybe something else was wrong. Will try again later. It indeed works fine using inputstream.adaptive.

Should we provide a more sensible error to the user? E.g. try again with or without inputstream.adaptive, try running it from VRT NU website and report to VRT.

Thanks everyone.

@mediaminister
Copy link
Collaborator

Okay, I'll "fix" this providing a message to the user.
And VRT should fix this problem as explained here: https://docs.unified-streaming.com/documentation/vod/troubleshooting.html#unsupported-media-type

@dagwieers
Copy link
Collaborator Author

dagwieers commented Jun 14, 2019

I added a vrtnu label so we can also track issues that originate at VRT NU. Personally I am a big fan to also track issues here that originate at VRT for the simple reason that we could improve the Kodi plugin (either with a workaround, or with better error messages like we did here).

At some point we will cover most of the common/recurring issues with proper messages so that our users know exactly what to expect (and confidence in our solution stays high despite glitches elsewhere).

@dagwieers

This comment has been minimized.

@mediaminister

This comment has been minimized.

@dagwieers

This comment has been minimized.

@dagwieers

This comment has been minimized.

@mediaminister

This comment has been minimized.

@dagwieers

This comment has been minimized.

@mediaminister

This comment has been minimized.

@dagwieers dagwieers pinned this issue Jun 20, 2019
@dagwieers

This comment has been minimized.

@mediaminister
Copy link
Collaborator

mediaminister commented Jun 20, 2019

Using Widevine DRM is always a free user choice, for livestreaming and for VOD. The cause of your problem was definitely the DRM option, I overlooked that. I improved the stream error message accordingly in: #332

@dagwieers dagwieers modified the milestones: v1.10.1, v2.0.0 Jun 24, 2019
@mediaminister
Copy link
Collaborator

mediaminister commented Jun 26, 2019

Already four episodes of Appel d'urgence are affected and VRT didn't fix this yet...

@dagwieers dagwieers modified the milestones: v2.0.0, Future Jun 26, 2019
@mediaminister
Copy link
Collaborator

mediaminister commented Jun 28, 2019

Okay, VRT NU fixed this yesterday.

@dagwieers dagwieers unpinned this issue Jul 2, 2019
@dagwieers dagwieers modified the milestones: Future, v2.1.0 Jul 6, 2019
@dagwieers dagwieers added this to the Future milestone Jul 6, 2019
@dagwieers dagwieers removed this from the Future milestone Sep 17, 2019
@dagwieers
Copy link
Collaborator Author

dagwieers commented Oct 23, 2019

I reported another issue related to HLS stream playback (episode S04E05 of 24 hours in police custody) and VRT confirmed they still have intermittent issues related to this that they are trying to get fixed, so it still may happen from time to time...

@dagwieers dagwieers changed the title HTTP Error 415: Unsupported Media Type Some HLS streams fail: HTTP Error 415: Unsupported Media Type Oct 23, 2019
@dagwieers dagwieers changed the title Some HLS streams fail: HTTP Error 415: Unsupported Media Type Some HLS streams fail with "415 Unsupported Media Type" Oct 23, 2019
@dagwieers dagwieers added the confirmed The issue has been confirmed by upstream project label Oct 23, 2019
@dagwieers dagwieers reopened this Oct 23, 2019
@mediaminister
Copy link
Collaborator

VRT NU uses Unified Origin and HTTP Error 415 is documented, only VRT NU can fix it: https://docs.unified-streaming.com/documentation/vod/index.html

@dagwieers
Copy link
Collaborator Author

dagwieers commented Feb 2, 2020

So we discovered that the VRT Radio2 live stream also suffers from this issue:
#685 (comment)

I opened a dedicated ticket for this at #735

@dagwieers
Copy link
Collaborator Author

dagwieers commented Apr 10, 2020

This happened again last night on the latest De Afspraak episode (2020-04-09).
https://www.vrt.be/vrtnu/a-z/de-afspraak/2020/de-afspraak-d20200409/

I reported it to VRT NU.

2020-04-10 02:12:52.074 T:1378874240  NOTICE: [plugin.video.vrt.nu] Access: plugin://plugin.video.vrt.nu/play/id/vid-84618801-4e10-46a2-9403-d444fce53630/pbs-pub-0738b2b8-4242-4783-9686-8edb3f66be79
2020-04-10 02:12:52.106 T:1378874240  NOTICE: [plugin.video.vrt.nu] Got cached token '/storage/.kodi/userdata/addon_data/plugin.video.vrt.nu/tokens/ondemand_vrtPlayerToken.tkn'
2020-04-10 02:12:52.110 T:1378874240  NOTICE: [plugin.video.vrt.nu] URL get: https://media-services-public.vrt.be/vualto-video-aggregator-web/rest/external/v1/videos/pbs-pub-0738b2b8-4242-4783-9686-8edb3f66be79$vid-84618801-4e10-46a2-9403-d444fce53630?vrtPlayerToken=b10@e5af19407961d59b683f1b2c7384165485b11852a527bf030d3c1dd0f940cca3&client=vrtvideo@PROD
2020-04-10 02:12:52.487 T:1378874240  NOTICE: [plugin.video.vrt.nu] Protocol: mpeg_dash
2020-04-10 02:12:52.700 T:1378874240  NOTICE: [plugin.video.vrt.nu] Play: https://ondemand-cf.lwc.vrtcdn.be/content/vod/vid-84618801-4e10-46a2-9403-d444fce53630-CDN_5/vid-84618801-4e10-46a2-9403-d444fce53630-CDN_5_nodrm_90b2af9a-63cf-478e-b20b-46e7aec0c0cb.ism/.mpd
2020-04-10 02:12:52.730 T:1937706416  NOTICE: VideoPlayer::OpenFile: plugin://plugin.video.vrt.nu/play/id/vid-84618801-4e10-46a2-9403-d444fce53630/pbs-pub-0738b2b8-4242-4783-9686-8edb3f66be79
2020-04-10 02:12:52.736 T:1432351616  NOTICE: Creating InputStream
2020-04-10 02:12:52.761 T:1465889664  NOTICE: [plugin.video.vrt.nu] [PlayerInfo 9559] Event onPlayBackStarted
2020-04-10 02:12:52.764 T:1465889664  NOTICE: [plugin.video.vrt.nu] URL get: https://vrtnu-api.vrt.be/search?i=video&facets[videoId]=vid-84618801-4e10-46a2-9403-d444fce53630&size=1
2020-04-10 02:12:53.323 T:1432351616   ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 415
2020-04-10 02:12:53.323 T:1432351616   ERROR: CCurlFile::Open failed with code 415 for https://ondemand-cf.lwc.vrtcdn.be/content/vod/vid-84618801-4e10-46a2-9403-d444fce53630-CDN_5/vid-84618801-4e10-46a2-9403-d444fce53630-CDN_5_nodrm_90b2af9a-63cf-478e-b20b-46e7aec0c0cb.ism/.mpd:
2020-04-10 02:12:53.323 T:1432351616   ERROR: AddOnLog: InputStream Adaptive: Cannot download https://ondemand-cf.lwc.vrtcdn.be/content/vod/vid-84618801-4e10-46a2-9403-d444fce53630-CDN_5/vid-84618801-4e10-46a2-9403-d444fce53630-CDN_5_nodrm_90b2af9a-63cf-478e-b20b-46e7aec0c0cb.ism/.mpd
2020-04-10 02:12:53.323 T:1432351616   ERROR: AddOnLog: InputStream Adaptive: Could not open / parse mpdURL (https://ondemand-cf.lwc.vrtcdn.be/content/vod/vid-84618801-4e10-46a2-9403-d444fce53630-CDN_5/vid-84618801-4e10-46a2-9403-d444fce53630-CDN_5_nodrm_90b2af9a-63cf-478e-b20b-46e7aec0c0cb.ism/.mpd)
2020-04-10 02:12:53.324 T:1432351616   ERROR: CVideoPlayer::OpenInputStream - error opening [plugin://plugin.video.vrt.nu/play/id/vid-84618801-4e10-46a2-9403-d444fce53630/pbs-pub-0738b2b8-4242-4783-9686-8edb3f66be79]
2020-04-10 02:12:53.324 T:1432351616  NOTICE: CVideoPlayer::OnExit()
2020-04-10 02:12:53.382 T:1937706416  NOTICE: CVideoPlayer::CloseFile()
2020-04-10 02:12:53.383 T:1937706416  NOTICE: VideoPlayer: waiting for threads to exit
2020-04-10 02:12:53.383 T:1937706416  NOTICE: VideoPlayer: finished waiting
2020-04-10 02:12:53.403 T:1465889664  NOTICE: [plugin.video.vrt.nu] [PlayerInfo 9559] Event onPlayBackStopped

@mediaminister
Copy link
Collaborator

This time only the MPEG DASH stream failed, HLS was fine.

This means Inputstream Adaptive detects the HTTP 415 error, but as far as I know there is no interface to catch the error in Python and show an error message to the user...

@dagwieers
Copy link
Collaborator Author

We cannot easily handle this better. We handed this over to IA and any conceivable way to check playback is worse than the problem IMO.

@dagwieers dagwieers changed the title Some HLS streams fail with "415 Unsupported Media Type" Some streams fail with "415 Unsupported Media Type" Apr 10, 2020
@mediaminister
Copy link
Collaborator

If xbmc.Player.onPlayBackError could return http errors, then it would be easy to automatically select the HLS stream if MPEG DASH failed.

@dagwieers
Copy link
Collaborator Author

dagwieers commented Apr 10, 2020

Can we make a new ticket for this?

This might also be the right way to handle Widevine issues. There is a missing link there too that we can have add-ons support through inputstreamhelper.

Update: I opened #727 for this. Now we need to report this upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed The issue has been confirmed by upstream project vrtmax Related to VRT MAX
Projects
None yet
Development

No branches or pull requests

3 participants