Skip to content

Commit

Permalink
Merge pull request #41 from Arial-Z/dev
Browse files Browse the repository at this point in the history
Fix seasonal script
  • Loading branch information
Arial-Z authored Nov 30, 2024
2 parents 81da12f + 2a46e03 commit c47b70c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion animes-renamer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=""
Expand Down
4 changes: 3 additions & 1 deletion movies-renamer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=""
Expand Down
6 changes: 3 additions & 3 deletions seasonal-animes-download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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='</title' 'RT{gsub(/.*<title[^>]*>/,"");print;exit}' "$SCRIPT_FOLDER/config/tmp/this-season.html" | awk '{print $4}'| tr '[:lower:]' '[:upper:]')
year=$(awk -v IGNORECASE=1 -v RS='</title' 'RT{gsub(/.*<title[^>]*>/,"");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='</title' 'RT{gsub(/.*<title[^>]*>/,"");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='</title' 'RT{gsub(/.*<title[^>]*>/,"");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"
Expand Down

0 comments on commit c47b70c

Please sign in to comment.