Git Product home page Git Product logo

alltomp3's Issues

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.

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

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

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.

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 >_<.

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.

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

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)

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)

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 ?

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

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 ~ $

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);

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.

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.

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

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...).

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

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.