How to pass Cookies with m3u8 file to ffmpeg
#1
There is a Cookie Option for ffmpeg.
How to pass the Cookies from the plugin line....
Code:
xbmcplugin.setResolvedUrl(pluginHandle, True, xbmcgui.ListItem(path = finalurl))
where finalurl is something like
http://url.com/master.m3u8?bla=&bla2=anotheroption.
to ffmpeg.

It Looks like the "|" Operator with http://url.com/master.m3u8?bla=&bla2=ano...ion|Cookie=....
is not working.

And last but not least how to pass more then 1 Cookie line to it?
Reply
#2
Have you tried using a nightly/monthly Gotham build? Frodo[ffmpeg] doesn't handle cookies properly with m3u8 streams.
Reply
#3
I tried a nigthly build of gotham....

When searching for ffmpeg and Cookies you will find something like this...

ffmpeg -cookies "NAME=VALUE; path=/; domain=localhost; secure "

So how to pass the Cookie to ffmpeg. Looks like xbmc is not able to do this.
Reply
#4
I am also looking at how to do this in XBMC. Couple findings that I've encountered;
1. http://www.ffmpeg.org/ffmpeg-protocols.h...TP-Cookies says that you can use the "cookies" option, but specifying it yields an error "cookie is not a valid option"
2. specifying the User-Agent and Cookie in XBMC as http://localhost/mystream.m3u8|User-Agen...okie=yummy

with #2, the first access to the url yields the expected result, i can see the user-agent and cookie being set. since mystream has a ext-x-key uri, it attempts to fetch it but this time around, the user-agent is XBMC blah blah blah, finally it gets to ffmpeg it is now "libavc" (or something like that). then the cookie is no where to be found.

am i specifying the url incorrectly at step 2? or is it simply not supported for the time being?
Reply
#5
(2013-10-10, 03:13)canucks Wrote: with #2, the first access to the url yields the expected result, i can see the user-agent and cookie being set. since mystream has a ext-x-key uri, it attempts to fetch it but this time around, the user-agent is XBMC blah blah blah, finally it gets to ffmpeg it is now "libavc" (or something like that). then the cookie is no where to be found.

Hit that issue too and it seems to be a ffmpeg bug: https://trac.ffmpeg.org/ticket/3024
Too bad that ffmpeg isn't bumped very often by the xbmc devs Sad
Reply
#6
I have a similar problem. I get server error 403 despite I have setting cookie. The same request works with firefox's firebug and mitmproxy but doesn't work with kodi.
Below the log.
Thanks in advance.

