Opened 5 years ago

Closed 5 years ago

#7852 closed defect (invalid)

Cannot set User-Agent

Reported by: abu Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Cannot set User-Agent

D:\LYYDownloader-dev\ffmpeg -headers "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121Safari/537.36" -headers "Accept:*/*" -headers "Accept-Encoding:gzip, deflate, br" -headers "Accept-Language:zh-CN,zh;q=0.9,en;q=0.8" -headers "Origin:https://pc-shop.xiaoe-tech.com" -headers "Referer:https://pc-shop.xiaoe-tech.com/appzDSBtscz6568/video_details?id=v_5b0e8459e1ff5_nSu4umqK" -i "https://httpbin.org" -v trace

The result User-Agent is still

User-Agent: Lavf/58.20.100

Change History (5)

comment:1 by Carl Eugen Hoyos, 5 years ago

Resolution: invalid
Status: newclosed
Version: 4.1unspecified

in reply to:  1 comment:2 by abu, 5 years ago

Resolution: invalid
Status: closedreopened
Version: unspecifiedgit-master

Replying to cehoyos:

http://ffmpeg.org/ffmpeg-protocols.html#http

I've read the doc, but found there is nothing wrong with my command, although one can set User-Agent value explicitly via

-user_agent
Last edited 5 years ago by abu (previous) (diff)

comment:3 by Steven Liu, 5 years ago

liuqideMacBook-Pro:ffmpeg liuqi$ ffmpeg -headers "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121Safari/537.36" -headers "Accept:*/*" -headers "Accept-Encoding:gzip, deflate, br" -headers "Accept-Language:zh-CN,zh;q=0.9,en;q=0.8" -headers "Origin:https://pc-shop.xiaoe-tech.com" -headers "Referer:https://pc-shop.xiaoe-tech.com/appzDSBtscz6568/video_details?id=v_5b0e8459e1ff5_nSu4umqK" -user_agent "StevenLiu" -i "https://httpbin.org" -v trace
ffmpeg version N-92522-g370b8bd847 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --enable-nonfree --enable-videotoolbox --enable-libxml2
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 40.100 / 58. 40.100
  libavformat    58. 23.100 / 58. 23.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 46.100 /  7. 46.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Splitting the commandline.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121Safari/537.36'.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Accept:*/*'.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Accept-Encoding:gzip, deflate, br'.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Accept-Language:zh-CN,zh;q=0.9,en;q=0.8'.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Origin:https://pc-shop.xiaoe-tech.com'.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Referer:https://pc-shop.xiaoe-tech.com/appzDSBtscz6568/video_details?id=v_5b0e8459e1ff5_nSu4umqK'.
