[FFmpeg-trac] #4846(undetermined:new): New ffmpeg build lose full cookies support (HLS, APPLEHTTP)

FFmpeg trac at avcodec.org
Sun Sep 13 16:12:25 CEST 2015


#4846: New ffmpeg build lose full cookies support (HLS,APPLEHTTP)
-------------------------------------+-------------------------------------
             Reporter:  infologique  |                     Type:  defect
               Status:  new          |                 Priority:  important
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:  HLS,         |               Blocked By:
  AppleHTTP, cookies                 |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:

 Since kodi 15.0+ my addon can't play HTTPS HLS stream when server use
 cookies to authenticate client. It's look like Cookie Jar (session) is not
 kept, I reproduced the problem with MPV for windows (I use Windows 10)
 (http://mpv.srsfckn.biz/) version 2015-09-03, but it's work perfectly with
 Kodi 14 and MPV 2015-06-10...

 With Kodi, ive tried to determine the source of my bug. I used fiddler to
 analyse HTTP trafic.

 '''My results :'''

 '''With kodi 14:'''

 '''Call 1:'''

 GET
 master.m3u8?hdnea=st=1442110578~exp=1442110643~acl=/i/012/mp4/i/2015-09-10_19_29_30_infoman_0406_*~hmac=e65e5c1f99490dc7eb6f4735e71f64620b90fa7aa5a2d25d889d2a85e1454867
 HTTP/1.1

 '''Return :'''

 Response sent 210 bytes of Cookie data:

 Set-Cookie:
 hdntl=exp=1442197043~acl=%2fi%2f012%2fmp4%2fi%2f2015-09-10_19_29_30_infoman_0406_*~data=hdntl~hmac=38c574b93b9b455c9301b734a34eeeb87ef5fd290bd308a92ecf0c7ec277f467;
 path=/; domain=toutvuniver1-vh.akamaihd.net;

 Response sent 156 bytes of Cookie data:

 Set-Cookie: _alid_=YsRWYon6GP4YDxu2iRsAmA==;
 path=/i/012/mp4/i/2015-09-10_19_29_30_infoman_0406_,500,800,1200,2000,3000,.mp4.csmil/;
 domain=toutvuniver1-vh.akamaihd.net

 '''ffmpeg correctly send back these cookies during call 2 and 3 :'''

 '''Call 2 :'''

 GET index_0_av.m3u8

 (Cookie:
 hdntl=exp=1442196982~acl=%2fi%2f012%2fmp4%2fi%2f2015-09-10_19_29_30_infoman_0406_*~data=hdntl~hmac=3eb50bfcada9e8a2c7f67bb9dd5cfd6519690b3360da52631667539abe70f7f1;
 _alid_=dLmmkHrWidM4JpXfr/wOwQ==;
 hdntl=exp=1442197043~acl=%2fi%2f012%2fmp4%2fi%2f2015-09-10_19_29_30_infoman_0406_*~data=hdntl~hmac=38c574b93b9b455c9301b734a34eeeb87ef5fd290bd308a92ecf0c7ec277f467;
 _alid_=YsRWYon6GP4YDxu2iRsAmA==)

 '''Call 3:'''

 GET
 crypt.key?null=&id=AgDA3ocUzF6bt7Pc9FVCEtLRCQK5cl1HWgwsv0NW8kav4ATDiVGkvfVQlERx6+dVH5BMgsFvpk644Q%3d%3d
 HTTP/1.1

 (Cookie:
 hdntl=exp=1442196982~acl=%2fi%2f012%2fmp4%2fi%2f2015-09-10_19_29_30_infoman_0406_*~data=hdntl~hmac=3eb50bfcada9e8a2c7f67bb9dd5cfd6519690b3360da52631667539abe70f7f1;
 _alid_=dLmmkHrWidM4JpXfr/wOwQ==;
 hdntl=exp=1442197043~acl=%2fi%2f012%2fmp4%2fi%2f2015-09-10_19_29_30_infoman_0406_*~data=hdntl~hmac=38c574b93b9b455c9301b734a34eeeb87ef5fd290bd308a92ecf0c7ec277f467;
 _alid_=YsRWYon6GP4YDxu2iRsAmA==)

 '''Crypt key value : z��.��O"$Hb�'''


 ----

 '''But since kodi 15 (i tried 15.0, 15.1, 15.2 and 16 RC1)'''

 '''Call 1 is identical :'''

 GET
 master.m3u8?hdnea=st=1442110872~exp=1442110937~acl=/i/012/mp4/i/2015-09-10_19_29_30_infoman_0406_*~hmac=3f7f04a637bf5178a8d3649b3b4d02ace5108c53b9baa1771938137d3cc6df3a
 HTTP/1.1

 Return (it's barely identical):

 Response sent 210 bytes of Cookie data:

 Set-Cookie:
 hdntl=exp=1442197276~acl=%2fi%2f012%2fmp4%2fi%2f2015-09-10_19_29_30_infoman_0406_*~data=hdntl~hmac=b4a4b8cc0f8bce3fdc07cb96dc11bbbd976057e1e1ef717b0198656580a0aacc;
 path=/; domain=toutvuniver1-vh.akamaihd.net;

 Response sent 156 bytes of Cookie data:

 Set-Cookie: _alid_=s4xlmE7ZjxkyCWG0q4svqw==;
 path=/i/012/mp4/i/2015-09-10_19_29_30_infoman_0406_,500,800,1200,2000,3000,.mp4.csmil/;
 domain=toutvuniver1-vh.akamaihd.net

 '''Call 2 :'''

 Now ffmpeg select index 4 by itself (based on client bandwidth), it's ok.

 GET
 index_4_av.m3u8?null=&id=AgDA3ocUzF6bvpzd9FXbqEsGltYruWZsB1+VoSG%2f6EY0o5fzdEb4zcAO26Diyi6KS6PnxY0IhWhX7Q%3d%3d
 HTTP/1.1

 (Cookie:
 hdntl=exp=1442197276~acl=%2fi%2f012%2fmp4%2fi%2f2015-09-10_19_29_30_infoman_0406_*~data=hdntl~hmac=b4a4b8cc0f8bce3fdc07cb96dc11bbbd976057e1e1ef717b0198656580a0aacc;
 _alid_=s4xlmE7ZjxkyCWG0q4svqw==)

 '''Call 3 :'''

 GET
 crypt.key?null=&id=AgDA3ocUzF6bvpzd9FXbqEsGltYruWZsB1+VoSG%2f6EY0o5fzdEb4zcAO26Diyi6KS6PnxY0IhWhX7Q%3d%3d
 HTTP/1.1

 (Cookie: _alid_=s4xlmE7ZjxkyCWG0q4svqw==) <<<<< Very tiny !!

 '''this time the server response is:'''

 403 Forbidden

 <HTML><HEAD> <TITLE>'''Access Denied'''</TITLE> </HEAD><BODY> <H1>Access
 Denied</H1> You don't have permission to access "crypt.key?" on
 this server.<P>
 Reference #18.be9b5ecc.1442110876.126fa </BODY>
 </HTML>

 I think the new version of ffmpeg is broken... but I really need that
 feature for playing akamaihd content...


 ----

 Here, copy of MPV output log :

 Playing:
 https://toutvuniver1-vh.akamaihd.net/i/012/mp4/c/2015-09-11_19_00_00_cheforeille_0001_,500,800,1200,2000,3000,.mp4.csmil/master.m3u8?hdnea=st=1442150589~exp=1444742589~acl=/i/012/mp4/c/2015-09-11_19_00_00_cheforeille_0001_*~hmac=84d9371012603adc84fc95b49714153067267921e1fd1657aa4dbde37a135c90
 [ytdl_hook] youtube-dl not found, not executable, or broken.
 [ffmpeg] https: No trailing CRLF found in HTTP header.
 [ffmpeg] http: HTTP error 403 Forbidden
 [ffmpeg] crypto: Unable to open resource:
 http://toutvuniver1-vh.akamaihd.net/i/012/mp4/c/2015-09-11_19_00_00_cheforeille_0001_,500,800,1200,2000,3000,.mp4.csmil/segment1_0_av.ts?null=&id=AgDA3ocUuFTzZP6D9VV5ld2XSNbwaxOqUHkw%2feJpYrOKgj8wqLoFRAOsOOERNS3DwNm8gM5Ya1xYug%3d%3d
 [ffmpeg/demuxer] hls,applehttp: Failed to open segment of playlist 0
 [ffmpeg] http: HTTP error 403 Forbidden
 [ffmpeg] crypto: Unable to open resource:
 http://toutvuniver1-vh.akamaihd.net/i/012/mp4/c/2015-09-11_19_00_00_cheforeille_0001_,500,800,1200,2000,3000,.mp4.csmil/segment2_0_av.ts?null=&id=AgDA3ocUuFTzZP6D9VV5ld2XSNbwaxOqUHkw%2feJpYrOKgj8wqLoFRAOsOOERNS3DwNm8gM5Ya1xYug%3d%3d


 ----


 How to reproduce:

 Call this page, with your browser :
 http://infologique.net/api/ici/

 and start playing the generated url (may possibly work only in canada... I
 don't know)

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


More information about the FFmpeg-trac mailing list