[FFmpeg-trac] #8833(undetermined:new): ffprobe doesn't properly follow redirect on remote url

FFmpeg trac at avcodec.org
Thu Jul 30 03:17:52 EEST 2020


#8833: ffprobe doesn't properly follow redirect on remote url
-------------------------------------+-------------------------------------
             Reporter:  azhelev      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Using ffprobe on remote URL fails when the remote server return 302
 redirect to a long URL
 1. ffprobe <remote url>
 2. The remote server returns HTTP 302 Found. The Location header in the
 response contains a rather long URL
 3. ffprobe tries to follow the redirect, but cuts the URL from the
 location header and thus requests invalid URL

 Full log:
 {{{
 ffprobe started on 2020-07-29 at 19:25:40
 Report written to "ffprobe-20200729-192540.log"
 Log level: 99
 Command line:
 ffprobe -v 9 -loglevel 99 -report
 "https://player.vimeo.com/play/1582631308?s=378487171_1596078044_379a55560ce10f38feff55c87ed111c8&loc=external&context=Vimeo%5CController%5CApi%5CResources%5CVideoController.&download=1&filename=Pr%25C3%25A1ctica%2Bmirar%2Bla%2Bimagen%2Binstant%25C3%25A1nea%2Ben%2Bla%2Bdistancia%2Bf%25C3%25A1cil%2By%2Bdif%25C3%25ADcil.174.mp4"
 ffprobe version N-98588-gcbb6ba2e86 Copyright (c) 2007-2020 the FFmpeg
 developers
   built with gcc 10.1.0 (GCC)
   configuration: --prefix=/usr --disable-debug --disable-static --disable-
 stripping --enable-avisynth --enable-fontconfig --enable-gmp --enable-
 gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass
 --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype
 --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack
 --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-
 libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg
 --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr
 --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora
 --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis
 --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265
 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-
 nvenc --enable-omx --enable-shared --enable-version3
   libavutil      56. 57.100 / 56. 57.100
   libavcodec     58. 97.102 / 58. 97.102
   libavformat    58. 49.100 / 58. 49.100
   libavdevice    58. 11.101 / 58. 11.101
   libavfilter     7. 87.100 /  7. 87.100
   libswscale      5.  8.100 /  5.  8.100
   libswresample   3.  8.100 /  3.  8.100
   libpostproc    55.  8.100 / 55.  8.100
 [NULL @ 0x55edbe7aa1c0] Opening
 'https://player.vimeo.com/play/1582631308?s=378487171_1596078044_379a55560ce10f38feff55c87ed111c8&loc=external&context=Vimeo%5CController%5CApi%5CResources%5CVideoController.&download=1&filename=Pr%25C3%25A1ctica%2Bmirar%2Bla%2Bimagen%2Binstant%25C3%25A1nea%2Ben%2Bla%2Bdistancia%2Bf%25C3%25A1cil%2By%2Bdif%25C3%25ADcil.174.mp4'
 for reading
 [https @ 0x55edbe7aadc0] Setting default whitelist
 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
 [tcp @ 0x55edbe7ae500] Original list of addresses:
 [tcp @ 0x55edbe7ae500] Address 151.101.64.217 port 443
 [tcp @ 0x55edbe7ae500] Address 151.101.0.217 port 443
 [tcp @ 0x55edbe7ae500] Address 151.101.192.217 port 443
 [tcp @ 0x55edbe7ae500] Address 151.101.128.217 port 443
 [tcp @ 0x55edbe7ae500] Interleaved list of addresses:
 [tcp @ 0x55edbe7ae500] Address 151.101.64.217 port 443
 [tcp @ 0x55edbe7ae500] Address 151.101.0.217 port 443
 [tcp @ 0x55edbe7ae500] Address 151.101.192.217 port 443
 [tcp @ 0x55edbe7ae500] Address 151.101.128.217 port 443
 [tcp @ 0x55edbe7ae500] Starting connection attempt to 151.101.64.217 port
 443
 [tcp @ 0x55edbe7ae500] Successfully connected to 151.101.64.217 port 443
 [https @ 0x55edbe7aadc0] request: GET
 /play/1582631308?s=378487171_1596078044_379a55560ce10f38feff55c87ed111c8&loc=external&context=Vimeo%5CController%5CApi%5CResources%5CVideoController.&download=1&filename=Pr%25C3%25A1ctica%2Bmirar%2Bla%2Bimagen%2Binstant%25C3%25A1nea%2Ben%2Bla%2Bdistancia%2Bf%25C3%25A1cil%2By%2Bdif%25C3%25ADcil.174.mp4
 HTTP/1.1
 User-Agent: Lavf/58.49.100
 Accept: */*
 Range: bytes=0-
 Connection: close
 Host: player.vimeo.com
 Icy-MetaData: 1


 [https @ 0x55edbe7aadc0] header='HTTP/1.1 302 Found'
 [https @ 0x55edbe7aadc0] http_code=302
 [https @ 0x55edbe7aadc0] header='Connection: close'
 [https @ 0x55edbe7aadc0] header='Content-Length: 0'
 [https @ 0x55edbe7aadc0] header='Server: nginx'
 [https @ 0x55edbe7aadc0] header='Content-Type: text/html; charset=UTF-8'
 [https @ 0x55edbe7aadc0] header='X-Xss-Protection: 1; mode=block'
 [https @ 0x55edbe7aadc0] header='Content-Security-Policy: default-src
 'self'; script-src 'self' https://f.vimeocdn.com; style-src 'self'
 https://f.vimeocdn.com; img-src 'self' https://i.vimeocdn.com
 https://f.vimeocdn.com'
 [https @ 0x55edbe7aadc0] header='X-Content-Type-Options: nosniff'
 [https @ 0x55edbe7aadc0] header='Strict-Transport-Security: max-
 age=31536000; includeSubDomains; preload'
 [https @ 0x55edbe7aadc0] header='Access-Control-Allow-Origin: *'
 [https @ 0x55edbe7aadc0] header='Location: https://vod-
 progressive.akamaized.net/exp=1596054341~acl=%2A%2F1582631308.mp4%2A~hmac=02c918822906610d337b7c55f0cb34610641289b911d24faf68d645a218c24d8
 /vimeo-prod-skyfire-std-
 us/01/697/15/378487171/1582631308.mp4?download=1&filename=Pr%C3%A1ctica+mirar+la+imagen+instant%C3%A1nea+en+la+distancia+f%C3%A1cil+y+dif%C3%ADcil..mp4'
 [https @ 0x55edbe7aadc0] header='P3p: CP="This is not a P3P policy! See
 https://vimeo.com/privacy"'
 [https @ 0x55edbe7aadc0] header='Expires: Fri, 15 Dec 1985 19:30:00 GMT'
 [https @ 0x55edbe7aadc0] header='Via: 1.1 varnish'
 [https @ 0x55edbe7aadc0] header='Cache-Control: no-store, no-cache, must-
 revalidate, post-check=0, pre-check=0'
 [https @ 0x55edbe7aadc0] header='X-Varnish-Cache: 0'
 [https @ 0x55edbe7aadc0] header='X-VServer: infra-playproxy-a-8'
 [https @ 0x55edbe7aadc0] header='X-Vimeo-DC: ge'
 [https @ 0x55edbe7aadc0] header='Accept-Ranges: bytes'
 [https @ 0x55edbe7aadc0] header='Date: Wed, 29 Jul 2020 16:25:41 GMT'
 [https @ 0x55edbe7aadc0] header='Via: 1.1 varnish'
 [https @ 0x55edbe7aadc0] header='Age: 0'
 [https @ 0x55edbe7aadc0] header='X-Served-By: cache-vie21620-VIE'
 [https @ 0x55edbe7aadc0] header='X-Cache: MISS'
 [https @ 0x55edbe7aadc0] header='X-Cache-Hits: 0'
 [https @ 0x55edbe7aadc0] header='X-Timer: S1596039941.034784,VS0,VE147'
 [https @ 0x55edbe7aadc0] header='Vary: Accept-Encoding'
 [https @ 0x55edbe7aadc0] header=''
 [tcp @ 0x55edbedd0480] Original list of addresses:
 [tcp @ 0x55edbedd0480] Address 185.46.160.137 port 443
 [tcp @ 0x55edbedd0480] Address 185.46.160.136 port 443
 [tcp @ 0x55edbedd0480] Address 2a01:9e40:1:7::b92e:a089 port 443
 [tcp @ 0x55edbedd0480] Address 2a01:9e40:1:7::b92e:a088 port 443
 [tcp @ 0x55edbedd0480] Interleaved list of addresses:
 [tcp @ 0x55edbedd0480] Address 185.46.160.137 port 443
 [tcp @ 0x55edbedd0480] Address 2a01:9e40:1:7::b92e:a089 port 443
 [tcp @ 0x55edbedd0480] Address 185.46.160.136 port 443
 [tcp @ 0x55edbedd0480] Address 2a01:9e40:1:7::b92e:a088 port 443
 [tcp @ 0x55edbedd0480] Starting connection attempt to 185.46.160.137 port
 443
 [tcp @ 0x55edbedd0480] Successfully connected to 185.46.160.137 port 443
 [https @ 0x55edbe7aadc0] request: GET
 /exp=1596054341~acl=%2A%2F1582631308.mp4%2A~hmac=02c918822906610d337b7c55f0cb34610641289b911d24faf68d645a218c24d8
 /vimeo-prod-skyfire-std-us/01/697/15/378487171/p4 HTTP/1.1
 User-Agent: Lavf/58.49.100
 Accept: */*
 Range: bytes=0-
 Connection: close
 Host: vod-progressive.akamaized.net
 Icy-MetaData: 1


 [https @ 0x55edbe7aadc0] header='HTTP/1.1 403 Forbidden'
 [https @ 0x55edbe7aadc0] http_code=403
 [https @ 0x55edbe7aadc0] HTTP error 403 Forbidden
 https://player.vimeo.com/play/1582631308?s=378487171_1596078044_379a55560ce10f38feff55c87ed111c8&loc=external&context=Vimeo%5CController%5CApi%5CResources%5CVideoController.&download=1&filename=Pr%25C3%25A1ctica%2Bmirar%2Bla%2Bimagen%2Binstant%25C3%25A1nea%2Ben%2Bla%2Bdistancia%2Bf%25C3%25A1cil%2By%2Bdif%25C3%25ADcil.174.mp4:
 Server returned 403 Forbidden (access denied)
 }}}


 Notice these lines. The URL in the GET request is cut
 {{{
 [https @ 0x55edbe7aadc0] header='Location: https://vod-
 progressive.akamaized.net/exp=1596054341~acl=%2A%2F1582631308.mp4%2A~hmac=02c918822906610d337b7c55f0cb34610641289b911d24faf68d645a218c24d8
 /vimeo-prod-skyfire-std-
 us/01/697/15/378487171/1582631308.mp4?download=1&filename=Pr%C3%A1ctica+mirar+la+imagen+instant%C3%A1nea+en+la+distancia+f%C3%A1cil+y+dif%C3%ADcil..mp4'

 [https @ 0x55edbe7aadc0] request: GET
 /exp=1596054341~acl=%2A%2F1582631308.mp4%2A~hmac=02c918822906610d337b7c55f0cb34610641289b911d24faf68d645a218c24d8
 /vimeo-prod-skyfire-std-us/01/697/15/378487171/p4 HTTP/1.1
 User-Agent: Lavf/58.49.100
 Accept: */*
 Range: bytes=0-
 Connection: close
 Host: vod-progressive.akamaized.net
 }}}



 How to reproduce:
 {{{
 ffprobe -v 9 -loglevel 99 -report
 "https://player.vimeo.com/play/1582631308?s=378487171_1596078044_379a55560ce10f38feff55c87ed111c8&loc=external&context=Vimeo%5CController%5CApi%5CResources%5CVideoController.&download=1&filename=Pr%25C3%25A1ctica%2Bmirar%2Bla%2Bimagen%2Binstant%25C3%25A1nea%2Ben%2Bla%2Bdistancia%2Bf%25C3%25A1cil%2By%2Bdif%25C3%25ADcil.174.mp4"
 }}}

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


More information about the FFmpeg-trac mailing list