[FFmpeg-trac] #9747(undetermined:new): Specified User-Agent is only being applied to the first input stream

FFmpeg trac at avcodec.org
Mon Apr 25 09:25:35 EEST 2022


#9747: Specified User-Agent is only being applied to the first input stream
-------------------------------------+-------------------------------------
             Reporter:  elyse0       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:  user-agent,  |               Blocked By:
  lavf                               |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 '''Context'''
 I was looking into a yt-dlp issue that I encountered myself
 (https://github.com/yt-dlp/yt-dlp/issues/2696), where we wanted to merge
 two streams (audio+video) to stdout, but kept getting 403 Forbidden.

 After some digging, I found that ffmpeg was sending the default User-Agent
 (Lavf/$version) for the second stream, ignoring the provided UA and
 causing that error.

 '''Summary of the bug:'''
 When we specify an 'User-Agent', it is only being applied to the first
 input stream, using the default 'Lavf/$version' for the second one.

 And when the host only accepts certain headers, the download will fail.

 '''Expected behavior:'''
 The supplied User-Agent should be applied to all input streams.

 '''How to reproduce:'''
 I have reproduced the issue by rejecting all requests on the S3 bucket,
 that contain "Lavf*" in the User-Agent.

 {{{
 % ffmpeg -v debug \
          -user_agent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0)
 Gecko/20100101 Firefox/99.0" \
          -i http://ffmpeg-bug.s3-website-us-
 east-1.amazonaws.com/video/video.m3u8 \
          -i http://ffmpeg-bug.s3-website-us-
 east-1.amazonaws.com/audio/audio.m3u8 \
          ncs-seconds.mp4

 ffmpeg version N-61656-gfbd22504c4-static
 https://johnvansickle.com/ffmpeg/
 built on 20220422
 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9747>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list