Skip to main content

CLI tool for downloading subtitles from napiprojekt.pl

Project description

napi-py CI

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

prerequisites

  • Python 3.6 or newer
  • on Linux, python3-dev package:
    • for Debian-based systems, use sudo apt-get install python3-dev

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 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.4.tar.gz (5.9 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.4-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: napi-py-1.1.4.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.6

File hashes

Hashes for napi-py-1.1.4.tar.gz
Algorithm Hash digest
SHA256 5e497c0ba1244941931e45844c4332d7c59ad9bfb4f33b79b7c8268167b89f54
MD5 348eb2c066af15c28b808d8153b0edfa
BLAKE2b-256 9722a3c6920f41d5349c8d1075b5c79169dbd3c06700529ab289b1598505acc0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: napi_py-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.6

File hashes

Hashes for napi_py-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ec10ac74a11c87787a315592414a49711ddbbbd317c9d199e5d72a51490edc67
MD5 848ac9dfb1fc67558f8d1b799c267e5d
BLAKE2b-256 19397f539e168120436b2999714f2ebd0e99fcd273a95f0a6d7926fa105081cb

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