-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
61 lines (55 loc) · 2.37 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <iostream>
#include <string>
#include "api/api_management.h"
#include "gofile/gofile_uploader.h"
#include "pixeldrain/pixeldrain_uploader.h"
void printBanner() {
std::cout << R"(
_______ _ _______ _ _ _ _
(_______) | | (_______) | | | | | | | |
_ ____ ___ | | _ _____ ___ ____ ____ ____ | | | | ____ | | ___ ____ _ | | ____ ____
| | / _ | /___)| | / )| ___) / _ \ / ___) / ___) / _ ) | | | || _ \ | | / _ \ / _ | / || | / _ ) / ___)
| |_____ ( ( | ||___ || |< ( | | | |_| || | ( (___ ( (/ / | |___| || | | || || |_| |( ( | |( (_| |( (/ / | |
\______) \_||_|(___/ |_| \_)|_| \___/ |_| \____) \____) \______|| ||_/ |_| \___/ \_||_| \____| \____)|_|
|_|
)";
}
int main(int argc, char* argv[]) {
printBanner();
std::cout << "-Open Source Implent of Task Force Uploader-" << std::endl;
if (argc < 3) {
std::cerr << "Usage: " << argv[0] << " [set pd_api <api_key> | upload <service> <file_path>]" << std::endl;
return 1;
}
std::string command = argv[1];
if (command == "upload") {
if (argc < 4) {
std::cerr << "Usage: " << argv[0] << " upload <service> <file_path>" << std::endl;
return 1;
}
std::string service = argv[2];
std::string file_path = argv[3];
if (service == "gofile") {
GofileUploader uploader;
if (uploader.upload(file_path)) {
std::cout << "File uploaded successfully." << std::endl;
} else {
std::cerr << "Failed to upload file." << std::endl;
}
} else if (service == "pixeldrain") {
PixelDrainUploader uploader;
if (uploader.upload(file_path)) {
std::cout << "File uploaded successfully." << std::endl;
} else {
std::cerr << "Failed to upload file." << std::endl;
}
} else {
std::cerr << "Unknown service." << std::endl;
return 1;
}
} else {
std::cerr << "Unknown command." << std::endl;
return 1;
}
return 0;
}