我在 Firefox 中使用 wget 和 Flashgot 进行下载。如果我暂停(按 ctrl+c),则无法恢复下载。因为我不知道 wget 的命令行参数,无法在终端中手动添加它。因此,当 wget 开始下载时,我执行了以下步骤来获取这些命令行参数。完成这些步骤后,我按 ctrl+c 暂停下载:
ps -A | grep -i wget
并复制 wget 的 pid 假设它是 16760xargs -0 echo < /proc/16760/cmdline > ls.txt
(从https://stackoverflow.com/questions/821837/how-to-get-the-command-line-args-passed-to-a-running-process-on-unix-linux-syste)
现在,ls.txt 包含:
wget --trust-server-names -c -O PSY_GENTLEMAN_M_V_hd720.mp4 --directory-prefix=/home/aliyans/Downloads --referer=https://www.youtube.com/watch?v=ASO_zypdnsQ --user-agent=Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0 http://r5---sn-gxap5ojx-h55e.c.youtube.com/videoplayback?ipbits=8&sparams=cp%2Cgcr%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&gcr=in&source=youtube&ip=115.242.140.33&mv=m&ms=au&fexp=906370%2C913574%2C913811%2C932000%2C932004%2C906383%2C916911%2C916910%2C902000%2C901208%2C919512%2C929903%2C925714%2C929119%2C931202%2C900821%2C900823%2C909419%2C911416%2C908529%2C930807%2C919373%2C930803%2C906836%2C920201%2C929602%2C930101%2C930609%2C926403%2C900824%2C912711&ratebypass=yes&mt=1366553656&sver=3&itag=22&id=0123bfcf2a5d9ec4&newshard=yes&expire=1366577026&upn=ByXHIHSd5Uc&key=yt1&cp=U0hVS1VSVV9HUENONV9NTFlBOkRWZzI0MEJKeDBt&signature=BD13D36DD291572B599B536476EC1247E7C487C9.34F8B3C3F0BF8198C68C4490EC4257650A569DC6
我复制了上面的行并粘贴到终端中。但它显示:
bash: syntax error near unexpected token `('
我如何从 wget 恢复由 FlashGot 启动的下载?或者还有其他方法吗?
答案1
您需要在该--user-agent=Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:19.0) Gecko/20100101 Firefox/19.0
部分周围加上引号,以防止 shell 解释括号和分号,或者完全省略该参数,因为不需要它。