Code:
20:57:15.725 T:139928658753280    INFO: CPythonInvoker(13, /home/matteo/.kodi/addons/plugin.video.mtv.it/default.py): script successfully run
20:57:15.741 T:139929956341504   DEBUG: Thread scriptobs 139929956341504 terminating
20:57:15.741 T:139931449338240    INFO: easy_aquire - Created session to https://cp105701-f.akamaihd.net
20:57:15.774 T:139928658753280    INFO: Python script stopped
20:57:15.774 T:139928658753280   DEBUG: Thread LanguageInvoker 139928658753280 terminating
20:57:16.376 T:139931449338240   DEBUG: CCurlFile::GetMimeType - https://cp105701-f.akamaihd.net/i/mtviestor/_!/intlod/MTVInternational/MBUS/TACTIC/201606/VIAMTVIPYC3186ZBVO8/it_awkward_524_clip04_,384x216_400_m30,512x288_750_m30,640x360_1200_m30,768x432_1700_m30,960x540_2200_m31,1280x720_3500_h32,.mp4.csmil/index_5_av.m3u8?e=e2006a2dec61af0a&id=AgBf9U9qX2VyHw0AAVk4Rva4b1zqNHViq1683krXKNixV7FNFpQWlpFdp7gF7953JXlG%2f24WfSpE6A%3d%3d&__s__=&__a__=off|Cookie=hdnea2%3Dexpires%3D1493324172%7Eaccess%3D%2F%2A%7Emd5%3Df168b329b3ed22565cdfef7599dfd00d%3B+path%3D%2F%3B+domain%3Dcp105701-f.akamaihd.net%3B -> application/vnd.apple.mpegurl
20:57:16.378 T:139931449338240   DEBUG: Loading settings for https://cp105701-f.akamaihd.net/i/mtviestor/_!/intlod/MTVInternational/MBUS/TACTIC/201606/VIAMTVIPYC3186ZBVO8/it_awkward_524_clip04_,384x216_400_m30,512x288_750_m30,640x360_1200_m30,768x432_1700_m30,960x540_2200_m31,1280x720_3500_h32,.mp4.csmil/index_5_av.m3u8?e=e2006a2dec61af0a&id=AgBf9U9qX2VyHw0AAVk4Rva4b1zqNHViq1683krXKNixV7FNFpQWlpFdp7gF7953JXlG%2f24WfSpE6A%3d%3d&__s__=&__a__=off|Cookie=hdnea2%3Dexpires%3D1493324172%7Eaccess%3D%2F%2A%7Emd5%3Df168b329b3ed22565cdfef7599dfd00d%3B+path%3D%2F%3B+domain%3Dcp105701-f.akamaihd.net%3B
20:57:16.379 T:139931449338240   DEBUG: CPlayerCoreFactory::GetPlayers(https://cp105701-f.akamaihd.net/i/mtviestor/_!/intlod/MTVInternational/MBUS/TACTIC/201606/VIAMTVIPYC3186ZBVO8/it_awkward_524_clip04_,384x216_400_m30,512x288_750_m30,640x360_1200_m30,768x432_1700_m30,960x540_2200_m31,1280x720_3500_h32,.mp4.csmil/index_5_av.m3u8?e=e2006a2dec61af0a&id=AgBf9U9qX2VyHw0AAVk4Rva4b1zqNHViq1683krXKNixV7FNFpQWlpFdp7gF7953JXlG%2f24WfSpE6A%3d%3d&__s__=&__a__=off|Cookie=hdnea2%3Dexpires%3D1493324172%7Eaccess%3D%2F%2A%7Emd5%3Df168b329b3ed22565cdfef7599dfd00d%3B+path%3D%2F%3B+domain%3Dcp105701-f.akamaihd.net%3B)
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: system rules
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: system rules
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: mms/udp
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtmp
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: streams
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: streams
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: aacp/sdp
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: mp2
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvd
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvdimage
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: nsv
20:57:16.379 T:139931449338240   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: radio
20:57:16.379 T:139931449338240   DEBUG: CPlayerCoreFactory::GetPlayers: matched 0 rules with players
20:57:16.379 T:139931449338240   DEBUG: CPlayerCoreFactory::GetPlayers: adding videodefaultplayer (VideoPlayer)
20:57:16.379 T:139931449338240   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=0
20:57:16.379 T:139931449338240   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=1
20:57:16.379 T:139931449338240   DEBUG: CPlayerCoreFactory::GetPlayers: added 1 players
20:57:16.380 T:139931449338240   DEBUG: Radio UECP (RDS) Processor - new CDVDRadioRDSData
20:57:16.380 T:139931449338240  NOTICE: VideoPlayer: Opening: https://cp105701-f.akamaihd.net/i/mtviestor/_!/intlod/MTVInternational/MBUS/TACTIC/201606/VIAMTVIPYC3186ZBVO8/it_awkward_524_clip04_,384x216_400_m30,512x288_750_m30,640x360_1200_m30,768x432_1700_m30,960x540_2200_m31,1280x720_3500_h32,.mp4.csmil/index_5_av.m3u8?e=e2006a2dec61af0a&id=AgBf9U9qX2VyHw0AAVk4Rva4b1zqNHViq1683krXKNixV7FNFpQWlpFdp7gF7953JXlG%2f24WfSpE6A%3d%3d&__s__=&__a__=off|Cookie=hdnea2%3Dexpires%3D1493324172%7Eaccess%3D%2F%2A%7Emd5%3Df168b329b3ed22565cdfef7599dfd00d%3B+path%3D%2F%3B+domain%3Dcp105701-f.akamaihd.net%3B
20:57:16.380 T:139931449338240 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
20:57:16.775 T:139931449338240   DEBUG: CCurlFile::GetMimeType - https://cp105701-f.akamaihd.net/i/mtviestor/_!/intlod/MTVInternational/MBUS/TACTIC/201606/VIAMTVIPYC3186ZBVO8/it_awkward_524_clip04_,384x216_400_m30,512x288_750_m30,640x360_1200_m30,768x432_1700_m30,960x540_2200_m31,1280x720_3500_h32,.mp4.csmil/index_5_av.m3u8?e=e2006a2dec61af0a&id=AgBf9U9qX2VyHw0AAVk4Rva4b1zqNHViq1683krXKNixV7FNFpQWlpFdp7gF7953JXlG%2f24WfSpE6A%3d%3d&__s__=&__a__=off|Cookie=hdnea2%3Dexpires%3D1493324172%7Eaccess%3D%2F%2A%7Emd5%3Df168b329b3ed22565cdfef7599dfd00d%3B+path%3D%2F%3B+domain%3Dcp105701-f.akamaihd.net%3B -> application/vnd.apple.mpegurl
20:57:16.775 T:139931449338240   DEBUG: LinuxRendererGL: Cleaning up GL resources
20:57:16.776 T:139931449338240   DEBUG: CLinuxRendererGL::PreInit - precision of luminance 16 is 16
20:57:16.776 T:139929956341504   DEBUG: Thread VideoPlayer start, auto delete: false
20:57:16.776 T:139929956341504  NOTICE: Creating InputStream
20:57:16.776 T:139929956341504   DEBUG: CurlFile::Open(0x7f43fb574670) https://cp105701-f.akamaihd.net/i/mtviestor/_!/intlod/MTVInternational/MBUS/TACTIC/201606/VIAMTVIPYC3186ZBVO8/it_awkward_524_clip04_,384x216_400_m30,512x288_750_m30,640x360_1200_m30,768x432_1700_m30,960x540_2200_m31,1280x720_3500_h32,.mp4.csmil/index_5_av.m3u8?e=e2006a2dec61af0a&id=AgBf9U9qX2VyHw0AAVk4Rva4b1zqNHViq1683krXKNixV7FNFpQWlpFdp7gF7953JXlG%2f24WfSpE6A%3d%3d&__s__=&__a__=off
20:57:17.061 T:139929956341504   ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 403
20:57:17.061 T:139929956341504   ERROR: CCurlFile::Open failed with code 403 for https://cp105701-f.akamaihd.net/i/mtviestor/_!/intlod/MTVInternational/MBUS/TACTIC/201606/VIAMTVIPYC3186ZBVO8/it_awkward_524_clip04_,384x216_400_m30,512x288_750_m30,640x360_1200_m30,768x432_1700_m30,960x540_2200_m31,1280x720_3500_h32,.mp4.csmil/index_5_av.m3u8?e=e2006a2dec61af0a&id=AgBf9U9qX2VyHw0AAVk4Rva4b1zqNHViq1683krXKNixV7FNFpQWlpFdp7gF7953JXlG%2f24WfSpE6A%3d%3d&__s__=&__a__=off|Cookie=hdnea2%3Dexpires%3D1493324172%7Eaccess%3D%2F%2A%7Emd5%3Df168b329b3ed22565cdfef7599dfd00d%3B+path%3D%2F%3B+domain%3Dcp105701-f.akamaihd.net%3B
20:57:17.062 T:139929956341504  NOTICE: Creating Demuxer
20:57:17.062 T:139929956341504   DEBUG: CDVDDemuxFFmpeg::GetFFMpegOptionsFromInput() adding ffmpeg option 'cookies: hdnea2=expires=1493324172~access=/*~md5=f168b329b3ed22565cdfef7599dfd00d; path=/; domain=cp105701-f.akamaihd.net;'
20:57:17.276 T:139931449338240   DEBUG: ------ Window Init (DialogBusy.xml) ------
20:57:17.339 T:139929956341504   DEBUG: ffmpeg[7F43FB575700]: [https] HTTP error 403 Forbidden
20:57:17.341 T:139929956341504   DEBUG: Error, could not open file https://cp105701-f.akamaihd.net/i/mtviestor/_!/intlod/MTVInternational/MBUS/TACTIC/201606/VIAMTVIPYC3186ZBVO8/it_awkward_524_clip04_,384x216_400_m30,512x288_750_m30,640x360_1200_m30,768x432_1700_m30,960x540_2200_m31,1280x720_3500_h32,.mp4.csmil/index_5_av.m3u8?e=e2006a2dec61af0a&id=AgBf9U9qX2VyHw0AAVk4Rva4b1zqNHViq1683krXKNixV7FNFpQWlpFdp7gF7953JXlG%2f24WfSpE6A%3d%3d&__s__=&__a__=off
20:57:17.341 T:139929956341504   ERROR: OpenDemuxStream - Error creating demuxer
20:57:17.341 T:139929956341504  NOTICE: CVideoPlayer::OnExit()
20:57:17.341 T:139929956341504   DEBUG: OnPlayBackStopped: play state was 1, starting 1
20:57:17.341 T:139931449338240   DEBUG: OnPlayBackStopped: play state was 3, starting 0
20:57:17.341 T:139931449338240   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.mtv.it/?action=v&at=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJVU0VSSUQ6ZHBsYXlpdDo2NWZmZjMzYi1kMjAwLTQ3MjEtYTk1Ni01Y2FiZDYxM2E5MDYiLCJqdGkiOiJ0b2tlbi01MGNhN2E0Yi1mNzk2LTRmMWMtYjY0ZS03YzhkZmI3OGI2NDciLCJhbm9ueW1vdXMiOnRydWUsImlhdCI6MTQ5MzMxOTQzMH0%3D.xZCtZuGO55Zl2i4bNqqBMPpbJ5ZxC4eBa_iyylEQkzQ%3D__%21__IvBoGoxQFdz5NGMV%2BcYXh%2BY8%2B3Feek9FHS4%2BO6Fd0dI%3D&value=5221]
20:57:17.341 T:139931449338240   DEBUG: Playlist Player: no more playable items... aborting playback
20:57:17.341 T:139929956341504   DEBUG: Thread VideoPlayer 139929956341504 terminating
20:57:17.341 T:139929956341504   DEBUG: Thread BackgroundLoader start, auto delete: false
Reply

Logout Mark Read Team Forum Stats Members Help
How to pass Cookies with m3u8 file to ffmpeg0