From 829e81b3e9d1265680d0f4f5993b4431f5fe7849 Mon Sep 17 00:00:00 2001 From: Himadri Bhattacharjee Date: Sun, 9 Jul 2023 09:35:15 +0530 Subject: [PATCH] feat: add sponsorblock plugin for mpv --- .gitignore | 1 + .gitmodules | 3 +++ configuration.nix | 18 ++++++++++-------- home.nix | 4 ++++ sources/README.md | 7 +++++++ sources/mpv-sponsorblock | 1 + sources/mpv/sponsorblock.toml | 12 ++++++++++++ 7 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 .gitmodules create mode 100644 sources/README.md create mode 160000 sources/mpv-sponsorblock create mode 100644 sources/mpv/sponsorblock.toml diff --git a/.gitignore b/.gitignore index 5e440ed..8734e7e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.kdbx +*.so diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..392dc7d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "sources/mpv-sponsorblock"] + path = sources/mpv-sponsorblock + url = https://github.com/TheCactusVert/mpv-sponsorblock diff --git a/configuration.nix b/configuration.nix index 45246c5..53757cb 100644 --- a/configuration.nix +++ b/configuration.nix @@ -115,7 +115,6 @@ description = "Himadri Bhattacharjee"; extraGroups = [ "networkmanager" "wheel" ]; packages = with pkgs; [ - aircrack-ng bettercap blackbox-terminal cargo @@ -145,12 +144,11 @@ pwntools python312 rust-analyzer - rustfmt rustc + rustfmt rustscan signal-desktop tor-browser-bundle-bin - wifite2 wine yt-dlp ]; @@ -211,24 +209,28 @@ # $ nix search wget environment.systemPackages = with pkgs; [ - # Need virtualenv for waydroid-scripts - # this helps us enable libhoudini adw-gtk3 + aircrack-ng bat exa gnomeExtensions.blur-my-shell gnomeExtensions.caffeine gnomeExtensions.rounded-window-corners helix + iw + macchanger mpv + # Need virtualenv for waydroid-scripts ntfs3g openssl openssl.dev - ripgrep - virtualenv - wget p7zip pciutils + ripgrep + # this helps us enable libhoudini + virtualenv + wget + wifite2 wl-clipboard (writeScriptBin "sudo" ''exec doas "$@"'') ]; diff --git a/home.nix b/home.nix index 372e58e..1a3f5be 100644 --- a/home.nix +++ b/home.nix @@ -16,6 +16,10 @@ source = ./sources/fish; recursive = true; }; + ".config/mpv" = { + source = ./sources/mpv; + recursive = true; + }; }; }; } diff --git a/sources/README.md b/sources/README.md new file mode 100644 index 0000000..98bfa82 --- /dev/null +++ b/sources/README.md @@ -0,0 +1,7 @@ +# Compiling the Sponsorblock library + +```sh +cd mpv-sponsorblock +cargo build --release --locked +cp ./target/release/libmpv_sponsorblock.so ../mpv/scripts/sponsorblock.so +``` diff --git a/sources/mpv-sponsorblock b/sources/mpv-sponsorblock new file mode 160000 index 0000000..71f24ed --- /dev/null +++ b/sources/mpv-sponsorblock @@ -0,0 +1 @@ +Subproject commit 71f24edf3082a601d013c78cd02a05425008c9db diff --git a/sources/mpv/sponsorblock.toml b/sources/mpv/sponsorblock.toml new file mode 100644 index 0000000..16f0f43 --- /dev/null +++ b/sources/mpv/sponsorblock.toml @@ -0,0 +1,12 @@ +# Server address +server_address = "https://sponsor.ajay.app" +# Categories: sponsor, selfpromo, interaction, poi_highlight, intro, outro, preview, music_offtopic, filler, exclusive_access +categories = ["sponsor", "selfpromo", "interaction", "poi_highlight", "intro", "outro", "preview", "music_offtopic", "filler", "exclusive_access"] +# Action types: skip, mute, poi, full +action_types = ["skip"] +# Get segments for a video with extra privacy +privacy_api = false +# Third party YouTube domains like Piped, Invidious or CloudTube +domains = ["piped.kavin.rocks", "invidious.kavin.rocks"] +# Use OSD when a segment is skipped or muted +skip_notice = false