在python子进程中以字符串形式传递长url

2024-06-16 14:56:12 发布

您现在位置:Python中文网/ 问答频道 /正文

当我把这个长url作为

 subprocess.Popen(["ffmpeg", "-i",
 "https://r6---sn-ufuxaxjvh-q4fe.googlevideo.com/videoplayback?pl=16&upn=1-Ch_dUO4YE&ipbits=0&requiressl=yes&sver=3&itag=22&ratebypass=yes&dur=86.053&source=youtube&sparams=dur%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&key=yt5&mime=video%2Fmp4&fexp=900805%2C907263%2C919150%2C927622%2C942901%2C943917%2C945089%2C947225%2C948124%2C948603%2C952302%2C952605%2C952612%2C952901%2C955301%2C957201%2C959701&expire=1424133614&id=o-ANRJvkk7EYBC4ug2L1u_aJ9BifNGN5wrOnqvWkhce-WT&mm=31&initcwndbps=5045000&signature=5DC013D85BE81A4EFFA9C7B9510865A5BB7E2121.3655C01D8075EAB4668D4AFB28C401896038470A&ip=137.144.99.102&ms=au&mv=m&mt=1424111820", "out.mp4"], stdout=subprocess.PIPE)

它起作用了。在

但当我把它作为变量传递时,它就没有了。 示例:

^{pr2}$

你知道怎么做吗?在


错误

ffmpeg version N-69659-gc0367f7 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
  libavutil      54. 18.100 / 54. 18.100
  libavcodec     56. 21.102 / 56. 21.102
  libavformat    56. 19.100 / 56. 19.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5.  9.104 /  5.  9.104
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[tls @ 000000000033b9c0] The TLS connection was non-properly terminated.
https://r6---sn-ufuxaxjvh-q4fe.googlevideo.com/videoplayback?sver=3&ratebypass=yes&signature=BD4B6B18A9753B2B99F8C439FD1A7D809E866740.D3822A9D82D67A0F92908863E08F887A101B58A7&initcwndbps=5112500&ipbits=0&source=youtube&dur=86.053&itag=22&pl=16&mime=video%2Fmp4&fexp=907263%2C927622%2C934954%2C9406738%2C9406963%2C943917%2C947225%2C948124%2C952302%2C952605%2C952612%2C952901%2C955301%2C957201%2C959701&mm=31&requiressl=yes&mt=1424116526&mv=m&ms=au&ip=137.144.99.102&key=yt5&upn=6MJQ3GrpFkA&expire=1424138291&sparams=dur%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cmime%2Cmm%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&id=o-AGbNQ-s1alKbG-j05uoGOvT4MMeDv3qdgMqWZu-vGap9

: Input/output error

Tags: httpscomenableffmpegyesplsubprocesssn