diff --git a/src/api.cpp b/src/api.cpp index 9b3b237..f82c3b7 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -43,7 +43,6 @@ API::API(const std::string& token, const std::string& secret) curl_easy_setopt(curlhandle, CURLOPT_FAILONERROR, true); this->error = false; - this->getAPIConfig(); this->config.oauth_token = token; this->config.oauth_secret = secret; } @@ -51,6 +50,7 @@ API::API(const std::string& token, const std::string& secret) int API::init() { int res = 0; + this->getAPIConfig(); // Check if we already have token and secret if (!this->config.oauth_token.empty() && !this->config.oauth_secret.empty()) diff --git a/src/downloader.cpp b/src/downloader.cpp index c01407d..0fa9b3c 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -71,7 +71,8 @@ int Downloader::init() progressbar = new ProgressBar(!config.bNoUnicode, !config.bNoColor); - if (config.bLogin || !gogAPI->init()) + bool bInitOK = gogAPI->init(); + if (config.bLogin || !bInitOK) return this->login(); if (!config.bNoCover && config.bDownload && !config.bUpdateCheck)