Reading option '-user_agent' ... matched as AVOption 'user_agent' with argument 'StevenLiu'.
Reading option '-i' ... matched as input url with argument 'https://httpbin.org'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'trace'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input url https://httpbin.org.
Successfully parsed a group of options.
Opening an input file: https://httpbin.org.
[NULL @ 0x7fced9800000] Opening 'https://httpbin.org' for reading
[https @ 0x7fced8400200] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
[https @ 0x7fced8400200] No trailing CRLF found in HTTP header.
[tcp @ 0x7fced8600340] Original list of addresses:
[tcp @ 0x7fced8600340] Address 18.211.162.154 port 443
[tcp @ 0x7fced8600340] Address 34.238.32.178 port 443
[tcp @ 0x7fced8600340] Interleaved list of addresses:
[tcp @ 0x7fced8600340] Address 18.211.162.154 port 443
[tcp @ 0x7fced8600340] Address 34.238.32.178 port 443
[tcp @ 0x7fced8600340] Starting connection attempt to 18.211.162.154 port 443
[tcp @ 0x7fced8600340] Successfully connected to 18.211.162.154 port 443
[https @ 0x7fced8400200] request: GET / HTTP/1.1
User-Agent: StevenLiu
Accept: */*
Range: bytes=0-
Connection: close
Host: httpbin.org
Icy-MetaData: 1
Referer:https://pc-shop.xiaoe-tech.com/appzDSBtscz6568/video_details?id=v_5b0e8459e1ff5_nSu4umqK


[https @ 0x7fced8400200] header='HTTP/1.1 200 OK'
[https @ 0x7fced8400200] http_code=200
[https @ 0x7fced8400200] header='Access-Control-Allow-Credentials: true'
[https @ 0x7fced8400200] header='Access-Control-Allow-Origin: *'
[https @ 0x7fced8400200] header='Content-Type: text/html; charset=utf-8'
[https @ 0x7fced8400200] header='Date: Tue, 23 Apr 2019 13:21:04 GMT'
[https @ 0x7fced8400200] header='Referrer-Policy: no-referrer-when-downgrade'
[https @ 0x7fced8400200] header='Server: nginx'
[https @ 0x7fced8400200] header='X-Content-Type-Options: nosniff'
[https @ 0x7fced8400200] header='X-Frame-Options: DENY'
[https @ 0x7fced8400200] header='X-XSS-Protection: 1; mode=block'
[https @ 0x7fced8400200] header='Content-Length: 9593'
[https @ 0x7fced8400200] header='Connection: Close'
[https @ 0x7fced8400200] header=''
[AVIOContext @ 0x7fced8510cc0] Statistics: 9593 bytes read, 0 seeks
https://httpbin.org: Invalid data found when processing input
liuqideMacBook-Pro:ffmpeg liuqi$

comment:4 by Steven Liu, 5 years ago

liuqideMacBook-Pro:ffmpeg liuqi$ ffmpeg -headers "User-Agent: \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121Safari/537.36\"" -headers "Accept:*/*" -headers "Accept-Encoding:gzip, deflate, br" -headers "Accept-Language:zh-CN,zh;q=0.9,en;q=0.8" -headers "Origin:https://pc-shop.xiaoe-tech.com" -headers "Referer:https://pc-shop.xiaoe-tech.com/appzDSBtscz6568/video_details?id=v_5b0e8459e1ff5_nSu4umqK"  -headers "User-Agent: \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121Safari/537.36\"" -i "https://httpbin.org" -v trace
liuqideMacBook-Pro:ffmpeg liuqi$ ffmpeg -headers "Accept:*/*" -headers "Accept-Encoding:gzip, deflate, br" -headers "Accept-Language:zh-CN,zh;q=0.9,en;q=0.8" -headers "Origin:https://pc-shop.xiaoe-tech.com" -headers "Referer:https://pc-shop.xiaoe-tech.com/appzDSBtscz6568/video_details?id=v_5b0e8459e1ff5_nSu4umqK"  -headers "User-Agent: \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121Safari/537.36\"" -i "https://httpbin.org" -v trace
ffmpeg version N-92522-g370b8bd847 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --enable-nonfree --enable-videotoolbox --enable-libxml2
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 40.100 / 58. 40.100
  libavformat    58. 23.100 / 58. 23.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 46.100 /  7. 46.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Splitting the commandline.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Accept:*/*'.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Accept-Encoding:gzip, deflate, br'.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Accept-Language:zh-CN,zh;q=0.9,en;q=0.8'.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Origin:https://pc-shop.xiaoe-tech.com'.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Referer:https://pc-shop.xiaoe-tech.com/appzDSBtscz6568/video_details?id=v_5b0e8459e1ff5_nSu4umqK'.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'User-Agent: "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121Safari/537.36"'.
Reading option '-i' ... matched as input url with argument 'https://httpbin.org'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'trace'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input url https://httpbin.org.
Successfully parsed a group of options.
Opening an input file: https://httpbin.org.
[NULL @ 0x7ffc73801800] Opening 'https://httpbin.org' for reading
[https @ 0x7ffc72700000] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
[https @ 0x7ffc72700000] No trailing CRLF found in HTTP header.
[tcp @ 0x7ffc72407b80] Original list of addresses:
[tcp @ 0x7ffc72407b80] Address 18.211.162.154 port 443
[tcp @ 0x7ffc72407b80] Address 34.238.32.178 port 443
[tcp @ 0x7ffc72407b80] Interleaved list of addresses:
[tcp @ 0x7ffc72407b80] Address 18.211.162.154 port 443
[tcp @ 0x7ffc72407b80] Address 34.238.32.178 port 443
[tcp @ 0x7ffc72407b80] Starting connection attempt to 18.211.162.154 port 443
[tcp @ 0x7ffc72407b80] Successfully connected to 18.211.162.154 port 443
[https @ 0x7ffc72700000] request: GET / HTTP/1.1
Accept: */*
Range: bytes=0-
Connection: close
Host: httpbin.org
Icy-MetaData: 1
User-Agent: "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121Safari/537.36"


