CLI tool for downloading subtitles from napiprojekt.pl
Project description
napi-py 
CLI tool for downloading subtitles from napiprojekt.pl, fork of gabrys/napi.py
prerequisites
- Python 3.6 or newer
7zexecutable available on PATH, can be installed:- on Debian-based distros with
sudo apt-get install p7zip-full - on macOS with
brew install p7zipusing homebrew
- on Debian-based distros with
installation
pip install napi-pyfor user-wide installation
usage as CLI tool
napi-py ~/Downloads/MyMovie.mp4will 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.plin 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 YOURHASHin this tool, i.e.--hash 96edd6537d9852a51cbdd5b64fee9194or--hash napiprojekt:96edd6537d9852a51cbdd5b64fee9194
- open the movie web page on
development
make configinstallsvenvunder.venv/napi-pymake testruns testsmake buildcreates installable package
Project details
Release history Release notifications | RSS feed
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.0.0.tar.gz
(7.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
napi_py-1.0.0-py3-none-any.whl
(19.3 kB
view details)
File details
Details for the file napi-py-1.0.0.tar.gz.
File metadata
- Download URL: napi-py-1.0.0.tar.gz
- Upload date:
- Size: 7.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98384b0fa7a47277b5a566f73efb977749da3cb84fb6c8cab627812bf328b829
|
|
| MD5 |
276a8f57c44741683ecc5a8c06767ac7
|
|
| BLAKE2b-256 |
e1e3f02e527d35b84dc6ec53d0e34f78f94b8b3841815cbb54c083507349479f
|
File details
Details for the file napi_py-1.0.0-py3-none-any.whl.
File metadata
- Download URL: napi_py-1.0.0-py3-none-any.whl
- Upload date:
- Size: 19.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2547145200c3fbcc2d6c578c02db20774b6d1e4f5c854264a2caf2e7e772744
|
|
| MD5 |
33eecb7033ec1b1c5cf1337075fcbdff
|
|
| BLAKE2b-256 |
dda588d9f645ec90dd0e735ae822ac1f14b3d1c8371a628e958689c81efc941f
|