Opened 8 years ago

Last modified 8 years ago

#6190 new enhancement

Support Netscape HTTP Cookie files

Reported by: yan12125 Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: http
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

$ ffmpeg -i http://aka-njpww-hls-vod-cm.uliza.jp/1239/995_440_1466_0c3b6a88e722a07df63c75d3977b9575_4943142_1904000_1280_720_47_20141118002654.m3u8 -c copy output.mp4                  
ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.1 (GCC) 20170109
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf --enable-shared --enable-version3 --enable-x11grab
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
[https @ 0x5566c892acc0] HTTP error 403 Forbidden
Unable to open key file https://www2.uliza.jp/IF/iphone/iPhoneCryptKey.aspx?v=4793799&s=0                                               
[hls,applehttp @ 0x5566c890a560] Error when loading first segment 'http://aka-njpww-hls-vod-cm.uliza.jp/1239/995_440_1466_0c3b6a88e722a07df63c75d3977b9575_4943142_1904000_1280_720_47_20141118002654/25009-1.crypt.ts'                                                         
http://aka-njpww-hls-vod-cm.uliza.jp/1239/995_440_1466_0c3b6a88e722a07df63c75d3977b9575_4943142_1904000_1280_720_47_20141118002654.m3u8: Invalid data found when processing input                                                                                               

In this example, the key file https://www2.uliza.jp/IF/iphone/iPhoneCryptKey.aspx?v=4793799&s=0 requires cookies. Currently I use -headers or -cookies to specify those cookies. It would be great to have per-domain cookies. An approach is to support Netscape HTTP Cookie files.

A Python implementation can be found at https://github.com/python/cpython/blob/44b548d/Lib/http/cookiejar.py#L1961. Apparently either there's no official standard for this file format, or all standard documents have been vanished as Netscape goes by.

Change History (2)

in reply to:  description comment:1 by Carl Eugen Hoyos, 8 years ago

Keywords: http added
Version: 3.2.1git-master

Replying to yan12125:

In this example, the key file https://www2.uliza.jp/IF/iphone/iPhoneCryptKey.aspx?v=4793799&s=0 requires cookies. Currently I use -headers or -cookies to specify those cookies.

Does it work if you specify -headers or -cookies?

Please understand that you cannot request an enhancement for a release version.

comment:2 by yan12125, 8 years ago

Sorry, I'd like to recheck it but the cookies are invalidated. It's own by another person. It worked, but if you need real cookies for testing, I can contact him/her again.

Please understand that you cannot request an enhancement for a release version.

Sorry, I'm not sure what the field "version" means. Of course it makes sense that new features are for git-master only.

Note: See TracTickets for help on using tickets.