[FFmpeg-trac] #3336(avformat:new): When trying to play an HLS playlist that requires cookies, (null) is sent in the Cookie header for cookies that specify sub-domain

FFmpeg trac at avcodec.org
Tue Jan 21 11:07:38 CET 2014


#3336: When trying to play an HLS playlist that requires cookies, (null) is sent
in the Cookie header for cookies that specify sub-domain
-------------------------------------+-------------------------------------
             Reporter:  voguemaster  |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  avformat     |                  Version:
             Keywords:  HLS cookies  |  unspecified
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------
 Summary of the bug:

 There is a problem when trying to play an m3u8 (HLS) playlist
 that requires cookies to be sent. Specifically, when the
 server sets cookies that are valid for all sub-domains but
 the URL to be played is of the top-level domain.
 For example:

 domain in URL: bar.com/segments.m3u8
 Cookie set domain: .bar.com
 (leading dot in cookie cdomain = valid for all sub-domains
 AND the master domain).

 The bug is in http.c get_cookies function, when matching
 the domain.

 There are 3 scenarios with cookies:

 1. Specific domain set by cookie. i.e: foo.bar.com - WORKS.
 2. Cookie specifies sub-domain and the URL to play is in a
 sub-domain. i.e: URL points to foo.bar.com, cookie sets .bar.com - WORKS.
 3. Cookie specifies sub-domain and the URL to play is at the
 master domain level. i.e: URL is bar.com, cookie sets .bar.com - NOT
 WORKING.


 How to reproduce:
 {{{
 ffmpeg version N-60023-g13e0109 Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Jan 20 2014 22:02:00 with gcc 4.8.2 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
 --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
 --enable-gnutls --enable-iconv --enable-libass --enable-libbluray
 --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc
 --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
 --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-
 librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex
 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-
 aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
 --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid
 --enable-zlib
   libavutil      52. 63.100 / 52. 63.100
   libavcodec     55. 48.102 / 55. 48.102
   libavformat    55. 25.100 / 55. 25.100
   libavdevice    55.  5.102 / 55.  5.102
   libavfilter     4.  1.100 /  4.  1.100
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 17.104 /  0. 17.104
   libpostproc    52.  3.100 / 52.  3.100
 Splitting the commandline.
 Reading option '-v' ... matched as option 'v' (set logging level) with
 argument '9'.
 Reading option '-loglevel' ... matched as option 'loglevel' (set logging
 level) with argument '99'.
 Reading option '-cookies' ... matched as AVOption 'cookies' with argument
 'HDEA_S=exp=1390236715~acl=%2F%2A~hmac=ad0fc5c2fa683e9aca5cac6dbc77455b572b15e79d65f695e704d4e57def7fbd;
 path=/;
 domain=.233492reshet.pmd.applicaster.com\nHDEA_L=exp=1390305115~acl=%2f*~hmac=12e3a47d79a9c297feca6038421fdb4bb2ddf61d55711de7e23fde2a44af6af9;
 path=/; domain=.233492reshet.pmd.applicaster.com'.
 Reading option '-i' ... matched as input file with argument
 'http://233492reshet.pmd.applicaster.com/accounts/32/broadcasters/1/vod_items/1155754/3ed9bddadcd889128275/640x480-634k/segments.m3u8'.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option v (set logging level) with argument 9.
 Successfully parsed a group of options.
 Parsing a group of options: input file
 http://233492reshet.pmd.applicaster.com/accounts/32/broadcasters/1/vod_items/1155754/3ed9bddadcd889128275/640x480-634k/segments.m3u8.
 Successfully parsed a group of options.
 Opening an input file:
 http://233492reshet.pmd.applicaster.com/accounts/32/broadcasters/1/vod_items/1155754/3ed9bddadcd889128275/640x480-634k/segments.m3u8.
 [http @ 02782f20] request: GET
 /accounts/32/broadcasters/1/vod_items/1155754/3ed9bddadcd889128275/640x480-634k/segments.m3u8
 HTTP/1.1

 User-Agent: Lavf/55.25.100

 Accept: */*

 Range: bytes=0-

 Connection: close

 Host: 233492reshet.pmd.applicaster.com

 Cookie: (null)




 [http @ 02782f20] header='HTTP/1.1 403 Forbidden'
 [http @ 02782f20] http_code=403
 [http @ 02782f20] HTTP error 403 Forbidden
 http://233492reshet.pmd.applicaster.com/accounts/32/broadcasters/1/vod_items/1155754/3ed9bddadcd889128275/640x480-634k/segments.m3u8:
 Input/output error

 }}}

 May be related to #2180.

 I want to note I have a working fix for this. I'm using
 libavformat from within XBMC. I fixed http.c and compiled
 ffmpeg's libs and it works.

 XBMC 13.0 Gotham uses ffmpeg 1.2 but the code hasn't changed
 at all in newer versions.
 (how do I submit a patch?)

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3336>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list