mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-02 05:52:31 +01:00
Add option to disable GUI login
Adds option --disable-login-gui which is used to disable GUI login when reCAPTCHA is encountered on login form. Useful when downloader is compiled with GUI support but user is using it through SSH without X forwarding.
This commit is contained in:
parent
a8d9d466c9
commit
ea0ec2a9bd
@ -231,6 +231,9 @@ class Config
|
||||
bool bReport;
|
||||
bool bRespectUmask;
|
||||
bool bPlatformDetection;
|
||||
#ifdef USE_QT_GUI_LOGIN
|
||||
bool bDisableLoginGUI;
|
||||
#endif
|
||||
|
||||
// Cache
|
||||
bool bUseCache;
|
||||
|
3
main.cpp
3
main.cpp
@ -247,6 +247,9 @@ int main(int argc, char *argv[])
|
||||
("lowspeed-timeout", bpo::value<long int>(&Globals::globalConfig.curlConf.iLowSpeedTimeout)->default_value(30), "Set time in number seconds that the transfer speed should be below the rate set with --lowspeed-rate for it to considered too slow and aborted")
|
||||
("lowspeed-rate", bpo::value<long int>(&Globals::globalConfig.curlConf.iLowSpeedTimeoutRate)->default_value(200), "Set average transfer speed in bytes per second that the transfer should be below during time specified with --lowspeed-timeout for it to be considered too slow and aborted")
|
||||
("include-hidden-products", bpo::value<bool>(&Globals::globalConfig.bIncludeHiddenProducts)->zero_tokens()->default_value(false), "Include games that have been set hidden in account page")
|
||||
#ifdef USE_QT_GUI_LOGIN
|
||||
("disable-login-gui", bpo::value<bool>(&Globals::globalConfig.bDisableLoginGUI)->zero_tokens()->default_value(false), "Disable login GUI when encountering reCAPTCHA on login form.\nUseful when downloader is compiled with GUI support but you are using it through SSH without X forwarding")
|
||||
#endif
|
||||
;
|
||||
// Options read from config file
|
||||
options_cfg_only.add_options()
|
||||
|
@ -316,6 +316,12 @@ int Website::Login(const std::string& email, const std::string& password)
|
||||
<< "Try to login later or compile LGOGDownloader with -DUSE_QT_GUI=ON" << std::endl;
|
||||
return res = 0;
|
||||
#else
|
||||
if (Globals::globalConfig.bDisableLoginGUI)
|
||||
{
|
||||
std::cout << "Login form contains reCAPTCHA but GUI login is disabled." << std::endl
|
||||
<< "Enable GUI login or try to login later." << std::endl;
|
||||
return res = 0;
|
||||
}
|
||||
GuiLogin gl;
|
||||
gl.Login();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user