Giter Site home page Giter Site logo

christoph-heinrich / mpv-youtube-upnext Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cvzi/mpv-youtube-upnext

0.0 0.0 0.0 3.23 MB

A userscript for MPV that allows you to play "up next"/recommended youtube videos ⏭️

License: Other

Lua 100.00%

mpv-youtube-upnext's Introduction

youtube-upnext

A userscript for MPV that allows you to load the up next/recommened youtube video on the fly, as though you were using the web player.

screenshot

Toggle the menu with ctrl+u (configurable). Select from the list with the arrow keys (configurable), and press Enter (configurable) to select. Menu times out after 10 seconds (configurable).

Press Space to append to the playlist. Close menu with Escape or ctrl+u.

Installation

Copy youtube-upnext.lua into your scripts directory, e.g.:

cp youtube-upnext.lua ~/.config/mpv/scripts/

optional, copy the config file:

cp youtube-upnext.conf ~/.config/mpv/script-opts/

Windows:

The location of the scripts directory on Windows is %APPDATA%\mpv\scripts e.g. C:\Users\cvzi\AppData\Roaming\mpv\scripts

Make sure you have GNU Wget installed. There are several websites that offer a binary release of wget for Windows e.g. here, it is also included in MingW and similar tools.

If you downloaded/installed the wget executable, you have to add the directory of the wget.exe to your machine's %PATH%.

Depending on your setup you may have to set check_certificate = false in the lua script or in the config file, because some wget versions on Windows seem to have problems with HTTPS/SSL certificates.

mpv.net:

The script folder for mpv.net is: %APPDATA%\mpv.net\scripts

The .conf files belong into: %APPDATA%\mpv.net\script-opts

The keyboard shortcut in the script and the .conf-file doesn't work with mpv.net. You need to set the keyboard shortcut yourself in your input.conf. Default location is %APPDATA%\mpv.net\input.conf. Add the following line to the end of your input.conf (change the key if it's already used):


 Ctrl+u     script-message-to   youtube_upnext   upnext-menu

SVP

Installation is the same as for normal mpv. You need to install yt-dlp. On Windows you have to add the directory of the yt-dlp.exe to your machine's %PATH% or put yt-dlp.exe into %APPDATA%\mpv\ e.g. C:\Users\cvzi\AppData\Roaming\mpv\yt-dlp.exe.

You need to update yt-dlp occasionally when it stops working.

Unfortunately SVP does not make the quality available to scripts. That means the quality settings that were selected in SVP are not preserved when the next video is loaded.

Credit

  • reload.lua, for the function to reload a video while preserving the playlist.
  • mpv-playlistmanager, from which I ripped off much of the menu formatting config.
  • ytdl_hook.lua, from which I ripped off much of the youtube-dl code to fetch the format list
  • somebody on /mpv/ for the idea

mpv-youtube-upnext's People

Contributors

2084x avatar admicos avatar croissong avatar cvzi avatar deadsix27 avatar jgreco avatar occivink 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.