diff --git a/WinHTTrack/OptionTab1.cpp b/WinHTTrack/OptionTab1.cpp index 6a1426d..7a165ec 100755 --- a/WinHTTrack/OptionTab1.cpp +++ b/WinHTTrack/OptionTab1.cpp @@ -30,6 +30,9 @@ COptionTab1::COptionTab1() : CPropertyPage(COptionTab1::IDD) m_parseall = FALSE; m_testall = FALSE; m_htmlfirst = FALSE; + m_keepwww = FALSE; + m_keepslashes = FALSE; + m_keepqueryorder = FALSE; //}}AFX_DATA_INIT } @@ -45,6 +48,9 @@ void COptionTab1::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_parseall, m_parseall); DDX_Check(pDX, IDC_testall, m_testall); DDX_Check(pDX, IDC_htmlfirst, m_htmlfirst); + DDX_Check(pDX, IDC_keepwww, m_keepwww); + DDX_Check(pDX, IDC_keepslashes, m_keepslashes); + DDX_Check(pDX, IDC_keepqueryorder, m_keepqueryorder); //}}AFX_DATA_MAP } @@ -69,11 +75,17 @@ BOOL COptionTab1::OnInitDialog() GetDlgItem(IDC_link) ->ModifyStyle(0,WS_DISABLED); GetDlgItem(IDC_testall) ->ModifyStyle(0,WS_DISABLED); GetDlgItem(IDC_htmlfirst)->ModifyStyle(0,WS_DISABLED); + GetDlgItem(IDC_keepwww) ->ModifyStyle(0,WS_DISABLED); + GetDlgItem(IDC_keepslashes)->ModifyStyle(0,WS_DISABLED); + GetDlgItem(IDC_keepqueryorder)->ModifyStyle(0,WS_DISABLED); } else { GetDlgItem(IDC_parseall) ->ModifyStyle(WS_DISABLED,0); GetDlgItem(IDC_link) ->ModifyStyle(WS_DISABLED,0); GetDlgItem(IDC_testall) ->ModifyStyle(WS_DISABLED,0); GetDlgItem(IDC_htmlfirst)->ModifyStyle(WS_DISABLED,0); + GetDlgItem(IDC_keepwww) ->ModifyStyle(WS_DISABLED,0); + GetDlgItem(IDC_keepslashes)->ModifyStyle(WS_DISABLED,0); + GetDlgItem(IDC_keepqueryorder)->ModifyStyle(WS_DISABLED,0); } // Patcher l'interface pour les Français ;-) @@ -83,6 +95,9 @@ BOOL COptionTab1::OnInitDialog() SetDlgItemTextCP(this, IDC_testall,LANG(LANG_I32)); // "Tester tous les liens (même ceux interdits)"); SetDlgItemTextCP(this, IDC_parseall,LANG(LANG_I32b)); SetDlgItemTextCP(this, IDC_htmlfirst,LANG(LANG_I32c)); + SetDlgItemTextCP(this, IDC_keepwww,LANG(LANG_KEEPWWW)); + SetDlgItemTextCP(this, IDC_keepslashes,LANG(LANG_KEEPSLASHES)); + SetDlgItemTextCP(this, IDC_keepqueryorder,LANG(LANG_KEEPQUERYORDER)); } return TRUE; // return TRUE unless you set the focus to a control @@ -131,6 +146,9 @@ const char* COptionTab1::GetTip(int ID) case IDC_testall: return LANG(LANG_I2); break; // "Test all links in pages","Tester tous les liens dans les pages"); break; case IDC_parseall: return LANG(LANG_I2b); break; case IDC_htmlfirst: return LANG(LANG_I2c); break; + case IDC_keepwww: return LANG(LANG_KEEPWWWTIP); break; + case IDC_keepslashes: return LANG(LANG_KEEPSLASHESTIP); break; + case IDC_keepqueryorder: return LANG(LANG_KEEPQUERYORDERTIP); break; } return ""; } diff --git a/WinHTTrack/OptionTab1.h b/WinHTTrack/OptionTab1.h index 3e1de36..5a99e77 100644 --- a/WinHTTrack/OptionTab1.h +++ b/WinHTTrack/OptionTab1.h @@ -28,6 +28,9 @@ class COptionTab1 : public CPropertyPage BOOL m_parseall; BOOL m_testall; BOOL m_htmlfirst; + BOOL m_keepwww; + BOOL m_keepslashes; + BOOL m_keepqueryorder; //}}AFX_DATA diff --git a/WinHTTrack/OptionTab10.cpp b/WinHTTrack/OptionTab10.cpp index 64878d4..b40d529 100755 --- a/WinHTTrack/OptionTab10.cpp +++ b/WinHTTrack/OptionTab10.cpp @@ -44,6 +44,7 @@ COptionTab10::COptionTab10() : CPropertyPage(COptionTab10::IDD) m_port = _T(""); m_ftpprox = FALSE; //}}AFX_DATA_INIT + m_proxytype = 0; } COptionTab10::~COptionTab10() @@ -206,7 +207,9 @@ void COptionTab10::Onproxyconfigure() proxy.m_proxlogin=user_pass; proxy.m_proxpass=a+1; } + proxy.m_proxytype = m_proxytype; if (proxy.DoModal() == IDOK) { + m_proxytype = proxy.m_proxytype; if (proxy.m_proxlogin.GetLength()==0) { SetDlgItemTextCP(this, IDC_prox,proxy.m_proxadr); m_ctl_pwdhide.SetCheck(0); diff --git a/WinHTTrack/OptionTab10.h b/WinHTTrack/OptionTab10.h index 3a77fec..014d6d3 100644 --- a/WinHTTrack/OptionTab10.h +++ b/WinHTTrack/OptionTab10.h @@ -21,6 +21,7 @@ class COptionTab10 : public CPropertyPage const char* GetTip(int id); int modify; int prox_status; + int m_proxytype; /* 0 = HTTP proxy, 1 = SOCKS5 proxy */ char ProxyDetectBuff[16][1024]; CString ProxyDetectName[16]; diff --git a/WinHTTrack/OptionTab3.cpp b/WinHTTrack/OptionTab3.cpp index ebf280b..e83d346 100755 --- a/WinHTTrack/OptionTab3.cpp +++ b/WinHTTrack/OptionTab3.cpp @@ -32,6 +32,7 @@ COptionTab3::COptionTab3() : CPropertyPage(COptionTab3::IDD) m_windebug = FALSE; m_cache = FALSE; m_travel3 = -1; + m_stripquery = _T(""); //}}AFX_DATA_INIT } @@ -53,6 +54,7 @@ void COptionTab3::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_windebug, m_windebug); DDX_Check(pDX, IDC_Cache, m_cache); DDX_CBIndex(pDX, IDC_travel3, m_travel3); + DDX_Text(pDX, IDC_stripquery, m_stripquery); //}}AFX_DATA_MAP } @@ -82,6 +84,8 @@ BOOL COptionTab3::OnInitDialog() GetDlgItem(IDC_STATIC_primf) ->ModifyStyle(0,WS_DISABLED); GetDlgItem(IDC_STATIC_travel) ->ModifyStyle(0,WS_DISABLED); GetDlgItem(IDC_STATIC_travel2) ->ModifyStyle(0,WS_DISABLED); + GetDlgItem(IDC_stripquery) ->ModifyStyle(0,WS_DISABLED); + GetDlgItem(IDC_STATIC_stripquery)->ModifyStyle(0,WS_DISABLED); } else { GetDlgItem(IDC_Cache) ->ModifyStyle(WS_DISABLED,0); GetDlgItem(IDC_filter) ->ModifyStyle(WS_DISABLED,0); @@ -92,6 +96,8 @@ BOOL COptionTab3::OnInitDialog() GetDlgItem(IDC_STATIC_travel) ->ModifyStyle(WS_DISABLED,0); GetDlgItem(IDC_STATIC_travel2) ->ModifyStyle(WS_DISABLED,0); GetDlgItem(IDC_STATIC_travel3) ->ModifyStyle(WS_DISABLED,0); + GetDlgItem(IDC_stripquery) ->ModifyStyle(WS_DISABLED,0); + GetDlgItem(IDC_STATIC_stripquery)->ModifyStyle(WS_DISABLED,0); } // Patcher l'interface pour les Français ;-) @@ -102,6 +108,7 @@ BOOL COptionTab3::OnInitDialog() SetDlgItemTextCP(this, IDC_STATIC_travel2,LANG(LANG_I40b)); // "Mode de parcours"); SetDlgItemTextCP(this, IDC_STATIC_warning,LANG(LANG_I40c)); SetDlgItemTextCP(this, IDC_STATIC_travel3,LANG(LANG_I40e)); + SetDlgItemTextCP(this, IDC_STATIC_stripquery,LANG(LANG_STRIPQUERY)); SetDlgItemTextCP(this, IDC_windebug,LANG_I40d); // Activate debug mode (winhttrack.log) SetCombo(this,IDC_filter,LISTDEF_4); SetCombo(this,IDC_travel,LISTDEF_5); @@ -158,6 +165,7 @@ const char* COptionTab3::GetTip(int ID) case IDC_travel2: return LANG(LANG_I11b); break; // "Select the travel direction in the site","Sélection de la direction du miroir"); break; case IDC_travel3: return LANG(LANG_I11c); break; case IDC_windebug: return LANG_I1h; break; + case IDC_stripquery: return LANG(LANG_STRIPQUERYTIP); break; } return ""; } diff --git a/WinHTTrack/OptionTab3.h b/WinHTTrack/OptionTab3.h index a4bf378..2159d31 100644 --- a/WinHTTrack/OptionTab3.h +++ b/WinHTTrack/OptionTab3.h @@ -35,6 +35,7 @@ class COptionTab3 : public CPropertyPage BOOL m_windebug; BOOL m_cache; int m_travel3; + CString m_stripquery; //}}AFX_DATA diff --git a/WinHTTrack/OptionTab4.cpp b/WinHTTrack/OptionTab4.cpp index c1bb891..799f31b 100755 --- a/WinHTTrack/OptionTab4.cpp +++ b/WinHTTrack/OptionTab4.cpp @@ -33,6 +33,7 @@ COptionTab4::COptionTab4() : CPropertyPage(COptionTab4::IDD) m_rems = FALSE; m_rate = _T(""); m_ka = FALSE; + m_pausefiles = _T(""); //}}AFX_DATA_INIT } @@ -51,6 +52,7 @@ void COptionTab4::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_rems, m_rems); DDX_Text(pDX, IDC_rate, m_rate); DDX_Check(pDX, IDC_ka, m_ka); + DDX_Text(pDX, IDC_pausefiles, m_pausefiles); //}}AFX_DATA_MAP } @@ -79,6 +81,7 @@ BOOL COptionTab4::OnInitDialog() SetDlgItemTextCP(this, IDC_rems,LANG(LANG_I47)); // "Abandon hote si lent"); SetDlgItemTextCP(this, IDC_ka,LANG(LANG_I47e)); SetDlgItemTextCP(this, IDC_STATIC_timeout,LANG_I47d); // TimeOut(s) + SetDlgItemTextCP(this, IDC_STATIC_pausefiles,LANG(LANG_PAUSEFILES)); } return TRUE; // return TRUE unless you set the focus to a control @@ -131,6 +134,7 @@ const char* COptionTab4::GetTip(int ID) case IDC_rate: return LANG(LANG_I15); break; // "Minimum transfer rate tolerated","Taux de transfert minimal toléré"); break; case IDC_rems: return LANG(LANG_I16); break; // "Cancel all links from a host if it is too slow","Annuler tous les liens sur un domaine en cas de transfert trop lent"); break; case IDC_ka: return LANG(LANG_I47f); break; + case IDC_pausefiles: return LANG(LANG_PAUSEFILESTIP); break; } return ""; } diff --git a/WinHTTrack/OptionTab4.h b/WinHTTrack/OptionTab4.h index fac70c1..ad2e6cd 100644 --- a/WinHTTrack/OptionTab4.h +++ b/WinHTTrack/OptionTab4.h @@ -31,6 +31,7 @@ class COptionTab4 : public CPropertyPage BOOL m_rems; CString m_rate; BOOL m_ka; + CString m_pausefiles; //}}AFX_DATA diff --git a/WinHTTrack/OptionTab8.cpp b/WinHTTrack/OptionTab8.cpp index 97598c1..c698bd8 100755 --- a/WinHTTrack/OptionTab8.cpp +++ b/WinHTTrack/OptionTab8.cpp @@ -34,6 +34,7 @@ COptionTab8::COptionTab8() : CPropertyPage(COptionTab8::IDD) m_toler = FALSE; m_updhack = FALSE; m_urlhack = FALSE; + m_cookiesfile = _T(""); //}}AFX_DATA_INIT } @@ -53,18 +54,30 @@ void COptionTab8::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_toler, m_toler); DDX_Check(pDX, IDC_updhack, m_updhack); DDX_Check(pDX, IDC_urlhack, m_urlhack); + DDX_Text(pDX, IDC_cookiesfile, m_cookiesfile); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(COptionTab8, CPropertyPage) //{{AFX_MSG_MAP(COptionTab8) + ON_BN_CLICKED(IDC_cookiesfilebrowse, OnCookiesFileBrowse) //}}AFX_MSG_MAP ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify ) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // COptionTab8 message handlers + +void COptionTab8::OnCookiesFileBrowse() +{ + // writable buffer: CFileDialog rewrites the '|' separators in place + char szFilter[] = "Cookies file (cookies.txt, *.txt)|*.txt|All files (*.*)|*.*||"; + CFileDialog dial(TRUE, "txt", NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, szFilter); + if (dial.DoModal() == IDOK) + SetDlgItemTextCP(this, IDC_cookiesfile, dial.GetPathName()); +} + BOOL COptionTab8::OnInitDialog() { CDialog::OnInitDialog(); @@ -104,6 +117,7 @@ BOOL COptionTab8::OnInitDialog() SetDlgItemTextCP(this, IDC_toler,LANG(LANG_I62)); SetDlgItemTextCP(this, IDC_updhack,LANG(LANG_I62b)); SetDlgItemTextCP(this, IDC_urlhack,LANG(LANG_I62b2)); + SetDlgItemTextCP(this, IDC_STATIC_cookiesfile,LANG(LANG_COOKIEFILE)); SetCombo(this,IDC_checktype,LISTDEF_7); SetCombo(this,IDC_robots,LISTDEF_8); } @@ -160,6 +174,7 @@ const char* COptionTab8::GetTip(int ID) case IDC_toler: return LANG(LANG_I1i); break; case IDC_updhack: return LANG(LANG_I1k); break; case IDC_urlhack: return LANG(LANG_I1k2); break; + case IDC_cookiesfile: return LANG(LANG_COOKIEFILETIP); break; } return ""; } diff --git a/WinHTTrack/OptionTab8.h b/WinHTTrack/OptionTab8.h index 865cbdb..07d647e 100644 --- a/WinHTTrack/OptionTab8.h +++ b/WinHTTrack/OptionTab8.h @@ -32,6 +32,7 @@ class COptionTab8 : public CPropertyPage BOOL m_toler; BOOL m_updhack; BOOL m_urlhack; + CString m_cookiesfile; //}}AFX_DATA @@ -47,6 +48,7 @@ class COptionTab8 : public CPropertyPage // Generated message map functions //{{AFX_MSG(COptionTab8) virtual BOOL OnInitDialog(); + afx_msg void OnCookiesFileBrowse(); //}}AFX_MSG afx_msg BOOL OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult ); DECLARE_MESSAGE_MAP() diff --git a/WinHTTrack/ProxyId.cpp b/WinHTTrack/ProxyId.cpp index 9a80b82..cc6d366 100755 --- a/WinHTTrack/ProxyId.cpp +++ b/WinHTTrack/ProxyId.cpp @@ -28,6 +28,7 @@ CProxyId::CProxyId(CWnd* pParent /*=NULL*/) m_proxlogin = _T(""); m_proxpass = _T(""); m_proxport = _T(""); + m_proxytype = 0; //}}AFX_DATA_INIT } @@ -40,6 +41,8 @@ void CProxyId::DoDataExchange(CDataExchange* pDX) DDX_Text(pDX, IDC_proxlogin, m_proxlogin); DDX_Text(pDX, IDC_proxpass, m_proxpass); DDX_Text(pDX, IDC_proxport, m_proxport); + DDX_Control(pDX, IDC_proxytype, m_ctl_proxytype); + DDX_CBIndex(pDX, IDC_proxytype, m_proxytype); //}}AFX_DATA_MAP } @@ -61,9 +64,16 @@ BOOL CProxyId::OnInitDialog() SetIcon(httrack_icon,true); EnableToolTips(true); // TOOL TIPS SetForegroundWindow(); // yop en premier plan! + + /* Proxy protocol selector (HTTP or SOCKS5). Index maps to m_proxytype; + the scheme is prepended to the -P argument by the shell. */ + m_ctl_proxytype.AddString("HTTP"); + m_ctl_proxytype.AddString("SOCKS5"); + m_ctl_proxytype.SetCurSel(m_proxytype == 1 ? 1 : 0); if (LANG_T(-1)) { // Patcher en français SetWindowTextCP(this, LANG(LANG_R1)); + SetDlgItemTextCP(this, IDC_STATIC_ptype,LANG(LANG_PROXYTYPE)); SetDlgItemTextCP(this, IDC_STATIC_adr,LANG(LANG_R2)); SetDlgItemTextCP(this, IDC_STATIC_port,LANG(LANG_R3)); SetDlgItemTextCP(this, IDC_STATIC_auth,LANG(LANG_R4)); @@ -131,6 +141,7 @@ BOOL CProxyId::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult ) const char* CProxyId::GetTip(int ID) { switch(ID) { + case IDC_proxytype: return LANG(LANG_PROXYTYPETIP); break; case IDC_proxadr: return LANG(LANG_R10); break; case IDC_proxport: return LANG(LANG_R11); break; case IDC_proxlogin: return LANG(LANG_R12); break; diff --git a/WinHTTrack/ProxyId.h b/WinHTTrack/ProxyId.h index 3bfe59d..389a11a 100644 --- a/WinHTTrack/ProxyId.h +++ b/WinHTTrack/ProxyId.h @@ -19,10 +19,12 @@ class CProxyId : public CDialog // Dialog Data //{{AFX_DATA(CProxyId) enum { IDD = IDD_ProxyId }; + CComboBox m_ctl_proxytype; CString m_proxadr; CString m_proxlogin; CString m_proxpass; CString m_proxport; + int m_proxytype; //}}AFX_DATA diff --git a/WinHTTrack/Shell.cpp b/WinHTTrack/Shell.cpp index fa65c0f..02f0525 100755 --- a/WinHTTrack/Shell.cpp +++ b/WinHTTrack/Shell.cpp @@ -587,6 +587,7 @@ void compute_options() { // proxy ShellOptions->proxy = maintab->m_option10.m_proxy; + ShellOptions->proxyscheme = (maintab->m_option10.m_proxytype == 1) ? "socks5://" : ""; ShellOptions->port = maintab->m_option10.m_port; if (maintab->m_option10.m_ftpprox) ShellOptions->proxyftp = "%f"; @@ -616,6 +617,9 @@ void compute_options() { if(maintab->m_option2.m_hidepwd) ShellOptions->hidepwd = "%x"; else ShellOptions->hidepwd = ""; if(maintab->m_option2.m_hidequery) ShellOptions->hidequery = "%q0"; else ShellOptions->hidequery = ""; + ShellOptions->keepwww = maintab->m_option1.m_keepwww ? "--keep-www-prefix" : ""; + ShellOptions->keepslashes = maintab->m_option1.m_keepslashes ? "--keep-double-slashes" : ""; + ShellOptions->keepqueryorder = maintab->m_option1.m_keepqueryorder ? "--keep-query-order" : ""; ShellOptions->robots = ""; if(maintab->m_option8.m_robots==0) ShellOptions->robots = "s0"; else if(maintab->m_option8.m_robots==1) ShellOptions->robots = "s1"; @@ -631,6 +635,8 @@ void compute_options() { if (maintab->m_option8.m_updhack) ShellOptions->updhack = "%s"; // update hack if (maintab->m_option8.m_urlhack) ShellOptions->urlhack = "%u"; // URL hack else ShellOptions->urlhack = "%u0"; + ShellOptions->cookiesfile = maintab->m_option8.m_cookiesfile; + ShellOptions->pausefiles = maintab->m_option4.m_pausefiles; // store all in cache,logtype if(maintab->m_option9.m_Cache2!=0) ShellOptions->Cache2 = "k"; @@ -682,6 +688,7 @@ void compute_options() { else if (maintab->m_option3.m_travel3==1) ShellOptions->filtre += "K"; else if (maintab->m_option3.m_travel3==2) ShellOptions->filtre += "K3"; else if (maintab->m_option3.m_travel3==3) ShellOptions->filtre += "K4"; + ShellOptions->stripquery = maintab->m_option3.m_stripquery; if (maintab->m_option9.m_logf) ShellOptions->log = "f2"; else ShellOptions->log = "Q"; @@ -1998,7 +2005,30 @@ void lance(void) { if ((int)ShellOptions->proxy.GetLength()>0) { args.Add("-P"); - args.Add(ShellOptions->proxy + ":" + ShellOptions->port); + args.Add(ShellOptions->proxyscheme + ShellOptions->proxy + ":" + ShellOptions->port); + } + + // preload extra cookies from a Netscape cookies.txt (--cookies-file) + if (ShellOptions->cookiesfile.GetLength() != 0) { + args.Add("--cookies-file"); + args.Add(ShellOptions->cookiesfile); + } + + // random pause between files, MIN[:MAX] seconds (--pause) + if (ShellOptions->pausefiles.GetLength() != 0) { + args.Add("--pause"); + args.Add(ShellOptions->pausefiles); + } + + // URL-hack opt-outs (only meaningful with -%u url hacks on) + if (ShellOptions->keepwww.GetLength() != 0) args.Add(ShellOptions->keepwww); + if (ShellOptions->keepslashes.GetLength() != 0) args.Add(ShellOptions->keepslashes); + if (ShellOptions->keepqueryorder.GetLength() != 0) args.Add(ShellOptions->keepqueryorder); + + // drop selected query keys from the dedup naming (--strip-query) + if (ShellOptions->stripquery.GetLength() != 0) { + args.Add("--strip-query"); + args.Add(ShellOptions->stripquery); } // mode spider, mettre après options @@ -2485,6 +2515,9 @@ void Write_profile(CString path,int load_path) { MyWriteProfileInt(path,strSection, "Test",maintab->m_option1.m_testall); MyWriteProfileInt(path,strSection, "ParseAll",maintab->m_option1.m_parseall); MyWriteProfileInt(path,strSection, "HTMLFirst",maintab->m_option1.m_htmlfirst); + MyWriteProfileInt(path,strSection, "KeepWww",maintab->m_option1.m_keepwww); + MyWriteProfileInt(path,strSection, "KeepSlashes",maintab->m_option1.m_keepslashes); + MyWriteProfileInt(path,strSection, "KeepQueryOrder",maintab->m_option1.m_keepqueryorder); MyWriteProfileInt(path,strSection, "Cache",maintab->m_option3.m_cache); MyWriteProfileInt(path,strSection, "NoRecatch",maintab->m_option9.m_norecatch); MyWriteProfileInt(path,strSection, "Dos", @@ -2512,6 +2545,8 @@ void Write_profile(CString path,int load_path) { MyWriteProfileInt(path,strSection, "TolerantRequests",maintab->m_option8.m_toler); MyWriteProfileInt(path,strSection, "UpdateHack",maintab->m_option8.m_updhack); MyWriteProfileInt(path,strSection, "URLHack",maintab->m_option8.m_urlhack); + MyWriteProfileString(path,strSection, "CookiesFile",maintab->m_option8.m_cookiesfile); + MyWriteProfileString(path,strSection, "PauseFiles",maintab->m_option4.m_pausefiles); MyWriteProfileInt(path,strSection, "StoreAllInCache",maintab->m_option9.m_Cache2); MyWriteProfileInt(path,strSection, "LogType",maintab->m_option9.m_logtype); MyWriteProfileInt(path,strSection, "UseHTTPProxyForFTP",maintab->m_option10.m_ftpprox); @@ -2522,6 +2557,7 @@ void Write_profile(CString path,int load_path) { MyWriteProfileInt(path,strSection, "Travel",maintab->m_option3.m_travel); MyWriteProfileInt(path,strSection, "GlobalTravel",maintab->m_option3.m_travel2); MyWriteProfileInt(path,strSection, "RewriteLinks",maintab->m_option3.m_travel3); + MyWriteProfileString(path,strSection, "StripQuery",maintab->m_option3.m_stripquery); MyWriteProfileString(path,strSection, "BuildString",maintab->m_option2.Bopt.m_BuildString); // champs @@ -2545,6 +2581,7 @@ void Write_profile(CString path,int load_path) { MyWriteProfileString(path,strSection, "WildCardFilters",maintab->m_option7.m_url2); MyWriteProfileString(path,strSection, "Proxy",maintab->m_option10.m_proxy); MyWriteProfileString(path,strSection, "Port",maintab->m_option10.m_port); + MyWriteProfileInt(path,strSection, "ProxyType",maintab->m_option10.m_proxytype); MyWriteProfileString(path,strSection, "Depth",maintab->m_option5.m_depth); MyWriteProfileString(path,strSection, "ExtDepth",maintab->m_option5.m_depth2); MyWriteProfileString(path,strSection, "MaxConn",maintab->m_option5.m_maxconn); @@ -2580,6 +2617,12 @@ void Write_profile(CString path,int load_path) { MyWriteProfileInt(path,strSection,"ParseAll", n); n=maintab->m_option1.IsDlgButtonChecked(IDC_htmlfirst); MyWriteProfileInt(path,strSection,"HTMLFirst", n); + n=maintab->m_option1.IsDlgButtonChecked(IDC_keepwww); + MyWriteProfileInt(path,strSection,"KeepWww", n); + n=maintab->m_option1.IsDlgButtonChecked(IDC_keepslashes); + MyWriteProfileInt(path,strSection,"KeepSlashes", n); + n=maintab->m_option1.IsDlgButtonChecked(IDC_keepqueryorder); + MyWriteProfileInt(path,strSection,"KeepQueryOrder", n); // 2 n=maintab->m_option3.IsDlgButtonChecked(IDC_Cache); MyWriteProfileInt(path,strSection,"Cache", n); @@ -2621,6 +2664,8 @@ void Write_profile(CString path,int load_path) { MyWriteProfileInt(path,strSection, "GlobalTravel", n); if ((n=maintab->m_option3.m_ctl_travel3.GetCurSel()) != CB_ERR) MyWriteProfileInt(path,strSection, "RewriteLinks", n); + maintab->m_option3.GetDlgItemText(IDC_stripquery,st); + MyWriteProfileString(path,strSection, "StripQuery", st); // maintab->m_option8.GetDlgItemText(IDC_robots,st); MyWriteProfileString(path,strSection, "FollowRobotsTxt", st); @@ -2691,6 +2736,10 @@ void Write_profile(CString path,int load_path) { MyWriteProfileInt(path,strSection, "UpdateHack", n); n=maintab->m_option8.IsDlgButtonChecked(IDC_urlhack); MyWriteProfileInt(path,strSection, "URLHack", n); + maintab->m_option8.GetDlgItemText(IDC_cookiesfile,st); + MyWriteProfileString(path,strSection, "CookiesFile", st); + maintab->m_option4.GetDlgItemText(IDC_pausefiles,st); + MyWriteProfileString(path,strSection, "PauseFiles", st); // 9 maintab->m_option9.GetDlgItemText(IDC_Cache2,st); MyWriteProfileString(path,strSection, "StoreAllInCache", st); @@ -2701,6 +2750,7 @@ void Write_profile(CString path,int load_path) { MyWriteProfileString(path,strSection,"Proxy",st); maintab->m_option10.GetDlgItemText(IDC_proxport,st); MyWriteProfileString(path,strSection,"Port",st); + MyWriteProfileInt(path,strSection,"ProxyType", maintab->m_option10.m_proxytype); n=maintab->m_option10.IsDlgButtonChecked(IDC_ftpprox); MyWriteProfileInt(path,strSection,"UseHTTPProxyForFTP", n); @@ -2808,6 +2858,9 @@ void Read_profile(CString path,int load_path) { maintab->m_option1.m_testall = MyGetProfileInt(path,strSection, "Test",0); maintab->m_option1.m_parseall = MyGetProfileInt(path,strSection, "ParseAll",1); maintab->m_option1.m_htmlfirst = MyGetProfileInt(path,strSection, "HTMLFirst",0); + maintab->m_option1.m_keepwww = MyGetProfileInt(path,strSection, "KeepWww",0); + maintab->m_option1.m_keepslashes = MyGetProfileInt(path,strSection, "KeepSlashes",0); + maintab->m_option1.m_keepqueryorder = MyGetProfileInt(path,strSection, "KeepQueryOrder",0); maintab->m_option3.m_cache = MyGetProfileInt(path,strSection, "Cache",1); maintab->m_option9.m_norecatch = MyGetProfileInt(path,strSection, "NoRecatch",0); maintab->m_option2.m_dos = (MyGetProfileInt(path,strSection, "Dos",0) & 1); @@ -2831,6 +2884,8 @@ void Read_profile(CString path,int load_path) { maintab->m_option8.m_toler = MyGetProfileInt(path,strSection, "TolerantRequests",0); maintab->m_option8.m_updhack = MyGetProfileInt(path,strSection, "UpdateHack",1); maintab->m_option8.m_urlhack = MyGetProfileInt(path,strSection, "URLHack",1); + maintab->m_option8.m_cookiesfile = MyGetProfileString(path,strSection, "CookiesFile"); + maintab->m_option4.m_pausefiles = MyGetProfileString(path,strSection, "PauseFiles"); maintab->m_option8.m_http10 = MyGetProfileInt(path,strSection, "HTTP10",0); maintab->m_option9.m_Cache2 = MyGetProfileInt(path,strSection, "StoreAllInCache",0); maintab->m_option9.m_logtype = MyGetProfileInt(path,strSection, "LogType",0); @@ -2841,6 +2896,7 @@ void Read_profile(CString path,int load_path) { maintab->m_option3.m_travel = MyGetProfileInt(path,strSection, "Travel",1); maintab->m_option3.m_travel2 = MyGetProfileInt(path,strSection, "GlobalTravel",0); maintab->m_option3.m_travel3 = MyGetProfileInt(path,strSection, "RewriteLinks",0); + maintab->m_option3.m_stripquery = MyGetProfileString(path,strSection, "StripQuery"); maintab->m_option2.Bopt.m_BuildString = MyGetProfileString(path,strSection, "BuildString","%h%p/%n%q.%t"); // champs @@ -2855,7 +2911,7 @@ void Read_profile(CString path,int load_path) { maintab->m_option5.m_maxtime = MyGetProfileString(path,strSection, "MaxTime"); maintab->m_option4.m_timeout = MyGetProfileString(path,strSection, "TimeOut"); maintab->m_option4.m_rate = MyGetProfileString(path,strSection, "RateOut"); - maintab->m_option6.m_user = MyGetProfileString(path,strSection, "UserID","Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)"); + maintab->m_option6.m_user = MyGetProfileString(path,strSection, "UserID","Mozilla/5.0 (compatible; HTTrack; +https://www.httrack.com/)"); maintab->m_option6.m_footer = MyGetProfileString(path,strSection, "Footer",HTS_DEFAULT_FOOTER); maintab->m_option6.m_accept_language = MyGetProfileString(path,strSection, "AcceptLanguage", default_lang); @@ -2873,6 +2929,7 @@ void Read_profile(CString path,int load_path) { // 10 maintab->m_option10.m_proxy = MyGetProfileString(path,strSection, "Proxy"); maintab->m_option10.m_port = MyGetProfileString(path,strSection, "Port"); + maintab->m_option10.m_proxytype = MyGetProfileInt(path,strSection, "ProxyType",0); maintab->m_option10.m_ftpprox = MyGetProfileInt(path,strSection, "UseHTTPProxyForFTP",1); // maintab->m_option5.m_depth = MyGetProfileString(path,strSection, "Depth"); diff --git a/WinHTTrack/Shell.h b/WinHTTrack/Shell.h index 96b0a29..631cf49 100755 --- a/WinHTTrack/Shell.h +++ b/WinHTTrack/Shell.h @@ -195,7 +195,7 @@ BOOL LaunchMirror(); /* Class */ class CShellOptions { public: - CString url, filelist, proxy, proxyftp, port, depth, + CString url, filelist, proxy, proxyscheme, proxyftp, port, depth, extdepth, get, where, meth, maxfile, max, frag, conn, tog, cache, robots, choixdeb, build, filtre, htmlfirst, index, index2, index_mail, dos, time, rate, hostquit, ka, @@ -204,7 +204,9 @@ class CShellOptions { cookies, checktype, parsejava, Cache2, logtype, norecatch, toler, updhack, urlhack, http10, waittime, maxtime, maxrate, maxconn, maxlinks, hh, mm, ss, buff_filtres, buff_MIME, - _RasString, accept_language, other_headers, default_referer; + _RasString, accept_language, other_headers, default_referer, + cookiesfile, pausefiles, keepwww, keepslashes, keepqueryorder, + stripquery; CString LINE_back; RASDIALPARAMS _dial; }; diff --git a/WinHTTrack/WinHTTrack.rc b/WinHTTrack/WinHTTrack.rc index 60f328d..27a9f84 100755 --- a/WinHTTrack/WinHTTrack.rc +++ b/WinHTTrack/WinHTTrack.rc @@ -425,22 +425,24 @@ BEGIN EDITTEXT IDC_STATIC_bo1,7,43,232,84,ES_MULTILINE | ES_READONLY | NOT WS_BORDER END -IDD_ProxyId DIALOG 0, 0, 266, 129 +IDD_ProxyId DIALOG 0, 0, 266, 145 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Proxy settings" FONT 8, "MS Sans Serif" BEGIN - EDITTEXT IDC_proxadr,104,8,141,12,ES_AUTOHSCROLL - EDITTEXT IDC_proxport,104,24,28,12,ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_proxlogin,104,56,56,12,ES_AUTOHSCROLL - EDITTEXT IDC_proxpass,104,72,56,12,ES_PASSWORD | ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,208,104,50,14 - PUSHBUTTON "Cancel",IDCANCEL,8,104,50,14 - LTEXT "Proxy address:",IDC_STATIC_adr,8,8,83,10 - LTEXT "Proxy port:",IDC_STATIC_port,8,24,83,10 - LTEXT "Login:",IDC_STATIC_login,16,56,83,10 - LTEXT "Password:",IDC_STATIC_pass,16,72,83,10 - GROUPBOX "Authentication (only if needed)",IDC_STATIC_auth,8,40,248,48 + COMBOBOX IDC_proxytype,104,8,90,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_proxadr,104,24,141,12,ES_AUTOHSCROLL + EDITTEXT IDC_proxport,104,40,28,12,ES_AUTOHSCROLL | ES_NUMBER + EDITTEXT IDC_proxlogin,104,72,56,12,ES_AUTOHSCROLL + EDITTEXT IDC_proxpass,104,88,56,12,ES_PASSWORD | ES_AUTOHSCROLL + DEFPUSHBUTTON "OK",IDOK,208,120,50,14 + PUSHBUTTON "Cancel",IDCANCEL,8,120,50,14 + LTEXT "Proxy type:",IDC_STATIC_ptype,8,10,90,10 + LTEXT "Proxy address:",IDC_STATIC_adr,8,26,90,10 + LTEXT "Proxy port:",IDC_STATIC_port,8,42,90,10 + LTEXT "Login:",IDC_STATIC_login,16,72,83,10 + LTEXT "Password:",IDC_STATIC_pass,16,88,83,10 + GROUPBOX "Authentication (only if needed)",IDC_STATIC_auth,8,56,248,48 END IDD_NewProj DIALOG 0, 0, 322, 181 @@ -494,6 +496,8 @@ BEGIN COMBOBOX IDC_travel2,165,75,130,56,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP LTEXT "Rewrite links: internal / external",IDC_STATIC_travel3,16,92,129,8 COMBOBOX IDC_travel3,16,100,139,56,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + LTEXT "Strip query keys (e.g. sid,ref):",IDC_STATIC_stripquery,165,92,150,8 + EDITTEXT IDC_stripquery,165,102,150,12,ES_AUTOHSCROLL CONTROL "Activate Debugging Mode (winhttrack.log)",IDC_windebug, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,120,242,10 END @@ -516,6 +520,8 @@ BEGIN EDITTEXT IDC_rate,130,95,32,12,ES_AUTOHSCROLL | ES_NUMBER LTEXT "B/s",IDC_STATIC,170,95,17,8 CONTROL "Remove host if low",IDC_rems,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,130,109,183,10 + LTEXT "Pause between files (s):",IDC_STATIC_pausefiles,16,124,110,8 + EDITTEXT IDC_pausefiles,130,122,45,12,ES_AUTOHSCROLL END IDD_OPTION5 DIALOGEX 0, 0, 260, 198 @@ -569,7 +575,7 @@ BEGIN EDITTEXT IDC_accept_language,115,54,180,12,ES_AUTOHSCROLL END -IDD_OPTION1 DIALOG 0, 0, 325, 105 +IDD_OPTION1 DIALOG 0, 0, 325, 150 STYLE DS_SETFONT | WS_CHILD | WS_DISABLED | WS_CAPTION | WS_SYSMENU CAPTION "Links" FONT 8, "MS Sans Serif" @@ -581,6 +587,9 @@ BEGIN CONTROL "Test validity of all links (even external ones)",IDC_testall, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,64,309,10 CONTROL "Get HTML files first!",IDC_htmlfirst,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,85,309,10 + CONTROL "Keep the www. prefix (do not merge www.host with host)",IDC_keepwww,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,101,309,10 + CONTROL "Keep double slashes in URLs",IDC_keepslashes,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,117,309,10 + CONTROL "Keep the original query-string order",IDC_keepqueryorder,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,133,309,10 END IDD_OPTION2 DIALOG 0, 0, 296, 150 @@ -630,6 +639,9 @@ BEGIN CONTROL "URL hacks (join similar URLs)",IDC_urlhack,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,95,237,9 CONTROL "Tolerant requests (for servers)",IDC_toler,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,110,244,9 CONTROL "Force old HTTP/1.0 requests (no 1.1)",IDC_http10,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,125,237,9 + LTEXT "Load cookies from file:",IDC_STATIC_cookiesfile,16,144,120,8 + EDITTEXT IDC_cookiesfile,140,142,96,12,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_cookiesfilebrowse,240,142,16,12 END IDD_OPTION9 DIALOGEX 0, 0, 325, 143 diff --git a/WinHTTrack/cpp_lang.h b/WinHTTrack/cpp_lang.h index eec133d..a1366e5 100644 --- a/WinHTTrack/cpp_lang.h +++ b/WinHTTrack/cpp_lang.h @@ -464,6 +464,25 @@ #define LISTDEF_10 LANGSEL("LISTDEF_10") #define LISTDEF_11 LANGSEL("LISTDEF_11") +/* Strings for options exposed from the engine (post 3.49-2). + The English/translated values live in the engine's lang.def + lang/*.txt; + see the hand-over note. Until those ship, English users fall back to the + .rc captions and other languages show these keys empty (no crash). */ +#define LANG_PROXYTYPE LANGSEL("LANG_PROXYTYPE") +#define LANG_PROXYTYPETIP LANGSEL("LANG_PROXYTYPETIP") +#define LANG_COOKIEFILE LANGSEL("LANG_COOKIEFILE") +#define LANG_COOKIEFILETIP LANGSEL("LANG_COOKIEFILETIP") +#define LANG_PAUSEFILES LANGSEL("LANG_PAUSEFILES") +#define LANG_PAUSEFILESTIP LANGSEL("LANG_PAUSEFILESTIP") +#define LANG_KEEPWWW LANGSEL("LANG_KEEPWWW") +#define LANG_KEEPWWWTIP LANGSEL("LANG_KEEPWWWTIP") +#define LANG_KEEPSLASHES LANGSEL("LANG_KEEPSLASHES") +#define LANG_KEEPSLASHESTIP LANGSEL("LANG_KEEPSLASHESTIP") +#define LANG_KEEPQUERYORDER LANGSEL("LANG_KEEPQUERYORDER") +#define LANG_KEEPQUERYORDERTIP LANGSEL("LANG_KEEPQUERYORDERTIP") +#define LANG_STRIPQUERY LANGSEL("LANG_STRIPQUERY") +#define LANG_STRIPQUERYTIP LANGSEL("LANG_STRIPQUERYTIP") + #endif diff --git a/WinHTTrack/resource.h b/WinHTTrack/resource.h index d2e420a..9131af2 100644 --- a/WinHTTrack/resource.h +++ b/WinHTTrack/resource.h @@ -506,6 +506,18 @@ #define IDC_mime8 1306 #define IDC_other_headers 1306 #define IDC_default_referer 1308 +#define IDC_proxytype 1309 +#define IDC_STATIC_ptype 1310 +#define IDC_cookiesfile 1311 +#define IDC_STATIC_cookiesfile 1312 +#define IDC_pausefiles 1313 +#define IDC_STATIC_pausefiles 1314 +#define IDC_keepwww 1315 +#define IDC_keepslashes 1316 +#define IDC_keepqueryorder 1317 +#define IDC_stripquery 1318 +#define IDC_STATIC_stripquery 1319 +#define IDC_cookiesfilebrowse 1320 #define ID_MENUITEM32771 32771 #define ID_MENUITEM32772 32772 #define ID_EXIT 32772 @@ -577,7 +589,7 @@ #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 247 #define _APS_NEXT_COMMAND_VALUE 32837 -#define _APS_NEXT_CONTROL_VALUE 1309 +#define _APS_NEXT_CONTROL_VALUE 1321 #define _APS_NEXT_SYMED_VALUE 108 #endif #endif