diff --git a/animes-renamer.sh b/animes-renamer.sh index e117c3b..7af664c 100755 --- a/animes-renamer.sh +++ b/animes-renamer.sh @@ -3,6 +3,7 @@ SCRIPT_FOLDER=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) media_type="animes" source "$SCRIPT_FOLDER/config/.env" +source "$SCRIPT_FOLDER/VERSION" source "$SCRIPT_FOLDER/functions.sh" METADATA=$METADATA_ANIMES OVERRIDE=override-ID-$media_type.tsv @@ -162,7 +163,8 @@ printf "%s - Done\n\n" "$(date +%H:%M:%S)" # write PMM metadata file from ID/animes.tsv and jikan API printf "%s - Start writing the metadata file \n" "$(date +%H:%M:%S)" | tee -a "$LOG" -printf "metadata:\n" > "$METADATA" +printf "# Romaji-Renamer v%s\n" "$version" > "$METADATA" +printf "metadata:\n" >> "$METADATA" tvdb_id="" anilist_id="" mal_id="" diff --git a/movies-renamer.sh b/movies-renamer.sh index 352a01f..6ce8614 100755 --- a/movies-renamer.sh +++ b/movies-renamer.sh @@ -3,6 +3,7 @@ SCRIPT_FOLDER=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) media_type="movies" source "$SCRIPT_FOLDER/config/.env" +source "$SCRIPT_FOLDER/VERSION" source "$SCRIPT_FOLDER/functions.sh" METADATA=$METADATA_MOVIES OVERRIDE=override-ID-$media_type.tsv @@ -81,7 +82,8 @@ printf "%s - Done\n\n" "$(date +%H:%M:%S)" | tee -a "$LOG" # write PMM metadata file from ID/movies.tsv and jikan API printf "%s - Start writing the metadata file \n" "$(date +%H:%M:%S)" | tee -a "$LOG" -printf "metadata:\n" > "$METADATA" +printf "# Romaji-Renamer v%s\n" "$version" > "$METADATA" +printf "metadata:\n" >> "$METADATA" imdb_id="" anilist_id="" mal_id="" diff --git a/seasonal-animes-download.sh b/seasonal-animes-download.sh index 5ebe0e0..cb79b3d 100755 --- a/seasonal-animes-download.sh +++ b/seasonal-animes-download.sh @@ -21,9 +21,9 @@ fi printf "%s - Starting script\n\n" "$(date +%H:%M:%S)" | tee -a "$LOG" download-anime-id-mapping printf "%s - checking current season\n" "$(date +%H:%M:%S)" | tee -a "$LOG" -curl -s -L -A "Mozilla/5.0 (X11; Linux x86_64)" "https://anidb.net/anime/season/" -o "$SCRIPT_FOLDER/config/tmp/this-season.html" -season=$(awk -v IGNORECASE=1 -v RS=']*>/,"");print;exit}' "$SCRIPT_FOLDER/config/tmp/this-season.html" | awk '{print $4}'| tr '[:lower:]' '[:upper:]') -year=$(awk -v IGNORECASE=1 -v RS=']*>/,"");print;exit}' "$SCRIPT_FOLDER/config/tmp/this-season.html" | awk '{print $5}') +curl -s -L -A "Mozilla/5.0 (X11; Linux x86_64)" "https://myanimelist.net/anime/season" -o "$SCRIPT_FOLDER/config/tmp/this-season.html" +season=$(awk -v IGNORECASE=1 -v RS=']*>/,"");print;exit}' "$SCRIPT_FOLDER/config/tmp/this-season.html" | awk '{print $1}'| tr '[:lower:]' '[:upper:]'| tr -d '\n') +year=$(awk -v IGNORECASE=1 -v RS=']*>/,"");print;exit}' "$SCRIPT_FOLDER/config/tmp/this-season.html" | awk '{print $2}'| tr -d '\n') printf "%s - Current season : %s %s\n\n" "$(date +%H:%M:%S)" "$season" "$year" | tee -a "$LOG" printf "%s - Creating seasonal list\n" "$(date +%H:%M:%S)" | tee -a "$LOG" printf "%s\t - Downloading anilist season list\n" "$(date +%H:%M:%S)" | tee -a "$LOG"