-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
100 lines (83 loc) · 2.94 KB
/
main.cpp
File metadata and controls
100 lines (83 loc) · 2.94 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include "source/VideoDownloader.h"
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int choice = 0, breakDef = 1, fchoice=0;
char isContinue;
void mp4Download() {
string videoUrl;
cout << "\nMP4: YouTube URL for the video you want to download: ";
cin >> videoUrl;
cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - - -" << endl;
cout << "\t1.\t .mkv" << endl;
cout << "\t2.\t .mp4" << endl;
cout << "\t3.\t .webm" << endl;
cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - - -" << endl;
cout << "\nMP4: Please Select an format (Default is .mp4) : ";
string input;
getline(cin, input);
downloadVideo(videoUrl, choice, fchoice);
}
void mp3Download() {
string videoUrl;
cout << "\nMP3: YouTube URL for the audio you want to download: ";
cin >> videoUrl;
downloadVideo(videoUrl, choice);
}
void thumbnailDownload() {
string videoUrl;
cout << "\nThumbnail: Youtube URL for the Thumbnail you want to download: ";
cin >> videoUrl;
downloadVideo(videoUrl, choice);
}
void beginWrite() {
cout << " ______ __ ____ __ __ " << endl;
cout << " / ____/___ ____ _________ / /__ / __ \\____ _ ______ / /___ ____ _____/ /__ _____ " << endl;
cout << " / / / __ \\/ __ \\/ ___/ __ \\/ / _ \\ / / / / __ \\ | /| / / __ \\/ / __ \\/ __ `/ __ / _ \\/ ___/ " << endl;
cout << "/ /___/ /_/ / / / (__ ) /_/ / / __/ / /_/ / /_/ / |/ |/ / / / / / /_/ / /_/ / /_/ / __/ / " << endl;
cout << "\\____/\\____/_/ /_/____/\\____/_/\\___/ /_____\\/____/|__/|__/_/ /_/_/\\____/\\__,_/\\__,_/\\___/_/ " << endl;
cout << "\nPowered by @p0unter & @Mal1koRe1ss" << endl << endl;
cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - - -" << endl;
cout << "\t1.\t Youtube MP4 Download" << endl;
cout << "\t2.\t Youtube MP3 Download" << endl;
cout << "\t3.\t Youtube Thumbnail Download" << endl;
cout << "- - - - - - - - - - - - - - - - - - - - - - - - - - - -" << endl;
}
void _isContinue(string _message) {
cout << _message;
cin >> isContinue;
if (isContinue == 'n' || isContinue == 'N') {
breakDef = 0;
}
}
int main() {
while (1)
{
system("cls");
beginWrite();
cout << "Your choice: ";
cin >> choice;
switch (choice)
{
case 1:
mp4Download();
break;
case 2:
mp3Download();
break;
case 3:
thumbnailDownload();
break;
default:
_isContinue("Please choose a correct option. Did you conutinue? (y/n): ");
}
_isContinue("Did you want to continue? (y/n): ");
if (breakDef == 0) {
break;
}
}
cout << "Program finished!" << endl;
system("pause");
return 0;
}