Coder Social home page Coder Social logo

eranknafo2001 / mopidy-ytmusic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ozymandiasthegreat/mopidy-ytmusic

0.0 1.0 0.0 371 KB

Mopidy extension for playling music/managing playlists in Youtube Music

License: Apache License 2.0

Python 100.00%

mopidy-ytmusic's Introduction

Mopidy-YTMusic

Latest PyPI Version Latest GitHub Release Commits Since Latest Release

Mopidy extension for playing music from YouTube Music

Installation

Install by running:

sudo python3 -m pip install Mopidy-YTMusic

See https://mopidy.com/ext/ytmusic/ for alternative installation methods.

Configuration

By default Mopidy-YTMusic will connect to YouTube Music as a guest account. This has limited options. If you would like to connect to YouTube Music with your account (free or premium) you'll need to generate an auth.json file and configure Mopidy-YTMusic to use it.

To create an auth.json file run mopidy ytmusic setup (or sudo mopidyctl ytmusic setup if you're running mopidy as a service, also see below) and follow the instructions in the terminal. When you're done it will tell you what config options you need to add to your Mopidy configuration file. It should look something like this:

[ytmusic]
auth_json = /path/to/auth.json

Authenticated users have access to their listening history, likes, playlists and uploaded music. Premium users have access to high quality audio streams and other premium content.

Annoyingly, those authentication credentials will expire from time to time. Run mopidy ytmusic reauth (or sudo mopidyctl ytmusic reauth) to paste in new headers and overwrite your existing auth.json file. Then restart mopidy for the new credentials to go into effect.

Other configuration options are as follows:

  • auto_playlist_refresh - time (in minutes) to refresh the Auto playlists. Default: 60. Set to 0 to disable auto playlists.
  • youtube_player_refresh - time (in minutes) to refresh the Youtube player url (used for decoding the signature). Default: 15
  • playlist_item_limit - Number of items to grab from playlists. This is not exact. Default: 100
  • subscribed_artist_limit - Number of subscriptions to list. Default: 100. Set to 0 to disable subscription list.
  • enable_history - Show Recently Played playlist. Default: yes
  • enable_like_songs - Show Liked Songs playlist. Default: yes
  • enable_mood_genre - Show Mood & Genre playlists from YouTube Music's Explore directory. Default: yes
  • enable_scrobbling - Mark tracks as played on YouTube Music after listening. Default: yes
  • stream_preference - Comma separated list of itags in the order of preference you want for stream. Default: "141, 251, 140, 250, 249"
  • verify_track_url - Verify that track url is valid before sending to mopidy. Default: yes. There should be no need to set this to no.

Info on YouTube Music streams:

itag Codec Sample Rate Bit Rate
141 [*] AAC 44.1kHz ~260kbps
251 Opus 48kHz ~150kbps
140 AAC 44.1kHz ~132kbps
250 Opus 48kHz ~80kbps
249 Opus 48kHz ~64kbps
[*]Available to premium accounts only.

Note for users running mopidy as a service:

Since the mopidy user will end up trying to create the auth.json file, you'll likely want to specify the path as /tmp when you run sudo mopidyctl ytmusic setup. Then you can move the /tmp/auth.json to /etc/mopidy and add:

[ytmusic]
auth_json = /etc/mopidy/auth.json

to your /etc/mopidy/mopidy.conf file. To make reauthentication easier, make sure the auth.json file is owned by the mopidy user by running sudo chown mopidy /etc/mopidy/auth.json.

Build for Local Install

  1. Install poetry <https://python-poetry.org/docs/#installation>
  2. Run poetry build to create the build tarball
  3. The dist/Mopidy-YTMusic-x.x.x.tar.gz file is what you'll use to install.
  4. With pip: python3 -m pip install dist/Mopidy-YTMusic-x.x.x.tar.gz to install or reinstall over an existing version.
  5. Do configuration stuff if you haven't already.

Project resources

Credits

mopidy-ytmusic's People

Contributors

impliedchaos avatar ozymandiasthegreat avatar github-actions[bot] avatar eschava avatar fatg3erman avatar balsoft avatar mikey-austin avatar antiguru avatar ppepos avatar kmac avatar

Watchers

James Cloos avatar

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.