-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloader.js
More file actions
91 lines (74 loc) · 1.87 KB
/
loader.js
File metadata and controls
91 lines (74 loc) · 1.87 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
/*const ora = import('./node_modules/ora/index').then(ora => {
console.log(ora)
var spinner = ora().start();
spinner = ora().start();
setTimeout(() => {
spinner.color = 'red';
spinner.text = 'Loading rainbows';
spinner.spinner = 'pong'
}, 1000);
})
*/
const prompts = require('prompts');
prompts.override(require('yargs').argv);
module.exports = {
link: function link(){
(async () => {
const response = await prompts([
{
type: 'text',
name: 'link',
message: `Please enter your YouTube Downloadable media link`
},
]);
return response.link
})();},
fileformatin: async function fileformatin(){
const response = await prompts([
{
type: 'select',
name: 'fileformat',
message: 'Please choose the file format in which you want the file to be saved',
choices: [
{ title: 'MP3', value: 'mp3' },
{ title: 'MP4', value: 'mp4' },
{ title: 'MKV', value: 'mkv' },
{ title: 'AAC', value: 'aac' },
{ title: 'FLAC', value: 'flac' },
{ title: 'WAV', value: 'wav' },
],
}
]);
return response.fileformat
},
qualityprop: async function qualityprop(pathf){
var response;
if(pathf === 1){
response = await prompts([
{
type: 'select',
name: 'quality',
message: 'Please insert the quality of which you want the file to be saved',
choices: [
{ title: 'High', value: 'high' },
{ title: 'Greatest', value: 'greatest' },
],
}
]);
}
else if(pathf === 0){
response = await prompts([
{
type: 'select',
name: 'quality',
message: 'Please insert the quality of which you want the file to be saved',
choices: [
{ title: 'High', value: 'high' },
{ title: 'Low', value: 'low' },
],
}
]);
}
return response.quality
}
}