feat(streamlink): add streamlink
This commit is contained in:
@@ -12,6 +12,7 @@ in {
|
|||||||
./mpd-mpris.nix
|
./mpd-mpris.nix
|
||||||
./mpv.nix
|
./mpv.nix
|
||||||
./ncmpcpp.nix
|
./ncmpcpp.nix
|
||||||
|
./streamlink.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.home.media.fullDesktop = mkEnableOption "Enables everything";
|
options.home.media.fullDesktop = mkEnableOption "Enables everything";
|
||||||
@@ -20,5 +21,6 @@ in {
|
|||||||
mpd.enable = mkDefault (cfg.fullDesktop or cfg.mpd-mpris.enable);
|
mpd.enable = mkDefault (cfg.fullDesktop or cfg.mpd-mpris.enable);
|
||||||
mpv.enable = mkDefault cfg.fullDesktop;
|
mpv.enable = mkDefault cfg.fullDesktop;
|
||||||
ncmpcpp.enable = mkDefault config.home.media.mpd.enable;
|
ncmpcpp.enable = mkDefault config.home.media.mpd.enable;
|
||||||
|
streamlink.enable = mkDefault config.home.media.mpv.enable;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.media.streamlink;
|
||||||
|
in {
|
||||||
|
options.home.media.streamlink.enable = mkEnableOption "Enable Streamlink";
|
||||||
|
config.programs.streamlink = mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
player = "${pkgs.mpv}/bin/mpv";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{pkgs, ...}: {
|
||||||
config.home.desktop.firefox = {
|
config.home.desktop.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
useZen = true;
|
useZen = true;
|
||||||
@@ -13,6 +13,16 @@
|
|||||||
smothscroll = "true";
|
smothscroll = "true";
|
||||||
};
|
};
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
command openTwitchInMpv js -d@\
|
||||||
|
const url = new URL(document.location.href);\
|
||||||
|
const cleanUrl = url.hostname + url.pathname;\
|
||||||
|
const token = document.cookie.split("; ")\
|
||||||
|
.find(item => item.startsWith("auth-token="))?.split("=")[1];\
|
||||||
|
const auth = "--twitch-api-header=Authorization=OAuth " + token;\
|
||||||
|
const cmd = `${pkgs.streamlink}/bin/streamlink "''${auth}" "''${cleanUrl}" best`;\
|
||||||
|
tri.native.run(cmd)\
|
||||||
|
@
|
||||||
|
|
||||||
unbind h
|
unbind h
|
||||||
unbind j
|
unbind j
|
||||||
unbind k
|
unbind k
|
||||||
@@ -69,6 +79,7 @@
|
|||||||
|
|
||||||
bind < urlincrement -1
|
bind < urlincrement -1
|
||||||
bind > urlincrement 1
|
bind > urlincrement 1
|
||||||
|
bind ypt openTwitchInMpv
|
||||||
bind ypv js tri.native.run(`mpv --ytdl-format="[height >=? 480]" --ontop --fs "''${document.location.href}"`)
|
bind ypv js tri.native.run(`mpv --ytdl-format="[height >=? 480]" --ontop --fs "''${document.location.href}"`)
|
||||||
bind ypm hint -JF e => tri.native.run(`mpv --ytdl-format="[height >=? 480]" --ontop --fs "''${e.href}"`)
|
bind ypm hint -JF e => tri.native.run(`mpv --ytdl-format="[height >=? 480]" --ontop --fs "''${e.href}"`)
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in New Issue
Block a user