Giter Site home page Giter Site logo

mpv-sponsorblock's Introduction

SponsorBlock plugin for MPV

A port of SponsorBlock for MPV (or Celluloid) written in Rust.

Questions

Can I write my own plugin in Rust ?

Yes! Just follow the example here and you will be ready.

Build

Build the plugin:

cargo build --release --locked

Installation

Linux

MPV

Copy the lib generated to your scripts folder:

cp ./target/release/libmpv_sponsorblock.so ~/.config/mpv/scripts/sponsorblock.so
Celluloid

Copy the lib generated to your scripts folder:

cp ./target/release/libmpv_sponsorblock.so ~/.config/celluloid/scripts/sponsorblock.so

Windows

Installation for Windows is available : https://mpv.io/manual/stable/#c-plugins. I don't use Windows. Feel free to make a pull request.

Configuration

Copy the exemple configuration file sponsorblock.toml into your MPV (not Celluloid) folder:

cp ./sponsorblock.toml ~/.config/mpv/sponsorblock.toml

If no configuration file is found, only the sponsors segments will be skipped as specified by the API.

A segment is the combination of a category and an action type.

Categories

Official SponsorBlock documentation on categories can be found here.

Here is a summary :

  • sponsor: Part of a video promoting a product or service not directly related to the creator.
  • selfpromo: Promoting a product or service that is directly related to the creator themselves.
  • interaction: Explicit reminders to like, subscribe or interact with them on any paid or free platform(s) (e.g. click on a video).
  • poi_highlight: Used to get to the point or highlight of a video.
  • intro: Segments typically found at the start of a video that include an animation, still frame or clip which are also seen in other videos by the same creator.
  • outro: Segments typically near or at the end of the video when the credits pop up and/or endcards are shown.
  • preview: Collection of clips that show what is coming up in in this video or other videos in a series where all information is repeated later in the video.
  • music_offtopic: Non-music Section segments on videos which feature music as the primary content.
  • filler: Filler Tangent/ Jokes is only for tangential scenes added only for filler or humor that are not required to understand the main content of the video.
  • exclusive_access: When the creator showcases a product, service or location that they've received free or subsidised access to in the video that cannot be completely removed by cuts.

Action Types

Here is a summary :

  • skip: The segment will be skipped by the plugin.
  • mute: The segment will be muted by the plugin. These segments are not skipped! See the documentation here.
  • full: The video is marked as a category you requested. The plugin will only show a message at the start of the video. See the documentation here.
  • poi: Allow you to jump to the highlight of the video. Do not forget to add the associated keybinding and the category poi_highlight. See the documentation here.

Keybindings

All the keybinds are for exemple, you can change the shortcut.

Toggle

You can toggle on and off the plugin by adding this line to input.conf:

alt+t script-binding "sponsorblock/toggle"

Highlight

You can add a binding to jump to the highlight of the video by adding this line to input.conf:

alt+p script-binding "sponsorblock/poi"

You also need to add these values to their associated keys in your sponsorblock.toml:

categories = ["poi_highlight"]
action_types = ["poi"]

Usage

Play a YouTube video and segments you chose in the configuration file will be skipped or muted.

If the video is entirely labeled as a category it will be shown at startup : celluloid

mpv-sponsorblock's People

Contributors

thecactusvert avatar lavafroth avatar glitchikun 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.