Git Product home page Git Product logo

alltomp3's Introduction

alltomp3 CircleCI Status

Download and convert an online video in MP3 with tags.

Provide several useful methods to get information about a song or to guess the track matching a YouTube video.

Requirements

Installation

npm install alltomp3
const alltomp3 = require('alltomp3');

const dl = alltomp3.findAndDownload("imagine dragons on top of the world", "./", (infos) => {
  console.log("It's finished: ", infos);
});

// {
//   infos: {
//     title: 'On Top Of The World',
//     artistName: 'Imagine Dragons',
//     deezerId: 63510362,
//     itunesId: 555694746,
//     position: 5,
//     duration: 192,
//     deezerAlbum: 6240279,
//     discNumber: 1,
//     album: 'Night Visions',
//     releaseDate: '2012-01-01',
//     nbTracks: 13,
//     genreId: 132,
//     cover: 'http://e-cdn-images.deezer.com/images/cover/7e8314f4280cffde363547a495a260bc/600x600-000000-80-0-0.jpg',
//     genre: 'Pop'
//   },
//   file: './Imagine Dragons - On Top Of The World.mp3'
// }

Methods

Each time a trackInfos object is referred, it corresponds to a JavaScript object with the following fields:

downloadAndTagSingleURL(url, outputFolder, callback, title, verbose)

Download, convert and tag the video from url. Does not work with playlists, only with single videos. The callback function takes one argument, an object containing the following fields:

  • file: the name of the output file
  • infos: a trackInfos object

If you are looking for specific query and you think url correspond to the song you want, you can help the identification and tags with the title argument.

Emit

'download': the download is in progress

This event is emitted during the download, with an object containing:

  • progress: the percentage of the download
'download-end': the download end
'convert': the conversion is in progress

This event is emitted during the conversion, with an object containing:

  • progress: the percentage of the conversion
'infos': infos about the track

This event is emitted every time new information about the track are found, with a trackInfos object.

'end': everything is finished

This event is emitted at the end (when the file has been downloaded, converted and tagged) with an object containing the following fields:

  • file: the name of the output file
  • infos: a trackInfos object

findAndDownload(query, outputFolder, callback, verbose)

Find a YouTube music video matching the query, download and tag it. The callback function takes two arguments, first is an object containing the following fields:

  • file: the name of the output file
  • infos: a trackInfos object

And second is fill with an error message if any.

Emit

'search-end': the search end
'download': the download is in progress

This event is emitted during the download, with an object containing:

  • progress: the percentage of the download
'download-end': the download end
'convert': the conversion is in progress

This event is emitted during the conversion, with an object containing:

  • progress: the percentage of the conversion
'infos': infos about the track

This event is emitted every time new information about the track are found, with a trackInfos object.

const alltomp3 = require('alltomp3');

const dl = alltomp3.findAndDownload("imagine dragons on top of the world", (infos) => {
  console.log("It's finished: ", infos);
});
dl.on('search-end', () => {
  console.log('Search end');
});
dl.on('download', (infos) => {
  process.stdout.cursorTo(0);
  process.stdout.clearLine(1);
  process.stdout.write(infos.progress + '%');
});
dl.on('download-end', () => {
  console.log('', 'Download end');
});
dl.on('convert', (infos) => {
  process.stdout.cursorTo(0);
  process.stdout.clearLine(1);
  process.stdout.write(infos.progress + '%');
});
dl.on('convert-end', () => {
  console.log('', 'Convert end');
});
dl.on('infos', (infos) => {
  console.log('New infos received: ', infos);
});

findVideo(query, verbose)

Search on YouTube the video which should have an audio corresponding to the query. It works best if the query contains the artist and the title of the track.

Returns a Promise which is resolved with an ordered array of objects containing:

  • id: YouTube videoId
  • url: URL of the video
  • title: title of the video
  • hd (boolean): true if the quality >= 720p
  • duration: duration in seconds
  • views: number of views
  • score: a high score indicate a high probability of matching with the query. Can be negative
const alltomp3 = require('alltomp3');

alltomp3.findVideo("imagine dragons on top of the world").then((results) => {
  console.log(results);
});

// [ { id: 'g8PrTzLaLHc',
//     url: 'https://www.youtube.com/watch?v=g8PrTzLaLHc',
//     title: 'Imagine Dragons - On Top of the World -',
//     hd: false,
//     duration: 191,
//     views: '24255381',
//     score: -42.113922489729575 },
//   { id: 'e74VMNgARvY',
//     url: 'https://www.youtube.com/watch?v=e74VMNgARvY',
//     title: 'Imagine Dragons - On Top of the World',
//     hd: true,
//     duration: 196,
//     views: '1695902',
//     score: -62.604333945991385 },
//     ....
// ]

