|
|
|
@ -57,9 +57,8 @@ Download(const string& address, const string& option) {
|
|
|
|
|
}
|
|
|
|
|
CURL* curl = curl_easy_init();
|
|
|
|
|
if (curl) {
|
|
|
|
|
|
|
|
|
|
CURLcode res;
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_URL, address.c_str());
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_URL, (option == "" || option == "-verbose") ? address.c_str() : option.c_str());
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteData);
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
|
|
|
|
|
if (address == "-verbose" || option == "-verbose") {
|
|
|
|
@ -85,8 +84,14 @@ int main(int argc, char* argv[]) {
|
|
|
|
|
double MaxCount = 0;
|
|
|
|
|
Input in;
|
|
|
|
|
if (argc > 1) {
|
|
|
|
|
if (argc == 2) {
|
|
|
|
|
in = Download(argv[1], "");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
in = Download(argv[1], argv[2]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
in = InputData(cin, true);
|
|
|
|
|
}
|
|
|
|
|