Skip to content
/ napi-py Public
forked from gabrys/napi.py

CLI tool for downloading subtitles from napiprojekt.pl

License

Notifications You must be signed in to change notification settings

emkor/napi-py

This branch is 80 commits ahead of gabrys/napi.py:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c2b3c06 · Sep 8, 2024

History

83 Commits
Sep 8, 2024
Jun 15, 2024
Jun 15, 2024
Jun 15, 2024
Aug 25, 2019
May 31, 2021
Jun 15, 2024
May 31, 2021
Sep 8, 2024
Sep 8, 2024

Repository files navigation

napi-py PyPI - Python Version CI

CLI tool for downloading subtitles from napiprojekt.pl, fork of gabrys/napi.py

prerequisites

  • Python 3.7 or newer

installation

  • pip install napi-py for user-wide installation

usage as CLI tool

  • napi-py ~/Downloads/MyMovie.mp4 will download and save subtitles under ~/Downloads/MyMovie.srt

usage as lib

from napi import NapiPy

movie_path = "~/Downloads/MyMovie.mp4"

napi = NapiPy()
movie_hash = napi.calc_hash(movie_path)
source_encoding, target_encoding, tmp_file = napi.download_subs(movie_hash)
subs_path = napi.move_subs_to_movie(tmp_file, movie_path)
print(subs_path)

in case of issues

  • if there are no subs for your movie, there's still hope:
    • open the movie web page on napiprojekt.pl in your browser, as in example: https://www.napiprojekt.pl/napisy1,1,1-dla-55534-Z%C5%82odziejaszki-(2018)
    • choose subtitles that might match your movie, right-click them and select "Copy link" on link containing hash, which looks like this napiprojekt:96edd6537d9852a51cbdd5b64fee9194
    • use flag --hash YOURHASH in this tool, i.e. --hash 96edd6537d9852a51cbdd5b64fee9194 or --hash napiprojekt:96edd6537d9852a51cbdd5b64fee9194

development

  • make install installs poetry virtualenv
  • make test runs tests
  • make build creates installable package

About

CLI tool for downloading subtitles from napiprojekt.pl

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Python 95.7%
  • Makefile 4.3%