retrieveTrackInformations(title, artistName, exact, verbose)

Retrieve information on the track corresponding to title and artistName. exact is a boolean indicating if the terms can change a little (true by default).

Returns a Promise with a trackInfos object.

guessTrackFromString(query)

Try to find a title and an artist matching the query. Works especially well with YouTube video names.

Returns a Promise with an object containing:

  • title
  • artistName
const alltomp3 = require('alltomp3');

const l = (infos) => {
  console.log(infos);
};

alltomp3.guessTrackFromString('Imagine Dragons - On Top of the World - Lyrics').then(l);
alltomp3.guessTrackFromString('C2C - Happy Ft. D.Martin').then(l);
alltomp3.guessTrackFromString('David Guetta - Bang My Head (Official Video) feat Sia & Fetty Wap').then(l);
alltomp3.guessTrackFromString('David Guetta - Hey Mama (Official Video) ft Nicki Minaj, Bebe Rexha & Afrojack').then(l);
alltomp3.guessTrackFromString('hans zimmer no time for caution').then(l);

// { title: 'On Top Of The World', artistName: 'Imagine Dragons' }
// { title: 'Happy', artistName: 'C2C' }
// { title: 'Bang my Head (feat. Sia & Fetty Wap)', artistName: 'David Guetta' }
// { title: 'Hey Mama', artistName: 'David Guetta' }
// { title: 'No Time for Caution', artistName: 'Hans Zimmer' }

findLyrics(title, artistName)

Search lyrics for a song.

Returns a Promise with a string.

const alltomp3 = require('alltomp3');

alltomp3.findLyrics('Radioactive', 'Imagine Dragons').then((lyrics) => {
  console.log(lyrics);
}).catch(() => {
  console.log('No lyrics');
});

downloadPlaylistWithURLs(url, outputFolder, callback, maxSimultaneous)

Download the playlist url containing URLs (aka YouTube or SoundCloud playlist), convert and tag it in outputFolder. maxSimultaneous is the maximum number of parallel conversions (default to 1).

Emit

'list': the playlist description has been received

This event is emitted when information about the playlist has been received, with an array(objects) with the following keys:

  • url: URL of the video/track
  • title: title of the video/track
  • image: image of the video/track
  • progress: object with:
    • download: progression of the download
    • convert: progression of the conversion
  • infos: trackInfos object
  • file: path to the final MP3

This array is updated as the process progress.

'begin-url': a new item is processed

This event is emitted when a new item is now processed, with an integer index indicating the corresponding track.

'download': the download of an item is in progress

This event is emitted during the download, with an integer index indicating the corresponding track.

'download-end': the download end

This event is emitted when the download of an item end, with an integer index indicating the corresponding track.

'convert': the conversion is in progress

This event is emitted during the conversion, with an integer index indicating the corresponding track.

'infos': infos about the track

This event is emitted every time new information about a track is received, with an integer index indicating the corresponding track.

'end-url': the processing of an item is finished

This event is emitted when the processing of an item is finished, with an integer index indicating the corresponding track.

'end': everything is finished

This event is emitted at the end, when all items have been processed, with the list array.

downloadPlaylistWithTitles(url, outputFolder, callback, maxSimultaneous)

Download the playlist url containing titles (aka Deezer Playlist or Deezer Album), find best matching video on YouTube, convert and tag it in outputFolder. maxSimultaneous is the maximum number of parallel conversions (default to 1).

Emit

'list': the playlist description has been received

This event is emitted when information about the playlist has been received, with an array(objects) with the following keys:

  • title: title of the track
  • artistName: artist of the track
  • cover: cover of the track
  • progress: object with:
    • download: progression of the download
    • convert: progression of the conversion
  • infos: trackInfos object
  • file: path to the final MP3

This array is updated as the process progress.

'begin-url': a new item is processed

This event is emitted when a new item is now processed, with an integer index indicating the corresponding track.

'search-end': the search end

This event is emitted when the search of YouTube videos for an item (based on the title) end, with an integer index indicating the corresponding track.

'download': the download of an item is in progress

This event is emitted during the download, with an integer index indicating the corresponding track.

'download-end': the download end

This event is emitted when the download of an item end, with an integer index indicating the corresponding track.

'convert': the conversion is in progress

This event is emitted during the conversion, with an integer index indicating the corresponding track.

'infos': infos about the track

This event is emitted every time new information about a track is received, with an integer index indicating the corresponding track.

'end-url': the processing of an item is finished

This event is emitted when the processing of an item is finished, with an integer index indicating the corresponding track.

'end': everything is finished

This event is emitted at the end, when all items have been processed, with the list array.

alltomp3's People

Contributors

andrasore avatar blissland avatar nathan818fr avatar ntag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alltomp3's Issues

Unable to locate package alltomp3

I've been having a real battle with alltomp3 for a while now. I'll make a long story short and provide the details for the current case. I recently (today) tried to install it again and I'm getting an error "unable to locate package" at the end.

(Ubuntu 17.10)

kymus@Sanxing:~$ curl -s https://packagecloud.io/install/repositories/AllToMP3/alltomp3/script.deb.sh | sudo bash
Detected operating system as Ubuntu/artful.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/AllToMP3_alltomp3.list...done.
Importing packagecloud gpg key... done.
Running apt-get update... done.

The repository is setup! You can now install packages.
kymus@Sanxing:~$ sudo apt-get install alltomp3
Reading package lists... Done
Building dependency tree      
Reading state information... Done
E: Unable to locate package alltomp3
kymus@Sanxing:~$ cd Downloads
kymus@Sanxing:~/Downloads$ sudo apt-get install alltomp3
Reading package lists... Done
Building dependency tree      
Reading state information... Done
E: Unable to locate package alltomp3
kymus@Sanxing:~/Downloads$ sudo install script.deb.sh
install: missing destination file operand after 'script.deb.sh'
Try 'install --help' for more information.
kymus@Sanxing:~/Downloads$ cd
kymus@Sanxing:~$ curl -s https://packagecloud.io/install/repositories/AllToMP3/alltomp3/script.deb.sh | sudo bash
Detected operating system as Ubuntu/artful.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/AllToMP3_alltomp3.list...done.
Importing packagecloud gpg key... done.
Running apt-get update... done.

The repository is setup! You can now install packages.
kymus@Sanxing:~$ sudo apt-get install alltomp3
Reading package lists... Done
Building dependency tree      
Reading state information... Done
E: Unable to locate package alltomp3
kymus@Sanxing:~$

Sorry if there is something obvious I'm not doing right; I'm still getting the hang of installation through the terminal >_<.

Inconsistent findLyrics calls

When calling findLyrics several times in a row, results may differ since it gives the lyrics found in the fastest responding website as per this code :

alltomp3/index.js

Lines 192 to 201 in 7129f17

promises.push(reqWikia);
promises.push(reqParolesNet);
promises.push(reqLyricsMania1);
promises.push(reqLyricsMania2);
promises.push(reqLyricsMania3);
promises.push(reqSweetLyrics);
return Promise.any(promises).then((lyrics) => {
return lyrics;
});

This might be the best for speed, but not for consistency as one will get different lyrics on different calls.
The code above could be replaced with something like:

return reqWikia
    .catch(() => reqParolesNet)
    .catch(() => reqLyricsMania1)
    .catch(() => reqLyricsMania2)
    .catch(() => reqLyricsMania3)
    .catch(() => reqSweetLyrics)

Requests would still be made in parallel but that would give a preference order to the websites that are requested (in this example first reqWikia, then reqParolesNet, etc...).

UI crashing still downloading

Hey, i have a problem when adding a bunch of large playlists from spotify.
The UI goes blank but its still downloading but the memory usage keeps increasing and increasing, its at +4gb memory usage now. If I close it the queue is gone and when I add the playlist again it starts downloading the same songs again.

Is there a workaround for that ?

TypeError: Cannot set property 'progress' of undefined

[AT3] suggestions shaed
[AT3] downloadPlaylist { folder: '/mnt/XXX/mp3/',
  id: 'Z8Qukjayjj',
  url: 'https://www.deezer.com/album/98192272' }
[AT3] event begin-url 0
[AT3] event begin-url 1
Unhandled rejection TypeError: Cannot set property 'progress' of undefined
    at downloadNext (/opt/AllToMP3/resources/app/node_modules/alltomp3/index.js:2052:27)
    at at3.getPlaylistTitlesInfos.then (/opt/AllToMP3/resources/app/node_modules/alltomp3/index.js:2030:7)
    at tryCatcher (/opt/AllToMP3/resources/app/node_modules/request-promise/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/opt/AllToMP3/resources/app/node_modules/request-promise/node_modules/bluebird/js/main/promise.js:510:31)
    at Promise._settlePromiseAt (/opt/AllToMP3/resources/app/node_modules/request-promise/node_modules/bluebird/js/main/promise.js:584:18)
    at Promise._settlePromises (/opt/AllToMP3/resources/app/node_modules/request-promise/node_modules/bluebird/js/main/promise.js:700:14)
    at Async._drainQueue (/opt/AllToMP3/resources/app/node_modules/request-promise/node_modules/bluebird/js/main/async.js:123:16)
    at Async._drainQueues (/opt/AllToMP3/resources/app/node_modules/request-promise/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/opt/AllToMP3/resources/app/node_modules/request-promise/node_modules/bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)
[AT3] event error Error: 0
    at at3.findVideoForSong.then.catch (/opt/AllToMP3/resources/app/node_modules/alltomp3/index.js:2145:31)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:1572) UnhandledPromiseRejectionWarning: TypeError: Cannot set property 'progress' of undefined
    at downloadNext (/opt/AllToMP3/resources/app/node_modules/alltomp3/index.js:2052:27)
    at at3.findVideoForSong.then.catch (/opt/AllToMP3/resources/app/node_modules/alltomp3/index.js:2147:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:1572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1572) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[AT3] event error Error: 1
    at at3.findVideoForSong.then.catch (/opt/AllToMP3/resources/app/node_modules/alltomp3/index.js:2145:31)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Problem with first test

When I try to run the first line of the README. This error occurs. Any clue? Thanks

> var dl = alltomp3.findAndDownload("imagine dragons on top of the world", "./", function (infos) {
...     console.log("It's finished: ", infos);
... });
TypeError: object is not a function
    at Object.at3.findAndDownload (/home/nicolas/alltomp3/alltomp3/index.js:1164:29)
    at repl:1:19
    at REPLServer.self.eval (repl.js:110:21)
    at repl.js:249:20
    at REPLServer.self.eval (repl.js:122:7)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
    at Interface._line (readline.js:531:8)
    at Interface._ttyWrite (readline.js:760:14)
    at ReadStream.onkeypress (readline.js:99:10)
    at ReadStream.EventEmitter.emit (events.js:98:17)
    at emitKey (readline.js:1095:12)
    at ReadStream.onData (readline.js:840:14)
    at ReadStream.EventEmitter.emit (events.js:95:17)
    at ReadStream.<anonymous> (_stream_readable.js:746:14)
    at ReadStream.EventEmitter.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:408:10)
    at emitReadable (_stream_readable.js:404:5)
    at readableAddChunk (_stream_readable.js:165:9)
    at ReadStream.Readable.push (_stream_readable.js:127:10)
    at TTY.onread (net.js:526:21)

Does not run on runkit

i tried installing it and using it on my device but got many errors
so i decided to try it on runkit but it didn't work either, doesn't work
when i tried using glitch as well
there's surely something off

not giving tags to downloaded file after download

Hi i get folowing error when i try to run the example code
Uncaught Exception: Error: spawn fpcalc ENOENT at exports._errnoException (util.js:1022:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32) at onErrorNT (internal/child_process.js:359:16) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)

when i look into the folder the mp3 is there but not with the tags

Unable to locate package alltomp3

wagner@wagner-H14CU01 ~ $ curl -s https://packagecloud.io/install/repositories/AllToMP3/alltomp3/script.deb.sh | sudo bash
[sudo] senha para wagner:
Sinto muito, tente novamente.
[sudo] senha para wagner:
Detected operating system as LinuxMint/sylvia.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/AllToMP3_alltomp3.list...done.
Importing packagecloud gpg key... done.
Running apt-get update... done.

The repository is setup! You can now install packages.
wagner@wagner-H14CU01 ~ $ sudo apt-get install alltomp3[sudo] senha para wagner:
Lendo listas de pacotes... Pronto
Construindo árvore de dependências
Lendo informação de estado... Pronto
E: Impossível encontrar o pacote alltomp3
wagner@wagner-H14CU01 ~ $