[https @ 0x7ffc72700000] header='HTTP/1.1 200 OK'
[https @ 0x7ffc72700000] http_code=200
[https @ 0x7ffc72700000] header='Access-Control-Allow-Credentials: true'
[https @ 0x7ffc72700000] header='Access-Control-Allow-Origin: *'
[https @ 0x7ffc72700000] header='Content-Type: text/html; charset=utf-8'
[https @ 0x7ffc72700000] header='Date: Tue, 23 Apr 2019 13:25:21 GMT'
[https @ 0x7ffc72700000] header='Referrer-Policy: no-referrer-when-downgrade'
[https @ 0x7ffc72700000] header='Server: nginx'
[https @ 0x7ffc72700000] header='X-Content-Type-Options: nosniff'
[https @ 0x7ffc72700000] header='X-Frame-Options: DENY'
[https @ 0x7ffc72700000] header='X-XSS-Protection: 1; mode=block'
[https @ 0x7ffc72700000] header='Content-Length: 9593'
[https @ 0x7ffc72700000] header='Connection: Close'
[https @ 0x7ffc72700000] header=''
[AVIOContext @ 0x7ffc72702f00] Statistics: 9593 bytes read, 0 seeks
https://httpbin.org: Invalid data found when processing input
liuqideMacBook-Pro:ffmpeg liuqi$

comment:5 by Steven Liu, 5 years ago

Resolution: invalid
Status: reopenedclosed
liuqideMacBook-Pro:ffmpeg liuqi$ ffmpeg -headers "Accept-Encoding:gzip, deflate, br" -headers "Accept-Language:zh-CN,zh;q=0.9,en;q=0.8" -i "https://httpbin.org" -v trace
ffmpeg version N-92522-g370b8bd847 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --enable-nonfree --enable-videotoolbox --enable-libxml2
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 40.100 / 58. 40.100
  libavformat    58. 23.100 / 58. 23.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 46.100 /  7. 46.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Splitting the commandline.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Accept-Encoding:gzip, deflate, br'.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Accept-Language:zh-CN,zh;q=0.9,en;q=0.8'.
Reading option '-i' ... matched as input url with argument 'https://httpbin.org'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'trace'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input url https://httpbin.org.
Successfully parsed a group of options.
Opening an input file: https://httpbin.org.
[NULL @ 0x7fb6fb000a00] Opening 'https://httpbin.org' for reading
[https @ 0x7fb6fae092c0] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
[https @ 0x7fb6fae092c0] No trailing CRLF found in HTTP header.
[tcp @ 0x7fb6fae03fc0] Original list of addresses:
[tcp @ 0x7fb6fae03fc0] Address 18.211.162.154 port 443
[tcp @ 0x7fb6fae03fc0] Address 34.238.32.178 port 443
[tcp @ 0x7fb6fae03fc0] Interleaved list of addresses:
[tcp @ 0x7fb6fae03fc0] Address 18.211.162.154 port 443
[tcp @ 0x7fb6fae03fc0] Address 34.238.32.178 port 443
[tcp @ 0x7fb6fae03fc0] Starting connection attempt to 18.211.162.154 port 443
[tcp @ 0x7fb6fae03fc0] Successfully connected to 18.211.162.154 port 443
[https @ 0x7fb6fae092c0] request: GET / HTTP/1.1
User-Agent: Lavf/58.23.100
Accept: */*
Range: bytes=0-
Connection: close
Host: httpbin.org
Icy-MetaData: 1
Accept-Language:zh-CN,zh;q=0.9,en;q=0.8


[https @ 0x7fb6fae092c0] header='HTTP/1.1 200 OK'
[https @ 0x7fb6fae092c0] http_code=200
[https @ 0x7fb6fae092c0] header='Access-Control-Allow-Credentials: true'
[https @ 0x7fb6fae092c0] header='Access-Control-Allow-Origin: *'
[https @ 0x7fb6fae092c0] header='Content-Type: text/html; charset=utf-8'
[https @ 0x7fb6fae092c0] header='Date: Tue, 23 Apr 2019 13:30:33 GMT'
[https @ 0x7fb6fae092c0] header='Referrer-Policy: no-referrer-when-downgrade'
[https @ 0x7fb6fae092c0] header='Server: nginx'
[https @ 0x7fb6fae092c0] header='X-Content-Type-Options: nosniff'
[https @ 0x7fb6fae092c0] header='X-Frame-Options: DENY'
[https @ 0x7fb6fae092c0] header='X-XSS-Protection: 1; mode=block'
[https @ 0x7fb6fae092c0] header='Content-Length: 9593'
[https @ 0x7fb6fae092c0] header='Connection: Close'
[https @ 0x7fb6fae092c0] header=''
[AVIOContext @ 0x7fb6fad2b980] Statistics: 9593 bytes read, 0 seeks
https://httpbin.org: Invalid data found when processing input
liuqideMacBook-Pro:ffmpeg liuqi$ ffmpeg -headers "Accept-Encoding:gzip,deflate,br" -i "https://httpbin.org" -v trace
ffmpeg version N-92522-g370b8bd847 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --enable-nonfree --enable-videotoolbox --enable-libxml2
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 40.100 / 58. 40.100
  libavformat    58. 23.100 / 58. 23.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 46.100 /  7. 46.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Splitting the commandline.
Reading option '-headers' ... matched as AVOption 'headers' with argument 'Accept-Encoding:gzip,deflate,br'.
Reading option '-i' ... matched as input url with argument 'https://httpbin.org'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'trace'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input url https://httpbin.org.
Successfully parsed a group of options.
Opening an input file: https://httpbin.org.
[NULL @ 0x7feb26800000] Opening 'https://httpbin.org' for reading
[https @ 0x7feb25503080] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
[https @ 0x7feb25503080] No trailing CRLF found in HTTP header.
[tcp @ 0x7feb25700540] Original list of addresses:
[tcp @ 0x7feb25700540] Address 34.238.32.178 port 443
[tcp @ 0x7feb25700540] Address 18.211.162.154 port 443
[tcp @ 0x7feb25700540] Interleaved list of addresses:
[tcp @ 0x7feb25700540] Address 34.238.32.178 port 443
[tcp @ 0x7feb25700540] Address 18.211.162.154 port 443
[tcp @ 0x7feb25700540] Starting connection attempt to 34.238.32.178 port 443
[tcp @ 0x7feb25700540] Successfully connected to 34.238.32.178 port 443
[https @ 0x7feb25503080] request: GET / HTTP/1.1
User-Agent: Lavf/58.23.100
Accept: */*
Range: bytes=0-
Connection: close
Host: httpbin.org
Icy-MetaData: 1
Accept-Encoding:gzip,deflate,br


[https @ 0x7feb25503080] header='HTTP/1.1 200 OK'
[https @ 0x7feb25503080] http_code=200
[https @ 0x7feb25503080] header='Access-Control-Allow-Credentials: true'
[https @ 0x7feb25503080] header='Access-Control-Allow-Origin: *'
[https @ 0x7feb25503080] header='Content-Encoding: gzip'
[https @ 0x7feb25503080] header='Content-Type: text/html; charset=utf-8'
[https @ 0x7feb25503080] header='Date: Tue, 23 Apr 2019 13:30:39 GMT'
[https @ 0x7feb25503080] header='Referrer-Policy: no-referrer-when-downgrade'
[https @ 0x7feb25503080] header='Server: nginx'
[https @ 0x7feb25503080] header='X-Content-Type-Options: nosniff'
[https @ 0x7feb25503080] header='X-Frame-Options: DENY'
[https @ 0x7feb25503080] header='X-XSS-Protection: 1; mode=block'
[https @ 0x7feb25503080] header='Content-Length: 3168'
[https @ 0x7feb25503080] header='Connection: Close'
[https @ 0x7feb25503080] header=''
[AVIOContext @ 0x7feb25504080] Statistics: 9593 bytes read, 0 seeks
https://httpbin.org: Invalid data found when processing input
liuqideMacBook-Pro:ffmpeg liuqi$

Maybe you should use the -headers only once one input.

Note: See TracTickets for help on using tickets.