CLI tool for downloading subtitles from napiprojekt.pl
Project description
napi-py ![Build Status](https://pypi-camo.freetls.fastly.net/21b6b7fdafb06a0e4ba6e7aeaf8a1e82c80c365d/68747470733a2f2f7472617669732d63692e636f6d2f656d6b6f722f6e6170692d70792e7376673f6272616e63683d6d6173746572)
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
- on Debian-based distros with
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
- open the movie web page on
development
make config
installsvenv
under.venv/napi-py
make test
runs testsmake build
creates 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.1.1.tar.gz
(6.4 kB
view hashes)
Built Distribution
napi_py-1.1.1-py3-none-any.whl
(19.6 kB
view hashes)