Skip to content

Instantly share code, notes, and snippets.

@krzmaz
Created May 5, 2025 21:41
Show Gist options
  • Save krzmaz/cd435c73ad0dcc219a40361782c0e220 to your computer and use it in GitHub Desktop.
Save krzmaz/cd435c73ad0dcc219a40361782c0e220 to your computer and use it in GitHub Desktop.
Napiprojekt subtitles download script
#!/bin/sh
# Napiprojekt Subtitles download by ID
# A crude script which allows you to download movie subtitles from Napiprojekt servers by their ID.
# To get the ID go to the webpage https://www.napiprojekt.pl/napisy-szukaj,
# search for desired title, go to subtitles catalogue and get the ID from the links
# Then, just run it with the ID as parameter :
# ./NapiprojektSubtitlesDownloader d05ce44cda59d7ab5217aae63f1da8dc
# base64 command has a different set of arguments on Mac
case $(uname) in
'Darwin')
extra_arg='-i';
esac
curl -X POST -s -F mode=17 -F client=NapiProjekt -F downloaded_subtitles_id=$1 http://napiprojekt.pl/api/api-napiprojekt3.php | xmllint --xpath 'string(/result/subtitles/content)' - > temp.7z && \
base64 -d $extra_arg temp.7z > dec.7z && \
7z e -y -bso0 -bsp0 -p"iBlm8NTigvru0Jr0" -o"." "dec.7z"
rm -f temp.7z dec.7z
@wrozwad
Copy link

wrozwad commented May 6, 2025

Works like a charm, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment