現在換回了windows,發現uget也是支持window,果斷下載安裝。
但是發現從firefox跳轉到uget下載卻不怎么好使,FlashGot根本沒有uget下載選項。
uGet顯示為灰色
沒辦法自己添加一個選項,發現可以調用了,但是有個問題,只有下載鏈接傳了過來,cookie、referer沒有傳過來,遇到需要校驗的就沒辦法下載了。
試著自己添加參數模板,查詢了一下uGet文檔。
uGet參數
在cmd下試了一下,沒問題。
然后在模板參數里面添加這些參數,然后發生了一些奇怪的問題(flashgot會默認將這些參數換行)。弄了好久,還是不行,最后決定不弄了。
突然想到,我可以自己寫一個中間程序,處理參數中的換行之后,再去調用uGet。
class Program
{
static void Main(string[] args)
{
string filefullname = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
string filepath = System.IO.Path.GetDirectoryName(filefullname);
StringBuilder SB = new StringBuilder();
foreach (string ar in args)
{
if (ar == "#")
SB.Append(" ");
else if(ar =="@")
SB.Append("\"");
else
SB.Append(ar);
}
//Console.WriteLine(SB.ToString());
try
{
System.Diagnostics.Process.Start(filepath + "\\uget.exe", SB.ToString());
}
catch (Exception e)
{
Console.WriteLine("發生錯誤:" + e.Message);
Console.WriteLine(filefullname);
Console.WriteLine(filepath);
Console.WriteLine("按任意鍵退出!");
Console.ReadKey();
}
}
}
模板參數這樣寫。
[URL]
#
--filename=
@
[FNAME]
@
#
--http-referer=
@
[REFERER]
@
#
--http-cookie-data=
@
[COOKIE]
@
#
--http-cookie-file=
@
[CFILE]
@
#
--http-post-data=
@
[RAWPOST]
@
完美解決。