Delete old cookies when using --login

This commit is contained in:
Sude 2015-07-06 06:47:09 +03:00
parent 011cd2c116
commit 6e5a0870e8

View File

@ -30,6 +30,9 @@ namespace bptime = boost::posix_time;
Downloader::Downloader(Config &conf) Downloader::Downloader(Config &conf)
{ {
this->config = conf; this->config = conf;
if (config.bLogin && boost::filesystem::exists(config.sCookiePath))
if (!boost::filesystem::remove(config.sCookiePath))
std::cout << "Failed to delete " << config.sCookiePath << std::endl;
} }
Downloader::~Downloader() Downloader::~Downloader()