Mopidy extension for YouTube
Project description
Mopidy extension that plays sound from YouTube.
Installation
Install from PyPI by running:
python3 -m pip install Mopidy-Youtube
Install from github by running:
python3 -m pip install https://github.com/natumbri/mopidy-youtube/archive/develop.zip
Make sure you already have the GStreamer plugins, especially the “bad” collection of plugins. For example, on Debian/Ubuntu you can install it by running:
sudo apt-get install gstreamer1.0-plugins-bad
Configuration
Before starting Mopidy, you must add configuration for Mopidy-YouTube to your Mopidy configuration file:
[youtube] enabled = true
If you want modipy-youtube to use the YouTube API, before starting Mopidy, you must add your Google API key to your Mopidy configuration file and set api_enabled = true:
[youtube] youtube_api_key = <api key you got from Google> api_enabled = true
If you want modipy-youtube to use YouTube Muisc, instead of regular YouTube, set musicapi_enabled = true:
[youtube] musicapi_enabled = true
Other configuration options are:
[youtube] threads_max = 16 : number of parallel threads to run search_results = 15 : maximum number of search results to return playlist_max_videos = 20 : maximum number of videos in a playlist to return
mopidy-youtube can automatically play ‘related’ tracks after the last track in the play queue is played. If you want mopidy-youtube to autoplay related videos, set autoplay_enabled = true:
[youtube] autoplay_enabled = true
If autoplay is enabled, other options are:
strict_autoplay = [true/false] max_autoplay_length = [maximum length of track in seconds or None] max_degrees_of_separation = [defaults to 3]
If the option strict_autoplay is set, the current tracklist is ignored and the most related video automatically played afterwards.
Max degrees of separation controls how distantly related to the track that triggered autoplay the autoplayed tracks can be.
Usage
Simply use search for filename in your MPD client or add YouTube URL or URI to playlist prefixed by yt: or youtube:.
Example video:
[yt|youtube]:<url to youtube video> [yt|youtube]:video:<id> [yt|youtube]:video/<title>.<id>
Example for playlist:
[yt|youtube]:<url to youtube playlist> [yt|youtube]:playlist:<id> [yt|youtube]:playlist/<title>.<id>
Troubleshooting
If the extension is slow, try setting lower values for threads_max, search_results and playlist_max_videos.
If resolving of URIs stops working, always try to update the youtube-dl library first.
Project resources
Credits
Original author: Janez Troha
Current maintainer: Nikolas Tumbri
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for Mopidy_YouTube-3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9986d8700a9aa2c37f2adb6220aef7a6b0cbfe43464ff0a02b9c4c7c982d594 |
|
MD5 | a2559ed79a6699d9701e1e2a5f7fa156 |
|
BLAKE2b-256 | d38a0761f20cb07c487b71c29c2447eddbd0614ed34da99cdfa822e4c8a2726d |
Hashes for Mopidy_YouTube-3.3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae7ddce2f1e2d8939d57a5d784abe41830a6081901cabc12219fa9f89a4f94fd |
|
MD5 | 639f2a64755c768c92e6d4c92ddc313c |
|
BLAKE2b-256 | 20fbc6f1a70705e1e90d5e07afb2a8de7686cf4044bb3f2803c332e4cc5d63ed |