Skip to main content

CLI tool for downloading subtitles from napiprojekt.pl

Project description

napi-py Build Status

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

prerequisites

  • Python 3.6 or newer
  • 7z executable available on PATH, can be installed:
    • on Debian-based distros with sudo apt-get install p7zip-full
    • on macOS with brew install p7zip using homebrew

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's issue with weird characters in downloaded subtitles, try to re-download and use flag --from-enc utf-8
  • if there's no subtitles 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 config installs venv under .venv/napi-py
  • make test runs tests
  • make build creates installable package

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

napi-py-1.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

napi_py-1.1.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file napi-py-1.1.0.tar.gz.

File metadata

  • Download URL: napi-py-1.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.0

File hashes

Hashes for napi-py-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0cc20dca955b8ddf36beb0fb2e935fa72d7f16092986c3b7dc8b60680bae907f
MD5 79f801830b991983a46f58091775da6f
BLAKE2b-256 f37887f4472feb2082ed05879e0446578b9685a876b4b1be31046ff2c60a07eb

See more details on using hashes here.

File details

Details for the file napi_py-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: napi_py-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.0

File hashes

Hashes for napi_py-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df7115dcfbc6de7f6e7e53a0d7c701b04a850f6fb7ba0f6779be035724a703fe
MD5 0f6286df823e8f0131f44736a692c5f3
BLAKE2b-256 626f86a11858132d2f76417da3adbc0f87940e61c9f808e9787ec9f9dfde68a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page