Last active
September 12, 2018 00:22
-
-
Save felipem775/8d1108a98e7d69adc05d to your computer and use it in GitHub Desktop.
tinymp4 adventure time && archer renamer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BASEDIR="$PWD/.." | |
for f in "$BASEDIR"/*.mp4 | |
do | |
fbname=$(basename "$f" .mp4) | |
SEASON=${fbname:0:2} | |
FOLDER=$SEASON | |
if [ "$FOLDER" -eq "00" ];then FOLDER="Extras";fi | |
EPISODE=${fbname:3:2} | |
NAME=${fbname:7} | |
if [ ! -d "$BASEDIR"/$SEASON ]; then | |
mkdir "$BASEDIR"/$FOLDER | |
fi | |
ln "$f" "$BASEDIR/$FOLDER/S${SEASON}E${EPISODE}${NAME}.mp4" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment