Pomoc wywolanie scryptu post processing w Bazarr

lukjod

Entry Technician
Q Associate
2 Lipiec 2014
43
1
7
8
50
Warszawa
QNAP
TS-x64
Ethernet
1 GbE
po sciagnieciu napisow przez bazarr chce wywolac skrypt postprocessing ktory skopiuje i zmieni napisy name.pl.srt na name.1.srt aby moj przed web os LG TV wyswietlil napisy po polsku jezeli beda dostepne gdyz tylko alfabetycznie moze je wywolac przez dlna. Gdy sa napisy .en.srt i pl.srt w tym samym katalogu zawsze wybierze .en.srt chyba zeby pl.srt ny,y zapisane rowniez jako np 1.srt wtedy bedzie ok.

problem:
skrypt podaje wartosci w pythonie i nie wiem jak to ugryzc z basha, choc pewnie da tez rade to jakos zrobic pythonem:
bazarr udostepnia
Kod:
{{directory}}
The full path of the episode file parent directory.
{{episode}}
The full path of the episode file.
{{episode_name}}
The filename of the episode without parent directory or extension.
{{subtitles}}
The full path of the subtitles file.
{{subtitles_language}}
The language of the subtitles file.
{{subtitles_language_code2}}
The 2-letter ISO-639 language code of the subtitles language.
{{subtitles_language_code3}}
The 3-letter ISO-639 language code of the subtitles language.
a ja chce wywolac cos w stylu:
Kod:
#!/bin/bash

for f in "{{subtitles}}"/*.pl.srt; do cp "$f" "${f%.pl.srt}.1.srt" ; done
for f in "{{subtitles}}"/*.en.srt; do cp "$f" "${f%.en.srt}.2.srt" ; done


Prosze o jakas pomoc