Media-Jukebox is a personal DIY Project that brings elegant ease-of-use to playing media.
Ever got lost browsing YouTube aimlessly?
Create Themes fitting your mood and add any number of YouTube playlist to instantly create epic atmosphere with the touch of a button.
The Project details both the electrical implementation and provides the code neccessary Python code.
Below, the main modules are described.
- handles the
shutdown_button
- controls the Raspberry Pi fan
Wiring a button between GPIO3
and GND
allows for turing on a Raspberry Pi that is in stand by (shutdown but still powered).
After booting up, the peripherals.py
script watches for the same GPIO3
pin - if the button is pressed, it initiates the shutdown procedure.
To shutdown the Raspberry Pi, simply hold the ON button for more than 3 seconds (when the LED flashes the second time).
A small fan is required for safely operating the Raspberry Pi. It can be wired to the 3.3V
pin but then it would still be powered when the Raspberry Pi is shutdown. Therefore it must be controlled with a GPIO pin, but the pins cannot handle large cutrrents, so an optocoupler is used. (In this project a standard relay is used.)
The LED on the front panel is used to signal the press of a button.
Make sure that the GPIO pins specified in the gpio_wiring.yaml
respect the electrical wiring.
- handles the buttons and selects the Themes accordingly
- gets the YouTube videos URLs for each Theme
Each Theme (Retro, 70s, etc.) has a corresponding button on the front panel. A Theme is a collection of YouTube Playlists, specified in the playlists.yaml
file.
A short press of a button (<3 seconds) selects the corresponding Theme and plays a random song. If the Theme is already selected, it will play the next song. A long press of a button (>3 seconds, signalled by the second blinking of the LED) deselects the playing Theme.
Make sure that the GPIO pins specified in the gpio_wiring.yaml
respect the electrical wiring.
You can add as many playlists as you like in the playlists.yaml
file. Specify the Theme name and its corresponding button and you're set.
This module is still in development. For now it starts playing the most recently added movie in a speciied directory. It automatically formats the torrent naming and downloads subtitle.