[FFmpeg-user] ffmpeg hls and 3 cookies
Georg Stein SMC
georg at steinmc.com
Sun Jan 1 17:19:14 EET 2017
Hello,
since some days i try now to download from periscope videos what need to
have a cookie set. In the documentation i only found an example how to
do this with one single cookie, but i need to hand over 3. Here is waht
i tried so far, whats not giving me an 403 error:
ffmpeg -headers 'Cookie:
CloudFront-Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L3JaXzhYbk5yeVhWVnA3M2JKbG1OVlZ3RldkS0lDbTBNbHdyaGRPelBZMFY4b3lUM2ZfWl9nbkdiRVJ6NGhERDhzT3NsSFE1WEZTaUdySmFla1lXTVpnKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTQ4MzM0NDIzNn19fV19;CloudFront-Key-Pair-Id=APKAIHCXHHQVRTVSFRWQ;CloudFront-Signature=PiLhDHXFD~VbDd3qKKeafwntyvBWITmt3sAmv46z~DmgHl8vRYruodYj3iwh8Sjm2PqD1Dp4TqMCp498fxrpEt~MtI8EbuYQc~w5-iQR3lp8fHGN7aHybJghpCZn2ac-J0ujdOZyz0uQuKmeck8EwvMpJhhfQm3RMsi4Zonu3X0Hl0GYCoqM3AFTlLc8FAkBmqRaw~lRoud6GqepptGPcnMgL~aM5vzXGkbPLmnWmB6UUKFOQFfSo1xHVMz3FbOEsg2GN0CkKKKGKQcj4nf7jYEZpehOPu9SA1H~tVfASQxNiMLGdFgy7W72pMeI2bU2odmOek6eoRjAWauQIffNyg__;'$'\r\n'
-i
'https://replay.periscope.tv/rZ_8XnNryXVVp73bJlmNVVwFWdKICm0MlwrhdOzPY0V8oyT3f_Z_gnGbERz4hDD8sOslHQ5XFSiGrJaekYWMZg/playlist_1482892547484600267.m3u8'
-c copy test.ts -v debug
the result of this is:
Splitting the commandline.
Reading option '-headers' ... matched as AVOption 'headers' with
argument 'Cookie:
CloudFront-Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L3JaXzhYbk5yeVhWVnA3M2JKbG1OVlZ3RldkS0lDbTBNbHdyaGRPelBZMFY4b3lUM2ZfWl9nbkdiRVJ6NGhERDhzT3NsSFE1WEZTaUdySmFla1lXTVpnKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTQ4MzM0NDIzNn19fV19;CloudFront-Key-Pair-Id=APKAIHCXHHQVRTVSFRWQ;CloudFront-Signature=PiLhDHXFD~VbDd3qKKeafwntyvBWITmt3sAmv46z~DmgHl8vRYruodYj3iwh8Sjm2PqD1Dp4TqMCp498fxrpEt~MtI8EbuYQc~w5-iQR3lp8fHGN7aHybJghpCZn2ac-J0ujdOZyz0uQuKmeck8EwvMpJhhfQm3RMsi4Zonu3X0Hl0GYCoqM3AFTlLc8FAkBmqRaw~lRoud6GqepptGPcnMgL~aM5vzXGkbPLmnWmB6UUKFOQFfSo1xHVMz3FbOEsg2GN0CkKKKGKQcj4nf7jYEZpehOPu9SA1H~tVfASQxNiMLGdFgy7W72pMeI2bU2odmOek6eoRjAWauQIffNyg__;
'.
Reading option '-i' ... matched as input file with argument
'https://replay.periscope.tv/rZ_8XnNryXVVp73bJlmNVVwFWdKICm0MlwrhdOzPY0V8oyT3f_Z_gnGbERz4hDD8sOslHQ5XFSiGrJaekYWMZg/playlist_1482892547484600267.m3u8'.
Reading option '-c' ... matched as option 'c' (codec name) with argument
'copy'.
Reading option 'test.ts' ... matched as output file.
Reading option '-v' ... matched as option 'v' (set logging level) with
argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file
https://replay.periscope.tv/rZ_8XnNryXVVp73bJlmNVVwFWdKICm0MlwrhdOzPY0V8oyT3f_Z_gnGbERz4hDD8sOslHQ5XFSiGrJaekYWMZg/playlist_1482892547484600267.m3u8.
Successfully parsed a group of options.
Opening an input file:
https://replay.periscope.tv/rZ_8XnNryXVVp73bJlmNVVwFWdKICm0MlwrhdOzPY0V8oyT3f_Z_gnGbERz4hDD8sOslHQ5XFSiGrJaekYWMZg/playlist_1482892547484600267.m3u8.
[https @ 0xbc0880] Setting default whitelist
'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
[https @ 0xbc0880] request: GET
/rZ_8XnNryXVVp73bJlmNVVwFWdKICm0MlwrhdOzPY0V8oyT3f_Z_gnGbERz4hDD8sOslHQ5XFSiGrJaekYWMZg/playlist_1482892547484600267.m3u8
HTTP/1.1
User-Agent: Lavf/57.41.100
Accept: */*
Range: bytes=0-
Connection: close
Host: replay.periscope.tv
Icy-MetaData: 1
Cookie:
CloudFront-Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L3JaXzhYbk5yeVhWVnA3M2JKbG1OVlZ3RldkS0lDbTBNbHdyaGRPelBZMFY4b3lUM2ZfWl9nbkdiRVJ6NGhERDhzT3NsSFE1WEZTaUdySmFla1lXTVpnKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTQ4MzM0NDIzNn19fV19;CloudFront-Key-Pair-Id=APKAIHCXHHQVRTVSFRWQ;CloudFront-Signature=PiLhDHXFD~VbDd3qKKeafwntyvBWITmt3sAmv46z~DmgHl8vRYruodYj3iwh8Sjm2PqD1Dp4TqMCp498fxrpEt~MtI8EbuYQc~w5-iQR3lp8fHGN7aHybJghpCZn2ac-J0ujdOZyz0uQuKmeck8EwvMpJhhfQm3RMsi4Zonu3X0Hl0GYCoqM3AFTlLc8FAkBmqRaw~lRoud6GqepptGPcnMgL~aM5vzXGkbPLmnWmB6UUKFOQFfSo1xHVMz3FbOEsg2GN0CkKKKGKQcj4nf7jYEZpehOPu9SA1H~tVfASQxNiMLGdFgy7W72pMeI2bU2odmOek6eoRjAWauQIffNyg__;
[AVIOContext @ 0xf4b9c0] Statistics: 66140 bytes read, 0 seeks
i also tried the same with -cookies, but here i always get an 403
when i do the same with wget i get as response the m3u8 playlist:
wget
"https://replay.periscope.tv/rZ_8XnNryXVVp73bJlmNVVwFWdKICm0MlwrhdOzPY0V8oyT3f_Z_gnGbERz4hDD8sOslHQ5XFSiGrJaekYWMZg/playlist_1482892547484600267.m3u8"
--no-cookies --header "Cookie:
CloudFront-Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9yZXBsYXkucGVyaXNjb3BlLnR2L3JaXzhYbk5yeVhWVnA3M2JKbG1OVlZ3RldkS0lDbTBNbHdyaGRPelBZMFY4b3lUM2ZfWl9nbkdiRVJ6NGhERDhzT3NsSFE1WEZTaUdySmFla1lXTVpnKiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTQ4MzI5MjM0NX19fV19;
CloudFront-Signature=gVUZ49e2ZKaBUylUHq5vvh89kR8oVTkDdA4Cn9wgbgaR5piqSk1qu1EMZot3xYNRRioTldBtDPfJm8P93u4za9oNbbXYDX4xdhrJom9Uy3heaOkurd6XYTAMzy1zR3XMJRRmDmX4lwISld1UK5-qbYx4aln67bxN2lxZL55odu7ixFph4BzI5Bj2gvUCwbXE3RUuesImYyT1DoHqtei3EvvRGSJeP9go8aXIvhg9Mk5HMPBVY2LHKs~A5rXz0st3ayWfT1x73eCpVNgne70c6Ei0Mz43DGblin3sXb-cg3VFbcHT5jnETC~L7HTQxnotEhgmHUy-lYIJAoK0PLgp-Q__;
CloudFront-Key-Pair-Id=APKAIHCXHHQVRTVSFRWQ" --no-check-certificate -O
out.m3u8
next question will be, how to set cookies in a c++ app using libavformat
perhaps somebody has this already solved and can help me out here a
little bit
Georg
More information about the ffmpeg-user
mailing list