-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathtest.js
211 lines (194 loc) · 7.54 KB
/
test.js
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
const alltomp3 = require('.');
const util = require('util');
// alltomp3.spotifyToken().then(o => console.log(o)).catch(e => console.log(e));
// alltomp3.getPlaylistTitlesInfos('https://open.spotify.com/user/spotify_france/playlist/1h4ZB3lW7lD5RmfE6DIRRI').then(d => console.log(util.inspect(d, {depth: 2})));
// alltomp3.getSpotifyTrackInfos('1NOPjzkLIEUM6mwGxCm2mM').then(i => console.log(i));
// alltomp3.configEyeD3('/Users/ntag/Projets/alltomp3/alltomp3-app/bin/eyeD3/bin/eyeD3', '/Users/ntag/Projets/alltomp3/alltomp3-app/bin/eyeD3/build/lib');
// alltomp3.getInfosWithYoutubeDl('https://soundcloud.com/taylorythm/coda', function(infos) {
// console.log(infos);
// });
// alltomp3.getInfosWithYoutubeDl('https://www.youtube.com/watch?v=e74VMNgARvY', function(infos) {
// console.log(infos);
// });
// not working URL https://www.youtube.com/watch?v=yzi-7G2u89g
// var dl = alltomp3.findAndDownload("mika elle me dit", "./", () => {}, true);
// dl.on("download", function (infos) {
// process.stdout.cursorTo(0);
// process.stdout.clearLine(1);
// process.stdout.write(infos.progress + "%");
// });
// dl.on("download-end", function () {
// console.log("Download end");
// });
// dl.on("convert", function (infos) {
// process.stdout.cursorTo(0);
// process.stdout.clearLine(1);
// process.stdout.write(infos.progress + "%");
// });
// dl.on("error", function (e) {
// console.log("Error la la", util.inspect(e));
// });
// alltomp3.getInfosWithYoutubeDl('https://www.youtube.com/watch?v=sX9s-bSOYxk').then(console.log);
// const dl = alltomp3.downloadWithYoutubeDl('https://www.youtube.com/watch?v=sX9s-bSOYxk', 'test.mp3');
// dl.on('download-progress', console.log);
// dl.once('download-end', console.log);
// dl.on('error', console.error);
// alltomp3.guessTrackFromString('Imagine Dragons - On Top of the World - Lyrics', false, false, true);
// alltomp3.guessTrackFromString('C2C - Happy Ft. D.Martin', false, false, true);
// alltomp3.guessTrackFromString('David Guetta - Bang My Head (Official Video) feat Sia & Fetty Wap', false, false, true);
// alltomp3.guessTrackFromString('David Guetta - Hey Mama (Official Video) ft Nicki Minaj, Bebe Rexha & Afrojack', false, false, true);
// alltomp3.retrieveTrackInformations('On Top of the World', 'Imagine Dragons').then(function (infos) {
// console.log("Infos: ", infos);
// });
// alltomp3.guessTrackFromFile('./test.mp3').then(function (infos) {
// return alltomp3.retrieveTrackInformations(infos.title, infos.artistName);
// }).then(function (infos) {
// console.log(infos);
// alltomp3.tagFile('./test.mp3', infos);
// });
// alltomp3.downloadAndTagSingleURL(
// 'https://www.youtube.com/watch?v=sX9s-bSOYxk',
// './',
// function (infos) {
// console.log(infos);
// },
// undefined,
// true,
// );
// var title = "hide and seek imogen heap";
// alltomp3.findVideo(title).then(function(results) {
// var dl = alltomp3.downloadAndTagSingleURL(results[0].url, function(infos) {
// console.log("FINI ", infos);
// }, title);
// dl.on('download', function(infos) {
// process.stdout.cursorTo(0);
// process.stdout.clearLine(1);
// process.stdout.write(infos.progress + '%');
// });
// dl.on('download-end', function() {
// console.log('Download end');
// });
// dl.on('convert', function(infos) {
// process.stdout.cursorTo(0);
// process.stdout.clearLine(1);
// process.stdout.write(infos.progress + '%');
// });
// dl.on('convert-end', function() {
// console.log('Convert end');
// });
// dl.on('infos', function(infos) {
// console.log('Got infos: ', infos);
// });
// });
// var dl = alltomp3.downloadAndTagSingleURL("https://soundcloud.com/user-523607375/sets/john-legend-start-a-fire-la-la", 'mp3/', function(infos) {
// console.log("FINI ", infos);
// });
// dl.on('download', function(infos) {
// process.stdout.cursorTo(0);
// process.stdout.clearLine(1);
// process.stdout.write(infos.progress + '%');
// });
// dl.on('download-end', function() {
// console.log('Download end');
// });
// dl.on('convert', function(infos) {
// process.stdout.cursorTo(0);
// process.stdout.clearLine(1);
// process.stdout.write(infos.progress + '%');
// });
// dl.on('convert-end', function() {
// console.log('Convert end');
// });
// dl.on('infos', function(infos) {
// console.log('Got infos: ', infos);
// });
var dl = alltomp3.findAndDownload('imagine dragons on top of the world', './mp3/', function (infos) {
console.log("It's finished: ", infos);
});
dl.on('search-end', function () {
console.log('Search end');
});
dl.on('download', function (infos) {
process.stdout.cursorTo(0);
process.stdout.clearLine(1);
process.stdout.write(infos.progress + '%');
});
dl.on('download-end', function () {
console.log('', 'Download end');
});
dl.on('convert', function (infos) {
process.stdout.cursorTo(0);
process.stdout.clearLine(1);
process.stdout.write(infos.progress + '%');
});
dl.on('convert-end', function () {
console.log('', 'Convert end');
});
dl.on('infos', function (infos) {
console.log('New infos received: ', infos);
});
// alltomp3.guessTrackFromString('Imagine Dragons - On Top of the World - Lyrics').then(function(infos) {
// console.log(infos);
// });
// alltomp3.guessTrackFromString('C2C - Happy Ft. D.Martin').then(function(infos) {
// console.log(infos);
// });
// alltomp3.guessTrackFromString('David Guetta - Bang My Head (Official Video) feat Sia & Fetty Wap').then(function(infos) {
// console.log(infos);
// });
// alltomp3.guessTrackFromString('David Guetta - Hey Mama (Official Video) ft Nicki Minaj, Bebe Rexha & Afrojack').then(function(infos) {
// console.log(infos);
// });
// alltomp3.guessTrackFromString('hans zimmer no time for caution').then(function(infos) {
// console.log(infos);
// });
// alltomp3.findLyrics('Radioactive', 'Imagine Dragons').then(function (lyrics) {
// console.log(lyrics);
// }).catch(function() {
// console.log('No lyrics');
// });
// alltomp3.getURLsInPlaylist('https://soundcloud.com/20syl/sets/20syl-remixes-2016').then(function(items) {
// console.log(items);
// });
// alltomp3.getTracksInPlaylist('http://www.deezer.com/album/11111444').then(function(items) {
// console.log(items);
// });
// var urls;
// var dl = alltomp3.downloadPlaylist("https://open.spotify.com/album/2tVnLYqhc0iGdSCLxoaLjD", "./mp3/", function (urls) {
// console.log("It's finished: ", urls);
// }, 8);
// dl.on('search-end', function() {
// console.log('Search end');
// });
// dl.on('download', function(index) {
// process.stdout.cursorTo(0);
// process.stdout.clearLine(1);
// process.stdout.write(urls.items[index].progress.download.progress + '%');
// });
// dl.on('download-end', function() {
// console.log('', 'Download end');
// });
// dl.on('convert', function(index) {
// process.stdout.cursorTo(0);
// process.stdout.clearLine(1);
// process.stdout.write(urls.items[index].progress.convert.progress + '%');
// });
// dl.on('convert-end', function(index) {
// console.log('', 'Convert end');
// });
// dl.on('error', function(index) {
// console.log('', 'Error with ' + index);
// });
// dl.on('infos', function(index) {
// // console.log('New infos received: ', infos);
// });
// dl.on('playlist-infos', function(urlss) {
// urls = urlss;
// console.log('URLs received: ', urlss);
// });
// dl.on('begin-url', function(index) {
// console.log('Begin: ', index);
// });
// dl.on('end-url', function(index) {
// console.log('End: ', index);
// });