Version `ZLIB_1.2.9' not found on opening

I am getting the following error on trying to run it on Ubuntu 16.04.

A JavaScript error occurred in the main process
Uncaught Exception:
Error: /lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /opt/AllToMP3/resources/app/node_modules/alltomp3/node_modules/sharp/build/Release/../../vendor/lib/libpng16.so.16)
    at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:172:20)
    at Object.Module._extensions..node (module.js:598:18)
    at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:172:20)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/AllToMP3/resources/app/node_modules/alltomp3/node_modules/sharp/lib/constructor.js:10:15)
    at Object.<anonymous> (/opt/AllToMP3/resources/app/node_modules/alltomp3/node_modules/sharp/lib/constructor.js:255:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/AllToMP3/resources/app/node_modules/alltomp3/node_modules/sharp/lib/index.js:3:15)
    at Object.<anonymous> (/opt/AllToMP3/resources/app/node_modules/alltomp3/node_modules/sharp/lib/index.js:15:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/opt/AllToMP3/resources/app/node_modules/alltomp3/index.js:17:15)
    at Object.<anonymous> (/opt/AllToMP3/resources/app/node_modules/alltomp3/index.js:2254:3)
Segmentation fault (core dumped)

I tried the solution given on https://ubuntuforums.org/showthread.php?t=2375927 also

Problem install

npm install --save alltomp3
npm ERR! Darwin 16.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "alltomp3"
npm ERR! node v7.7.4
npm ERR! npm v4.1.2
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/alltomp3
npm ERR! 404
npm ERR! 404 'alltomp3' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR! /Volumes/SSD2/Mis Proyectos/alltomp3/npm-debug.log
MacBook-Pro-de-Macintosh:alltomp3 dmenor$ npm install alltomp3
npm ERR! Darwin 16.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "alltomp3"
npm ERR! node v7.7.4
npm ERR! npm v4.1.2
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/alltomp3
npm ERR! 404
npm ERR! 404 'alltomp3' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

E: Unable to locate package alltomp3

Curl works ok (i think):
curl -s https://packagecloud.io/install/repositories/AllToMP3/alltomp3/script.deb.sh | sudo bash
Detected operating system as Ubuntu/bionic.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/AllToMP3_alltomp3.list...done.
Importing packagecloud gpg key... done.
Running apt-get update... done.

The repository is setup! You can now install packages."

But install fails
sudo apt-get install alltomp3
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package alltomp3

How to use in Angular 4+ app?

Hello, this npm package look interesting. Any insight on how to import it into an Angular 4+ project and use the methods. I've tried installing via the npm install and importing it, but a lot of errors popup.

White screen in app

Hello, When downloading songs the app goes from the usual UI to a white screen (see pic), this happens when I keep the app running for a prolonged period of time. The app is still able to download correctly. I love the app but this bug is quite frustrating at times.
Stay safe and have a great day :)
AllToMP3_31ddhFHdeH

Fix lyrics formatting

You could improve the following formatting logic :

alltomp3/index.js

Lines 75 to 80 in 7129f17

html = _.trim(html.text());
html = html.replace(/\r\n\n/g, '\n');
html = html.replace(/\t/g, '');
html = html.replace(/\n\r\n/g, '\n');
html = html.replace(/ +/g, ' ');
html = html.replace(/\n /g, '\n');

With :

html = html.text()
    .replace(/\r\n/g, '\n') // windows to linux new line style
    .replace(/\t/g, '') // no tabs
    .replace(/ +/g, ' ') // whitespaces
    .split('\n').map(line => line.trim()).join('\n') // trim every line
    .replace(/\n{3,}/g, '\n\n'); // no more than two new lines in a row

This would fix the formatting issues seen on lyrics.ovh.

soundcloud playlist - failing on resolve URL with a 403

Hi

Unable to download Soundcloud playlist

Unhandled rejection StatusCodeError: 403 - [object Object]
at new StatusCodeError (/root/node_modules/request-promise/lib/errors.js:26:15)
at Request.RP$callback [as _callback] (/root/node_modules/request-promise/lib/rp.js:68:32)
at Request.self.callback (/root/node_modules/request/request.js:185:22)
at Request.emit (events.js:198:13)
at Request. (/root/node_modules/request/request.js:1154:10)
at Request.emit (events.js:198:13)
at IncomingMessage. (/root/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:286:20)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

/resolve return a 403
The resolve resource allows you to lookup and access API resources when you only know the SoundCloud.com URL.

Hardcoded API Keys!

Just noticed that the API keys are exposed in the open here. This is kind of a huge security flaw with this module as this can lead to abuse of such keys.

how to know request status.

hey man, Is there any way to know if the method findAndDownload method fails? like if it is not able to find out the song.

ps. fan of your work btw

Error on downloading playlist

I tried to download a playlist (https://www.youtube.com/playlist?list=PLa9c_3U5StsLdALdu6YlxRfmryQGC-sAW) but after one file is downloaded I get the following error:

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn fpcalc ENOENT
    at exports._errnoException (util.js:896:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
    at onErrorNT (internal/child_process.js:348:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

This is my code:

const alltomp3 = require("alltomp3");

alltomp3.downloadPlaylistWithURLs('https://www.youtube.com/playlist?list=PLa9c_3U5StsLdALdu6YlxRfmryQGC-sAW', '.', function(a,b){
    console.log(a,b);
}, 10);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.