MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

[MMM-MusicOnDemand] - Play music from deezer with a browser in the background


  • Module Developer

    Description:

    This module allows you to play music from Deezer with puppeteer. That means you need at least a free account from Deezer. It is meant to be used with a speech recognition module like MMM-AssistantMk2, but it should work with other modules as long as you send the correct notifications as described in de README of the project.
    It acutally plays the music on the machine this module is running on. So you don't have to use a other device to play music with a music on demand service e.g. on Raspberry Pi.
    Enjoy 🙂

    Screenshots:

    alt text

    Download:

    GitHub


    Version 1.01

    • Force installs puppeteer v1.11.0

    Version 1.0

    • Initial Release, confirmed working on Raspberry Pi 3b+


  • @ptrk95 yes finally a Deezer module and what is great is that it’s standalone THANKS! 😍



  • @ptrk95 getting a black screen when I launch MagicMirror no matter if I use default Chromium or puppeteer.

    Actually I was going now to delete the puppeteer package, but it wasn’t installed at all. 🤔

    Running everything on a Raspberry Pi 3 B+.


  • Module Developer

    Thanks for pointing that out! The dependencies in the package.json weren’t set. I uploaded a changed version but unfortunatley this build won’t work for me right now, so I have to do a deeper look into it.
    Edit: It`s again working on the new build, was a problem with the puppeteer version and the chromium version installed on raspbian.



  • @ptrk95 it keeps displaying a black screen.

    This is my config section for this module:

    		{
    			module: "MMM-MusicOnDemand",
    			position: "top_right",
    			disabled: false,
    			config: {
    				chromiumPath : "/usr/bin/chromium-browser",
    				// chromiumPath : null,
    				showCover : true,
    				email : "****",
    				password : "****",
    				}
    		 },
    
    

    and this is the MM dev log:

    pi@raspberrypi:~/MagicMirror $ npm start dev
    
    > magicmirror@2.6.0 start /home/pi/MagicMirror
    > sh run-start.sh "dev"
    
    Starting MagicMirror: v2.6.0
    Loading config ...
    Loading module helpers ...
    Initializing new module helper ...
    Module helper loaded: MMM-Remote-Control
    No helper found for module: alert.
    Initializing new module helper ...
    Module helper loaded: updatenotification
    Initializing new module helper ...
    Module helper loaded: newsfeed
    Initializing new module helper ...
    Module helper loaded: MMM-AssistantMk2
    No helper found for module: clock.
    Initializing new module helper ...
    Module helper loaded: MMM-PushBulletNotifications
    WARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module 'puppeteer'
    Loading module helpers ...
    Initializing new module helper ...
    Module helper loaded: MMM-Remote-Control
    No helper found for module: alert.
    Initializing new module helper ...
    Module helper loaded: updatenotification
    Initializing new module helper ...
    Module helper loaded: newsfeed
    Initializing new module helper ...
    Module helper loaded: MMM-AssistantMk2
    No helper found for module: clock.
    Initializing new module helper ...
    Module helper loaded: MMM-PushBulletNotifications
    App threw an error during load
    Error: Cannot find module 'puppeteer'
        at Module._resolveFilename (module.js:543:15)
        at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
        at Function.Module._load (module.js:473:25)
        at Module.require (module.js:586:17)
        at require (internal/module.js:11:18)
        at Object. (/home/pi/MagicMirror/modules/MMM-MusicOnDemand/node_helper.js:4:19)
        at Object. (/home/pi/MagicMirror/modules/MMM-MusicOnDemand/node_helper.js:310:3)
        at Module._compile (module.js:642:30)
        at Object.Module._extensions..js (module.js:653:10)
        at Module.load (module.js:561:32)
    Whoops! There was an uncaught exception...
    { Error: Cannot find module 'puppeteer'
        at Module._resolveFilename (module.js:543:15)
        at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
        at Function.Module._load (module.js:473:25)
        at Module.require (module.js:586:17)
        at require (internal/module.js:11:18)
        at Object. (/home/pi/MagicMirror/modules/MMM-MusicOnDemand/node_helper.js:4:19)
        at Object. (/home/pi/MagicMirror/modules/MMM-MusicOnDemand/node_helper.js:310:3)
        at Module._compile (module.js:642:30)
        at Object.Module._extensions..js (module.js:653:10)
        at Module.load (module.js:561:32) code: 'MODULE_NOT_FOUND' }
    MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
    If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
    Launching application.
    

  • Module Developer

    That’s strange.
    Try cd in the MusicOnDemand folder and then:
    npm install puppeteer@1.11.0



  • @ptrk95 but then why should I need puppeteer if we have already Chromium installed in the Pi? 😕


  • Module Developer

    @cr4z33 with puppeteer you can control the browser with Javascript. But it will install a version of chromium inside the puppeteer folder which you can delete to save space if you use the preinstalled chromium of raspbian 🙂



  • @ptrk95 OK thanks now MM is loading properly, but yout module keeps saying ‘Initializing…’ and nothing happens. 😬

    This is the error in log:

    Error: Failed to launch chrome!
    
    
    TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
    
        at onClose (/home/pi/MagicMirror/modules/MMM-MusicOnDemand/node_modules/puppeteer/lib/Launcher.js:342:14)
        at ChildProcess.helper.addEventListener (/home/pi/MagicMirror/modules/MMM-MusicOnDemand/node_modules/puppeteer/lib/Launcher.js:332:60)
        at emitTwo (events.js:131:20)
        at ChildProcess.emit (events.js:214:7)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
    

  • Module Developer

    @cr4z33 that’s most likely a versioning problem with puppeteer and chromium.
    I assume you already did:

    cd ~/MagicMirror/modules/MMM-MusicOnDemand
    npm install puppeteer@1.11.0
    

    Please check your chromium version. My version is the latest one: version 65.0.3325.181.
    If it’s not, try:

    sudo apt-get install chromium-browser
    

    And check that your chromium path in the config file is “/usr/bin/chromium-browser”, which I guess it is. Because on Raspberry Pi the browser of puppeteer isn’t working.

    If that’s also not launching your browser I honestly don’t know why 😕

    In the latest build I added the option “showBrowser” in the config-file. If you set it to true, you are able to see the browser and what it is doing in the browser.


Log in to reply