Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package request: mpvScripts.autosub #336986

Closed
Kommynct opened this issue Aug 24, 2024 · 5 comments · Fixed by #356158
Closed

Package request: mpvScripts.autosub #336986

Kommynct opened this issue Aug 24, 2024 · 5 comments · Fixed by #356158
Labels
0.kind: packaging request Request for a new package to be added

Comments

@Kommynct
Copy link

Project description

Automatic subtitle downloading for MPV

Metadata


Add a 👍 reaction to issues you find important.

@Kommynct Kommynct added the 0.kind: packaging request Request for a new package to be added label Aug 24, 2024
@jcaesar
Copy link
Contributor

jcaesar commented Sep 10, 2024

Hm, this looks neat. I think I'll test this a while with

  home.file.".config/mpv/scripts/autosub.lua".source = let
    patched = pkgs.stdenv.mkDerivation {
      name = "mpv-autosub-git";
      src = pkgs.fetchFromGitHub {
        owner = "davidde";
        repo = "mpv-autosub";
        rev = "35115355bd339681f97d067538356c29e5b14afa";
        hash = "sha256-BKT/Tzwl5ZA4fbdc/cxz0+CYc1zyY/KOXc58x5GYow0=";
      };
      prePatch = ''
        substituteInPlace autosub.lua --replace-fail \
          "local subliminal = '/home/david/.local/bin/subliminal'" \
          "local subliminal = '${lib.getExe' pkgs.python3.pkgs.subliminal "subliminal"}'"
      '';
      buildPhase = "";
      installPhase = "install -Dt $out/mpv/scripts autosub.lua";
    };
  in "${patched}/mpv/scripts/autosub.lua";

and then think about packaging it.

Shouldn't be too difficult, there's existing architecture for mpv scripts. There's two small oofs, which is

  • Subliminal is marked as broken, but builds fine, the test failures are gone. Haven't tested whether it works.
  • The script suggests setting some optional credentials directly in the script. Might be nice if upstream could be petitioned to implement an alternative mechanism for that (anything from .netrc to some keyring)

@Kommynct
Copy link
Author

Any luck with that?

@jcaesar
Copy link
Contributor

jcaesar commented Oct 24, 2024

I've tried it on a few files, but it seems subliminal just downloads random garbage. Given that, I don't see the point of packaging this script. I don't have the time to look into the problem with subliminal.

See e.g. this for what I mean:

yt-dlp ytsearch:3uDwjIBR9s4
subliminal download -l en *3uDwjIBR9s4*
mpv *3uDwjIBR9s4*

@Kommynct
Copy link
Author

Kommynct commented Oct 24, 2024

it doesn't work on youtube videos, it's for movies/tv shows.

Extending it to also work on youtube videos would be pointless if you're using yt-dlp you should be able to download the sub then anyway.

@octvs
Copy link
Member

octvs commented Nov 15, 2024

Since PR marking subliminal as unbroken has landed on nixos-unstable I've
tested and submitted a PR for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: packaging request Request for a new package to be added
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants