Giter Club home page Giter Club logo

youtube-mpv's Introduction

ytdl server

Chrome extension and Firefox add-on that adds context menu option to play youtube videos with mpv (or other external player).

Requirements

  1. Chrome like/Firefox browser.
  2. python2 or python3
  3. youtube_dl module
  4. mpv or similar

Installation

Server side:

Arch Linux

Install the AUR package, youtube-mpv-git.

systemd unit files

In order to install the server with systemd, you will need to copy

  • youtube-mpv.service to /etc/systemd/user/youtube-mpv.service

Then you can install it with:

$ systemctl --user <enable|start> youtube-mpv.service

Note: these unit files assume ytdl_server.py is installed at /opt/youtube-mpv-git/ytdl_server.py. You will need to amend the paths if you have installed it elsewhere.

Ubuntu

./install-ubuntu.sh

make sure you don't run this script as root (without sudo)

**Note: ** for playlist support add ytdl-raw-options=yes-playlist= to your mpv.conf file.

Client side (browser):

  1. chrome://extensions/
  2. tick Developer mode
  3. Load unpacked extension...
  4. Choose chrome directory of this project.

Usage

  1. Navigate to script's directory.
  2. Run python ytdl_server.py.

Configuration

Change port, host or player, player options

Modify ytdl_config.py file.

General (mpv) player options should be set (usually) in ~/.config/mpv/config. Specific options like provided --no-terminal should be put in OPTS variable and separated with space ie: --no-terminal --screen 1.

Receive native notifications on errors

Modify ytdl_config.py to set the NOTIFY_COMMAND to a command, such as notify-send on Linux to provide native notifications when a video cannot be found.

How does it work

Whenever 'Play with mpv' is selected in browser, url http://127.0.0.1:9000/p?i=<youtube_url> is sent to listening server. Server checks if url is supported, extracts video url and starts player.

Credits

agiz, dcrystalj, ihavenoface, jamietanna

License

GPLv2

youtube-mpv's People

Contributors

agiz avatar chaserhkj avatar dcrystalj avatar ihavenoface avatar jamietanna avatar queria avatar realazizk avatar zach-adams avatar

Watchers

 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.