Solved m3u8 stream cookie issue?
#1
Video 
Hello guys,

i am currently developing an addon for akibapass.de, a legal german anime streaming site and the last without kodi plugin.
they offering two things:
1. you can buy anime and download them
2. you can have a premium subscription and stream anime

Since point 1 is easy, this is currently working.

But point 2 is a little bit more difficulty. i am at this point:
  1. Get the link to the main mnf-file* (m3u8) which contains one audio stream and multiple video streams (different resolution).
  2. Pass the link to Kodi with cookies
  3. Kodi retrieves the file
  4. Kodi decide to use the 1080p stream
  5. Kodi get the mnfsnd-file** (m3u8) (without cookies?)
  6. The file contains "Error code 000008"
  7. Failed to play video
* = it is a one-use link, cookies are required
** = link can be used multiple times, cookies are required

Full debug log of this process: https://gist.github.com/MrKrabat/0ffd135...2d9610d0c5
mnf and 1080p-mnfsnd: https://gist.github.com/MrKrabat/8782368...b95d1d0fc8

Now comes the clue:
When i directly give kodi the link (with cookies) to the mnfsnd-file (audio or video) it plays successful.

Plugin source: https://github.com/MrKrabat/plugin.video.akibapass
Here is the streaming part https://github.com/MrKrabat/plugin.video...pi.py#L279 (links to old commit)
I am developing on Kodi 17.4 using the latest windows store build.

Some questions:
  1. Is Kodi not using the cookies at the second call? I looked at your bug tracker and this should be fixed since 17.0
  2. Is it possible to parse the m3u8 myself and pass audio and video m3u8 separate to Kodi like having an external audio source? Like this?
  3. Could the inputstream plugin be the solution? How do i implement this?
Or any other suggestions?

Greetings,
MrKrabat

PS: Even if i say "Kodi" everytime, i know that ffmpeg is doing most of this Angel
Reply
#2
At first sorry for the double post,

i found the reason why this is not working and how to fix it.


The problem is, that the first manifest file is a one-use link but kodi access it two times!
Kodi downloads the file --> check how to handle it
ffmpeg downloads the file --> Error 00008 link already used

Solution:
Download the file, start a local server providing it for kodi, SUCCESSFUL.
(passing it to kodi as local file did not work, since it requires cookies but you can't set cookies for a local file)

EDIT: Kodi actually access the file 4 times. wow.

EDIT 2:
Solution 2:
Code:
item = xbmcgui.ListItem(...)
item.setMimeType("application/vnd.apple.mpegurl")
item.setContentLookup(False)
With this Code Kodi access the url only one time! Smile
Reply

Logout Mark Read Team Forum Stats Members Help
m3u8 stream cookie issue?0