Deleted rename_srt.sh

This commit is contained in:
tastytea 2019-07-02 19:24:24 +02:00
parent a254137eb5
commit 0f6c2b6a99
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 0 additions and 20 deletions

View File

@ -3,5 +3,4 @@
| urlhandler | Open URLs based on regular expressions. |
| yt2mpd.sh | Adds an Youtube video to MPD, with correct title and duration. |
| fetch_gaidao.sh | Auf neue Ausgaben von der Gai Dao prüfen, herunterladen. |
| rename_srt.sh | Rename srt files to match video files. |
| srtadrm | Remove ads from SRT files with a list of POSIX extended regular expressions. |

View File

@ -1,19 +0,0 @@
#!/bin/sh
# Rename srt files to match video files
videofiles=""
if [ -z "${1}" ]; then
echo "usage: ${0} /path/to/videofiles" >&2
exit 1
else
videofiles="${1}"
fi
for file in *.srt; do
episode=$(echo "${file}" | grep -Eo '[0-9]{2}[. ]' | cut -d. -f1 | cut -d" " -f1)
newfile="$(ls ${videofiles}/*[Ee]${episode}*)"
newfile=$(basename "${newfile}")
mv -v "${file}" "${newfile}"
done
rename -v .mp4 .srt *