Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffplay with cookies

Tags:

ffmpeg

Normally with ffplay you can play a video like this

ffplay http://easy.com/foo.flv

However I have come across a video that requires a cookie. wget has no trouble with this

wget http://hard.com/foo.flv --load-cookies cookies.txt

Can ffplay play a video that requires a cookie?

Based on pogorskiy’s answer this works

ffplay -headers $'Cookie: sbsession=sbg&sbuser=lorem\r\n' http://hard.com/foo.flv
like image 595
Zombo Avatar asked Dec 27 '22 13:12

Zombo


1 Answers

There is an option -headers in the http protocol. Thus we could write

ffplay http://easy.com/foo.flv -headers "Cookie: MyCookies"

But ffmpeg requires sequence \r\n in additional headers. Otherwise you will get a warning

[http @ 011701a0] No trailing CRLF found in HTTP header.

and the headers are added incorrectly. We can not pass properly CRLF sequence through command line. I think the only solution would be to fix http.c so that the pre-defined characters is replaced by CRLF.

like image 184
pogorskiy Avatar answered Jan 08 '23 23:01

pogorskiy