Gitlab to Gitea Migration

This commit is contained in:
Pakobbix 2022-07-02 13:07:12 +02:00
parent afeec7815d
commit f2408d0ec5
22 changed files with 2313 additions and 3 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# ignoriere die Renamelist damit diese nicht überschrieben wird bei einem Update/pullen
renamelist
JDAutoConfig

103
README.md
View File

@ -1,3 +1,104 @@
# JDownloader-Autoenc-rename
Linux Skripte zum automatischen encode zu HEVC/AC3 und umbenennen via FileBot (Multilanguage)
Linux scripts to automatically encode to HEVC and special audio codecs (eac3 & dts) to AC3 and rename via FileBot.
# Experimental! Only tested with german and english !!
# Requirements
I try to use as few external programs as possible, so that everyone can use them regardless of hardware. But there are still some tools you'll need:
- [JDownloader](https://jdownloader.org/jdownloader2) + Archive Extractor + Event Scripter
- JDownloader obious. Archive Extractor + Event Scripter so the script can be startet if archive is successfully unpacked.
- FFmpeg (If used with Nvidia, [use this guide for NVENC encoding](https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/))
- For encoding. Also used for checking codecs and duration (via ffprobe command).
- [Filebot](https://www.filebot.net/#download) (I use version 4.8.5 myself)
- For renaming. Best match rate so unrivaled if you ask me.
- Bash version 4 or higher ( bash --version so enter command in terminal)
- Some commands need bash v4 like for converting to lower/uppercase.
- whiptail (Only for the config script) Is preinstalled on almost all Linux distributions, as well as on Synology devices.
- i choose whiptail for the config script, because it's more available than dialogue and i like the style.
- A script folder /home/$USER/.local/scripts as default in the scripts)
- A folder for downloads (in the JDownloader settings)
- A folder for unpacking (/mnt/downloads/entpack/ as default in the scripts)
- A folder for encoding (/mnt/media/encode/ as default in the scripts)
Optional:
- A logfile (folder)
- Folder for sorting (movies, series, anime /mnt/media/* as default in the scripts).
# Notifications:
You can setup Discord Nextcloud Talk and/or Apprise Notifications if:
- File already exists (encoding error)
- Duration of encoded video doesn't match sourcefile (encoding error)
- FileBot couldn't rename files 3 times in a row
# Known Bugs:
- FileBot can't rename files sometimes, even if it restarts the whole process 2 times in a row. Need to manually start jdautoenc.sh again, works first time.. always. Dunno (detects the right anime/series/movie but couldn't move them, or access them. Working on it)
# Little info
I am far from being a professional, and there are definitely a LOT!!! Things that could be improved.
Also: these scripts are only **part universal**. There may well be some problems.
By default, Nvidia's NVENC is specified for encoding, since I only have Nvidia graphics cards.
I had created the scripts to automate as much as possible. And either everything was out of date, or only partially automated.
# What do the scripts do?
JDownloader starts the **jdautoenc.sh** script after unpacking. This checks if a script is already running and then waits.
After that the script checks the length of the videos in the unpacked folder, the used video codec and audio codec and decides how to encode the video. Then it deletes the source file (if FFmpeg was successful and the encoded video duration match the sourcefile duration).
Once all files found by **jdautoenc.sh** in the unpacked folder are encoded, it starts the **rename.sh** script.
The **rename.sh** script again first checks if the jdautoenc.sh was still started and waits for the completion.
Then the script starts to rename the files in the encoded folder.
And because I'm such a lazy pig, there is also a **addrename** and **removerename** script. With these two it is relatively easy to add new rename options or delete old ones.
In JDownloader (if you use my.jdownloader.org) just add the codeblock in the scripts field and change the path (/home/hhofmann/.local/scripts/) to your path:
```
[{"eventTrigger": "ON_ARCHIVE_EXTRACTED", "enabled":true, "name": "AutoENC", "script": "var script = '/home/hhofmann/.local/scripts/jdautoenc.sh'\n\nvar path = archive.getFolder()\nvar name = archive.getName()\nvar label = archive.getDownloadLinks() && archive.getDownloadLinks()[0]. getPackage().getComment() ? archive.getDownloadLinks()[0].getPackage(). getComment() : 'N/A'\n\nvar command = [script, path, name, label, 'ARCHIVE_EXTRACTED']\n\nlog(command)\nlog(callSync(command))\n", "eventTriggerSettings":{"isSynchronous":false}, "id":1639245703676}]
```
# JD in Docker:
If you have JD2 running in Docker, this shouldn't be a problem, as long as ffmpeg is included. You just need to add the path to the scripts in the volume parameters.
add to the docker pull command:
```
-v /path/of/scripts:/docker/internal/path
```
or if you use docker-compose:
```
volumes:
- /path/to/the/scripts:/container/internal/path/to/the/scripts
```
and then tell JD2 in Docker that's where the scripts are. You will of course then need to adjust the paths for the folders & other scripts in startcode.sh or via config.sh to match the internal container paths.
You can disable encoding via JDAutoConfig or config.sh script as long as software encoding isn't available or ffmpeg can't be installed.
# What else to do:
For the **jdautoenc** script:
- Clearer FFmpeg stats in the log.
- Wrappers like ffpb don't work unfortunately.
- Adapt script to maybe encode videos that are not packed in archives as well
for the **rename** script
- Improved movie matching.
General:
- more stable workflow
- fixing bugs
- add more language files

150
addrename.sh Normal file
View File

@ -0,0 +1,150 @@
#!/bin/bash
## Farben für das Log
white='\033[0;37m' # ${white}
yellow='\033[0;33m' # ${yellow}
purple='\033[0;35m' # ${purple}
blue='\033[0;34m' # ${blue}
lblue='\033[1;34m' # ${lblue}
cyan='\033[0;36m' # ${cyan}
## Rename Skript Pfad:
JDAutoConfig=$(find ~ -type f -name "JDAutoConfig" 2>/dev/null)
renamelist=$(grep "renamelist=" "$JDAutoConfig" | sed 's/renamelist=//g')
language_Folder=$(grep "language_folder=" "$JDAutoConfig" | sed 's/.*=//g')
if [[ -n $(grep "language=" "$JDAutoConfig" | sed 's/.*=//g') ]]; then
language=$(grep "language=" "$JDAutoConfig" | sed 's/.*=//g')
else
language=$(locale | head -n 1 | sed 's/.*=\|\..*//g')
fi
if [[ $language == "C" ]] || [[ ! -d $language_Folder/$language ]]; then
language=en_US
fi
text_lang() {
if [ -f "$language_Folder"/"$language"/addrename.lang ]; then
grep "$1" "$language_Folder"/"$language"/addrename.lang | sed 's/^....//'
else
curl -s https://raw.githubusercontent.com/Pakobbix/JDownloader-Autoenc-rename/main/lang/en_US/addrename.lang | grep "$1" | sed 's/^....//'
fi
}
get_DB() {
grep "$1DB=" "$JDAutoConfig" | sed 's/.*=//g'
}
curl_name() {
if [[ $dbid == "TheTVDB" ]]; then
if [[ -z $(curl -sL https://www.thetvdb.com/dereferrer/series/"$dbentry" | grep -i -A1 "deu" | grep "data-title" | sed 's/.*="\|"//g' | sed "s/’/'/g") ]]; then
curl -sL https://www.thetvdb.com/dereferrer/series/"$dbentry" | grep -i -A1 "en" | grep "data-title" | sed 's/.*="\|"//g' | sed "s/’/'/g" | head -n 1
else
curl -sL https://www.thetvdb.com/dereferrer/series/"$dbentry" | grep -i -A1 "deu" | grep "data-title" | sed 's/.*="\|"//g' | sed "s/’/'/g" | head -n 1
fi
elif [[ $dbid == "TheMovieDB::TV" ]]; then
curl -sL https://www.themoviedb.org/tv/"$dbentry" | grep -i "TV Series" | sed -e 's/<[^>]*>\|(TV.*//g'
elif [[ $dbid == "TheMovieDB" ]]; then
curl -sL https://www.themoviedb.org/movie/"$dbentry" | grep -i "The Movie Database (TMDB)" | grep title | sed -e 's/<[^>]*>\|&#.*//g'
elif [[ $dbid == "AniDB" ]]; then
curl -sL -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0" https://anidb.net/anime/"$dbentry" | grep -i -A1 "Synonym" | sed 's/<[^>]*>\|Synonym\|\t//g' | sed '/^$/d'
fi
}
curl_movie_name() {
curl -sL "https://themoviedb.org/movie/$dbentry" | grep -i "<title>" | sed -e 's/<[^>]*>//g' | sed 's/&#[0-9].*//g'
}
get_db_id() {
if [[ $dbid == "TheTVDB" ]]; then
if [ -z "$key2" ]; then
echo -e "${purple}https://thetvdb.com/search?query=""$key1""${white}"
else
echo -e "${purple}https://thetvdb.com/search?query=""$key1""%20""$key2""${white}"
fi
elif [[ $dbid == "TheMovieDB" ]] || [[ $dbid == "TheMovieDB::TV" ]]; then
if [ -z "$key2" ]; then
echo -e "${purple}https://www.themoviedb.org/search?language=de&query=""$key1""${white}"
else
echo -e "${purple}https://www.themoviedb.org/search?language=de&query=""$key1""%20""$key2""${white}"
fi
elif [[ $dbid == "AniDB" ]]; then
if [ -z "$key2" ]; then
echo -e "${purple}https://anidb.net/anime/?adb.search=$key1&do.update=Search&noalias=1${white}"
else
echo -e "${purple}https://anidb.net/anime/?adb.search=$key1%20$key2&do.update=Search&noalias=1${white}"
fi
fi
}
while true; do
read -rp "$(echo -e "$(text_lang "001")" "${cyan}""$(text_lang "002")""${white}" "$(text_lang "003")" "${blue}""$(text_lang "004")""${white}"/"${lblue}""$(text_lang "005")""${white}" "$(text_lang "006")") ($(text_lang "007")): " adding
if [[ ${adding,,} == *"anime"* ]]; then
read -rp "$(echo -e "$(text_lang "008")" "${purple}""$(text_lang "009")""${white}" "$(text_lang "010")" "$adding" "$(text_lang "011")") " key1
read -rp "$(echo -e "${yellow}""$(text_lang "012")""${white}", "$(text_lang "013")") " key2
dbid=$(get_DB "Anime")
get_db_id
read -rp "$(echo -e "$(text_lang "019")" "${purple}""$dbid""${white}" "$(text_lang "020")") " dbentry
echo "$(text_lang "014") $(curl_name)"
read -rp "$(text_lang "015")" wrongformat
if [ "${wrongformat,,}" == "n" ]; then
text_lang "016"
exit
else
{
curl_name
echo "$key1"
echo "$key2"
echo "Anime"
echo "$dbentry"
echo ""
} >>"$renamelist"
fi
elif [[ ${adding,,} == *"serie"* ]]; then
read -rp "$(echo -e "$(text_lang "008")" "${purple}""$(text_lang "009")""${white}" "$(text_lang "010")" "$adding" "$(text_lang "011")") " key1
read -rp "$(echo -e "${yellow}""$(text_lang "012")""${white}", "$(text_lang "013")") " key2
dbid=$(get_DB "Series")
get_db_id
read -rp "$(echo -e "$(text_lang "019")" "${purple}""$dbid""${white}" "$(text_lang "020")") " dbentry
echo "$(text_lang "017") $(curl_name)"
read -rp "$(text_lang "015")" wrongformat
if [ "${wrongformat,,}" == "n" ]; then
text_lang "016"
exit
else
{
curl_name
echo "$key1"
echo "$key2"
echo "Series"
echo "$dbentry"
echo ""
} >>"$renamelist"
fi
elif [[ ${adding,,} == *"film"* ]]; then
read -rp "$(echo -e "$(text_lang "008")" "${purple}""$(text_lang "009")""${white}" "$(text_lang "010")" "$adding" "$(text_lang "011")") " key1
read -rp "$(echo -e "${yellow}""$(text_lang "012")""${white}", "$(text_lang "013")") " key2
dbid=$(get_DB "Movie")
get_db_id
read -rp "$(echo -e "$(text_lang "019")" "${purple}"TheMovieDB ID"${white}" "$(text_lang "020")""\n($(text_lang "021"))") " dbentry
echo "$(text_lang "018") $(curl_movie_name)"
read -rp "$(text_lang "015")" wrongformat
if [ "${wrongformat,,}" == "n" ]; then
text_lang "016"
exit
else
{
curl_movie_name
echo "$key1"
echo "$key2"
echo "Movie"
echo "$dbentry"
echo ""
} >>"$renamelist"
fi
elif [[ ${adding,,} == *"beenden"* ]] || [[ ${adding,,} == *"exit"* ]]; then
break
fi
done

791
config.sh Normal file
View File

@ -0,0 +1,791 @@
#!/bin/bash
# Sucht JDAutoConfig und fragt, ob dies der richtige Pfad ist.
JDAutoConfig=$(find ~ -type f -iname "JDAutoConfig" 2>/dev/null)
# Funktion für später, um z.B. zenity statt whiptail zu nutzen.
language_Folder=$(grep "language_folder=" "$JDAutoConfig" | sed 's/.*=//g')
if [[ -n $(grep "language=" "$JDAutoConfig" | sed 's/.*=//g') ]]; then
language=$(grep "language=" "$JDAutoConfig" | sed 's/.*=//g')
else
language=$(locale | head -n 1 | sed 's/.*=\|\..*//g')
fi
if [[ $language == "C" ]] || [[ ! -d $language_Folder/$language ]]; then
language=en_US
fi
possiblelangfolder=$(find ~ -type f -wholename "*lang/$language/config.lang" 2>/dev/null | sed 's/en_US\/config.lang//g')
if ! [ -f "$language_Folder"/"$language"/config.lang ]; then
real_language_Folder=$(whiptail --title "Could not find language folder" --inputbox "WARNING!! Language folder could not be found. Please type the Path to the language folder or else, the script will try to get the language from Github (could be buggy)\nPossible Path: $possiblelangfolder" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
sed -i "s/language_folder=.*/language_folder=$real_language_Folder/g" "$JDAutoConfig"
fi
text_lang() {
if [ -f "$language_Folder"/"$language"/config.lang ]; then
grep "$1" "$language_Folder"/"$language"/config.lang | sed 's/^....//'
else
curl -s https://raw.githubusercontent.com/Pakobbix/JDownloader-Autoenc-rename/main/lang/en_US/config.lang | grep "$1" | sed 's/^....//'
fi
}
check_skript_location() {
if ! $1 --title "$(text_lang "001")" --"$2" "$JDAutoConfig" 16 100; then
unset JDAutoConfig
JDAutoConfig=$($1 --title "$(text_lang "002")" --"$3" "$(text_lang "003")" 16 100 "$4" 3>&2 2>&1 1>&3)
fi
}
change_path() {
if [[ -z $2 ]]; then
whiptail --title "$(text_lang "005")" --msgbox "$(text_lang "005")" 16 50
return
else
if sed -i "s/$1/$2/g" "$JDAutoConfig"; then
whiptail --title "$(text_lang "006") $4 $(text_lang "007")" --msgbox "$(text_lang "008")\n$2" 16 100
else
whiptail --title "$(text_lang "009")" --msgbox "$(text_lang "010") $2\n$(text_lang "011")" 16 100
fi
fi
}
db_auswhal() {
choose_db=$(
whiptail --title "$(text_lang "012")" --menu "" 20 100 12 \
"1)" "TheMovieDB" \
"2)" "TheMovieDB::TV" \
"3)" "TheTVDB" \
"4)" "AniDB" \
"5)" "$(text_lang "017")" 3>&2 2>&1 1>&3
)
case $choose_db in
"1)")
newdb="TheMovieDB"
;;
"2)")
newdb="TheMovieDB::TV"
;;
"3)")
newdb="TheTVDB"
;;
"4)")
newdb="AniDB"
;;
"5)")
return
;;
esac
}
bitrate_auswahl() {
whiptail --title "$1 $(text_lang "013")" --radiolist "$(text_lang "014") $1 an:\n$(text_lang "015")" 20 100 12 \
"1000" "$(text_lang "016") 1000K" OFF \
"1100" "$(text_lang "016") 1100K" OFF \
"1200" "$(text_lang "016") 1200K" OFF \
"1300" "$(text_lang "016") 1300K" OFF \
"1400" "$(text_lang "016") 1400K" $2 \
"1500" "$(text_lang "016") 1500K" OFF \
"1600" "$(text_lang "016") 1600K" OFF \
"1700" "$(text_lang "016") 1700K" $3 \
"1800" "$(text_lang "016") 1800K" OFF \
"1900" "$(text_lang "016") 1900K" OFF \
"2000" "$(text_lang "016") 2000K" $4 \
"2100" "$(text_lang "016") 2100K" OFF \
"2200" "$(text_lang "016") 2200K" OFF \
"2300" "$(text_lang "016") 2300K" OFF \
"2400" "$(text_lang "016") 2400K" OFF \
"2500" "$(text_lang "016") 2500K" OFF \
"2600" "$(text_lang "016") 2600K" OFF \
"2700" "$(text_lang "016") 2700K" OFF \
"2800" "$(text_lang "016") 2800K" OFF \
"2900" "$(text_lang "016") 2900K" OFF \
"3000" "$(text_lang "016") 3000K" OFF 3>&1 1>&2 2>&3
}
preset_auswahl() {
whiptail --title "$1 $(text_lang "018")" --radiolist "$(text_lang "019") $1 :\n$(text_lang "015")" 20 120 12 \
"Ultrafast" "$(text_lang "020")" OFF \
"superfast" "$(text_lang "021")" OFF \
"veryfast" "$(text_lang "021")" OFF \
"faster" "$(text_lang "022")" OFF \
"fast" "$(text_lang "023")" ON \
"medium" "$(text_lang "024")$2" OFF \
"slow" "$(text_lang "025")" OFF \
"slower" "$(text_lang "026")" OFF \
"veryslow" "$(text_lang "027")$3" OFF \
"hq" "$(text_lang "028")" OFF \
"lossless" "$(text_lang "029")" OFF 3>&1 1>&2 2>&3
}
# Fragt, ob der gefundene Pfad zur startencode.sh der richtige ist.
check_skript_location whiptail yesno inputbox
# Loop das Hauptmenü
while true; do
# Aufbau des Menüs
Wahl=$(
whiptail --title "$(text_lang "030")" --menu "$(text_lang "031")\n$(text_lang "032")" 20 100 9 \
"1)" "$(text_lang "033")" \
"2)" "$(text_lang "034")" \
"3)" "$(text_lang "035")" \
"4)" "$(text_lang "036")" \
"5)" "$(text_lang "037")" \
"6)" "$(text_lang "038")" \
"7)" "$(text_lang "017")" 3>&2 2>&1 1>&3
)
# Zuordnung Funktionen zu Menüpunkten
case $Wahl in
"1)")
# Abfrage, ob alle Skripte (startencode.sh, jdautoenc.sh und rename.sh) am selben Ort sind, um den generellen Pfad auf diesen umzustellen
if whiptail --title "$(text_lang "039")" --yesno "$(text_lang "040") ${JDAutoConfig//JDAutoConfig/} $(text_lang "041")\n\n$(text_lang "042")" 20 100; then
newpath=$(echo "${JDAutoConfig//\/JDAutoConfig/}" | sed -e "s#/#\\\/#g")
jdautoencpfad=$(grep "jdautoenc=" "$JDAutoConfig" | sed 's/jdautoenc=\|["]//g' | sed -e "s#/#\\\/#g")
renamepfad=$(grep "rename=" "$JDAutoConfig" | sed 's/rename=\|["]//g' | sed -e "s#/#\\\/#g")
renamelist=$(grep "renamelist=" "$JDAutoConfig" | sed 's/renamelist=\|["]//g' | sed -e "s#/#\\\/#g")
change_path "$jdautoencpfad" "$newpath\/jdautoenc.sh" "$JDAutoConfig" "jdautoenc.sh"
change_path "$renamepfad" "$newpath\/rename.sh" "$JDAutoConfig" "rename.sh"
change_path "$renamelist" "$newpath\/renamelist" "$JDAutoConfig" "renamelist"
fi
jdautoencpfad=$(grep "jdautoenc=" "$JDAutoConfig" | sed 's/jdautoenc=\|["]//g' | sed -e "s#/#\\\/#g")
renamepfad=$(grep "rename=" "$JDAutoConfig" | sed 's/rename=\|["]//g' | sed -e "s#/#\\\/#g")
renamelist=$(grep "renamelist=" "$JDAutoConfig" | sed 's/renamelist=\|["]//g' | sed -e "s#/#\\\/#g")
entpacktpfad=$(grep "extracted=" "$JDAutoConfig" | sed 's/extracted=\|["]//g' | sed -e "s#/#\\\/#g")
encodespfad=$(grep "encodes=" "$JDAutoConfig" | sed 's/encodes=\|["]//g' | sed -e "s#/#\\\/#g")
logpfad=$(grep "log=" "$JDAutoConfig" | sed 's/log=\|["]//g' | sed -e "s#/#\\\/#g")
FilmPfad=$(grep "Movies=" "$JDAutoConfig" | sed 's/Movies=\|["]//g' | sed -e "s#/#\\\/#g")
SerienPfad=$(grep "Series=" "$JDAutoConfig" | sed 's/Series=\|["]//g' | sed -e "s#/#\\\/#g")
AnimePfad=$(grep "Animes=" "$JDAutoConfig" | sed 's/Animes=\|["]//g' | sed -e "s#/#\\\/#g")
# Neues Menü Loop für das ändern von Pfaden
while true; do
# ____ _ _ ____ _ _ _
# | _ \ __ _| |_| |__ / ___| ___| |_| |_(_)_ __ __ _ ___
# | |_) / _` | __| '_ \ \___ \ / _ \ __| __| | '_ \ / _` / __|
# | __/ (_| | |_| | | | ___) | __/ |_| |_| | | | | (_| \__ \
# |_| \__,_|\__|_| |_| |____/ \___|\__|\__|_|_| |_|\__, |___/
# |___/
Wahl=$(
whiptail --title "$(text_lang "043")" --menu "$(text_lang "044")" 22 100 13 \
"1)" "jdautoenc.sh $jdautoencpfad" \
"2)" "rename.sh $renamepfad" \
"3)" "renamelist $renamelist" \
"" "" \
"4)" "$(text_lang "045") $entpacktpfad" \
"5)" "$(text_lang "046") $encodespfad" \
"6)" "$(text_lang "047") $logpfad" \
"" "" \
"7)" "$(text_lang "048") $FilmPfad" \
"8)" "$(text_lang "049") $SerienPfad" \
"9)" "$(text_lang "050") $AnimePfad" \
"" "" \
"10)" "$(text_lang "017")" 3>&2 2>&1 1>&3
)
case $Wahl in
"1)")
# jdautoenc.sh Pfad
newjdautopfad=$(whiptail --title "$(text_lang "051")" --inputbox "$(text_lang "052") jdautoenc.sh:" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
change_path "$jdautoencpfad" "$newjdautopfad" "$JDAutoConfig" "jdautoenc.sh"
;;
"2)")
# rename.sh Pfad
newrenamepfad=$(whiptail --title "$(text_lang "051")" --inputbox "$(text_lang "052") rename.sh:" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
change_path "$renamepfad" "$newrenamepfad" "$JDAutoConfig" "rename.sh"
;;
"3)")
# renamelist Pfad
newrenamelist=$(whiptail --title "$(text_lang "051")" --inputbox "$(text_lang "052") die renamelist:" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
change_path "$renamelist" "$newrenamelist" "$JDAutoConfig" "renamelist"
;;
"4)")
# Ordnerpfad für den Ordner in dem entpackte Videos liegen.
newentpackpfad=$(whiptail --title "$(text_lang "051")" --inputbox "$(text_lang "053")" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
change_path "$entpacktpfad" "$newentpackpfad" "$JDAutoConfig" "$(text_lang "045")"
;;
"5)")
# Orderpfad in dem die encodierten Videos hinterlegt werden.
newencodesfolder=$(whiptail --title "$(text_lang "051")" --inputbox "$(text_lang "054")" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
change_path "$encodespfad" "$newencodesfolder" "$JDAutoConfig" "$(text_lang "046")"
;;
"6)")
# Log Pfad. Hier wird das Log hingeschrieben
newlogpfad=$(whiptail --title "$(text_lang "051")" --inputbox "$(text_lang "052") log." 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
change_path "$logpfad" "$newlogpfad" "$JDAutoConfig" "Log Pfad"
;;
"7)")
# Log Pfad. Hier wird das Log hingeschrieben
newFilmpfad=$(whiptail --title "$(text_lang "051")" --inputbox "$(text_lang "052") $(text_lang "048")" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
change_path "$FilmPfad" "$newFilmpfad" "$JDAutoConfig" "$(text_lang "055")"
;;
"8)")
# Log Pfad. Hier wird das Log hingeschrieben
newSerienpfad=$(whiptail --title "$(text_lang "051")" --inputbox "$(text_lang "052") $(text_lang "049")" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
change_path "$SerienPfad" "$newSerienpfad" "$JDAutoConfig" "$(text_lang "056")"
;;
"9)")
# Log Pfad. Hier wird das Log hingeschrieben
newAnimePfad=$(whiptail --title "$(text_lang "051")" --inputbox "$(text_lang "052") $(text_lang "050")" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
change_path "$AnimePfad" "$newAnimePfad" "$JDAutoConfig" "$(text_lang "057")"
;;
"10)")
# break = Gehe zurück in das vorherige Menü
break
;;
# Ende vom Menü
esac
done
;;
"2)")
# Hier werden die Log Farben angepasst. Muss mir noch überlegen, wie ich die definieren kann.
whiptail --msgbox "Work in Progress" 20 78
;;
"3)")
messagesystem=$(
whiptail --title "$(text_lang "058")" --menu "$(text_lang "059")" 20 100 9 \
"1)" "Discord" \
"2)" "Nextcloud Talk" \
"3)" "Apprise Settings" \
"4)" "coming soon" \
"5)" "$(text_lang "017")" 3>&2 2>&1 1>&3
)
case $messagesystem in
"1)")
# ____ _ _ ____ _ _ _
# | _ \(_)___ ___ ___ _ __ __| | / ___| ___| |_| |_(_)_ __ __ _ ___
# | | | | / __|/ __/ _ \| '__/ _` | \___ \ / _ \ __| __| | '_ \ / _` / __|
# | |_| | \__ \ (_| (_) | | | (_| | ___) | __/ |_| |_| | | | | (_| \__ \
# |____/|_|___/\___\___/|_| \__,_| |____/ \___|\__|\__|_|_| |_|\__, |___/
# |___/
# Ändere Einstellung zu nVidia Encoding
curr_dishook=$(grep "discord=" "$JDAutoConfig" | sed 's/.*=//g')
dishook=$(whiptail --title "$(text_lang "060")" --inputbox "$(text_lang "061") $curr_dishook" 16 100 "$4" 3>&2 2>&1 1>&3 | sed -e "s#/#\\\/#g")
if [ -z "$dishook" ]; then
echo ""
else
sed -i "s/discord=.*/discord=$dishook/g" "$JDAutoConfig"
fi
;;
"2)")
# _ _ _ _ _ ____ _ _ _
# | \ | | _____ _| |_ ___| | ___ _ _ __| | / ___| ___| |_| |_(_)_ __ __ _ ___
# | \| |/ _ \ \/ / __/ __| |/ _ \| | | |/ _` | \___ \ / _ \ __| __| | '_ \ / _` / __|
# | |\ | __/> <| || (__| | (_) | |_| | (_| | ___) | __/ |_| |_| | | | | (_| \__ \
# |_| \_|\___/_/\_\\__\___|_|\___/ \__,_|\__,_| |____/ \___|\__|\__|_|_| |_|\__, |___/
# |___/
curr_NextcloudDomain=$(grep "NextcloudDomain=" "$JDAutoConfig" | sed 's/.*=//g')
curr_NextcloudUser=$(grep "NextcloudUser=" "$JDAutoConfig" | sed 's/.*=//g')
curr_NextcloudPassword=$(grep "NextcloudPassword=" "$JDAutoConfig" | sed 's/.*=//g')
curr_NextcloudToken=$(grep "NextcloudTalkToken=" "$JDAutoConfig" | sed 's/.*=//g')
while true; do
nextcloudmenu=$(
whiptail --title "$(text_lang "062")" --menu "$(text_lang "063")" 20 100 13 \
"1)" "Nextcloud Domain: $(text_lang "064") $curr_NextcloudDomain" \
"2)" "Nextcloud User: $(text_lang "064") $curr_NextcloudUser" \
"3)" "Nextcloud Password: $(text_lang "064") $curr_NextcloudPassword" \
"4)" "Nextcloud Token: $(text_lang "064") $curr_NextcloudToken" \
"5)" "Beenden" 3>&2 2>&1 1>&3
)
case $nextcloudmenu in
"1)")
NextcloudDomain=$(whiptail --title "$(text_lang "065")" --inputbox "$(text_lang "066")\n$(text_lang "067")\n$(text_lang "068")\n\n$(text_lang "064") $curr_NextcloudDomain" 16 100 "$4" 3>&2 2>&1 1>&3 | sed -e "s#/#\\\/#g")
if [ -z "$NextcloudDomain" ]; then
echo ""
else
sed -i "s/NextcloudDomain=.*/NextcloudDomain=$NextcloudDomain/g" "$JDAutoConfig"
fi
;;
"2)")
NextcloudUser=$(whiptail --title "$(text_lang "065")" --inputbox "$(text_lang "069") $(text_lang "064") $curr_NextcloudUser" 16 100 "$4" 3>&2 2>&1 1>&3 | sed -e "s#/#\\\/#g")
if [ -z "$NextcloudUser" ]; then
echo ""
else
sed -i "s/NextcloudUser=.*/NextcloudUser=$NextcloudUser/g" "$JDAutoConfig"
fi
;;
"3)")
NextcloudPassword=$(whiptail --title "$(text_lang "065")" --inputbox "$(text_lang "070") $(text_lang "064") $curr_NextcloudPassword" 16 100 "$4" 3>&2 2>&1 1>&3 | sed -e "s#/#\\\/#g")
if [ -z "$NextcloudPassword" ]; then
echo ""
else
sed -i "s/NextcloudPassword=.*/NextcloudPassword=$NextcloudPassword/g" "$JDAutoConfig"
fi
;;
"4)")
NextcloudTalkToken=$(whiptail --title "$(text_lang "065")" --inputbox "$(text_lang "071")\n$(text_lang "072") $(text_lang "064") $curr_NextcloudToken" 16 100 "$4" 3>&2 2>&1 1>&3 | sed -e "s#/#\\\/#g")
if [ -z "$NextcloudTalkToken" ]; then
echo ""
else
sed -i "s/NextcloudTalkToken=.*/NextcloudTalkToken=$NextcloudTalkToken/g" "$JDAutoConfig"
fi
;;
"5)")
break
;;
esac
done
;;
"3)")
# _ _ ____ _ _ _
# / \ _ __ _ __ _ __(_)___ ___ / ___| ___| |_| |_(_)_ __ __ _ ___
# / _ \ | '_ \| '_ \| '__| / __|/ _ \ \___ \ / _ \ __| __| | '_ \ / _` / __|
# / ___ \| |_) | |_) | | | \__ \ __/ ___) | __/ |_| |_| | | | | (_| \__ \
#/_/ \_\ .__/| .__/|_| |_|___/\___| |____/ \___|\__|\__|_|_| |_|\__, |___/
# |_| |_| |___/
#
curr_appriseurl=$(grep "appriseurl=" "$JDAutoConfig" | sed 's/.*=//g')
curr_apprisetag=$(grep "apprisetag=" "$JDAutoConfig" | sed 's/.*=//g')
while true; do
apprise_menu=$(
whiptail --title "$(text_lang "062")" --menu "$(text_lang "063")" 20 100 13 \
"1)" "Apprise URL+Port: $(text_lang "064") $curr_appriseurl" \
"2)" "Apprise Tag: $(text_lang "064") $curr_apprisetag" \
"3)" "Beenden" 3>&2 2>&1 1>&3
)
case $apprise_menu in
"1)")
appriseurl=$(whiptail --title "$(text_lang "065")" --inputbox "$(text_lang "066")\n$(text_lang "067")\n$(text_lang "068")\n\n$(text_lang "064") $curr_appriseurl" 16 100 "$4" 3>&2 2>&1 1>&3 | sed -e "s#/#\\\/#g")
if [ -z "$curr_appriseurl" ]; then
echo ""
else
sed -i "s/appriseurl=.*/appriseurl=$appriseurl/g" "$JDAutoConfig"
fi
;;
"2)")
apprisetag=$(whiptail --title "$(text_lang "065")" --inputbox "$(text_lang "066")\n$(text_lang "067")\n$(text_lang "068")\n\n$(text_lang "064") $curr_apprisetag" 16 100 "$4" 3>&2 2>&1 1>&3 | sed -e "s#/#\\\/#g")
if [ -z "$apprisetag" ]; then
echo ""
else
sed -i "s/apprisetag=.*/apprisetag=$apprisetag/g" "$JDAutoConfig"
fi
;;
"3)")
break
;;
esac
done
;;
"4)") ;;
"5)")
return 2>/dev/null
;;
esac
# Hier werden die Log Farben angepasst. Muss mir noch überlegen, wie ich die definieren kann.
;;
"4)")
# _____ _ _ ____ _ _ _
# | ____|_ __ ___ ___ __| (_)_ __ __ _ / ___| ___| |_| |_(_)_ __ __ _ ___
# | _| | '_ \ / __/ _ \ / _` | | '_ \ / _` | \___ \ / _ \ __| __| | '_ \ / _` / __|
# | |___| | | | (_| (_) | (_| | | | | | (_| | ___) | __/ |_| |_| | | | | (_| \__ \
# |_____|_| |_|\___\___/ \__,_|_|_| |_|\__, | |____/ \___|\__|\__|_|_| |_|\__, |___/
# |___/ |___/
# Einstellungen für das encoden. (noch in der jdautoenc.sh definiert. Wandern vielleicht bald in das startencode.sh skript)
while true; do
curr_encode_allow=$(if [[ $(grep "encode=" "$JDAutoConfig" | sed 's/.*encode=//g') == "yes" ]]; then echo "Eingeschaltet"; else echo "Ausgeschaltet"; fi)
curr_anime_bitrate=$(grep "bitrate_anime=" "$JDAutoConfig" | sed 's/.*bitrate_anime=//g')
curr_anime_preset=$(grep "preset_anime=" "$JDAutoConfig" | sed 's/.*preset_anime=//g')
curr_serien_bitrate=$(grep "bitrate_series=" "$JDAutoConfig" | sed 's/.*bitrate_series=//g')
curr_serien_preset=$(grep "preset_series=" "$JDAutoConfig" | sed 's/.*preset_series=//g')
curr_filme_bitrate=$(grep "bitrate_movie=" "$JDAutoConfig" | sed 's/.*bitrate_movie=//g')
curr_filme_preset=$(grep "preset_movie=" "$JDAutoConfig" | sed 's/.*preset_movie=//g')
bitratewahl=$(
whiptail --title "$(text_lang "074")" --menu "$(text_lang "075")" 20 100 13 \
"1)" "$(text_lang "076") $curr_encode_allow" \
"2)" "$(text_lang "077") $curr_anime_bitrate K" \
"3)" "$(text_lang "078") $curr_anime_preset" \
"" "" \
"4)" "$(text_lang "079") $curr_serien_bitrate K" \
"5)" "$(text_lang "080") $curr_serien_preset" \
"" "" \
"6)" "$(text_lang "081") $curr_filme_bitrate K" \
"7)" "$(text_lang "082") $curr_filme_preset" \
"" "" \
"8)" "$(text_lang "017")" 3>&2 2>&1 1>&3
)
case $bitratewahl in
"1)")
# Ändere die bitrate für Animes
if whiptail --title "$(text_lang "083")" --yesno "$(text_lang "084")" 20 100; then
sed -i "s/encode=.*/encode=yes/g" "$JDAutoConfig"
else
sed -i "s/encode=.*/encode=no/g" "$JDAutoConfig"
fi
;;
"2)")
# Ändere die bitrate für Animes
new_anime_bitrate=$(bitrate_auswahl "Animes" ON OFF OFF)
sed -i "s/^bitrate_anime.*/bitrate_anime=$new_anime_bitrate/g" "$JDAutoConfig"
;;
"3)")
# Ändere das zu nutzende Preset für Animes
new_anime_preset=$(preset_auswahl "Animes")
sed -i "s/^preset_anime=.*/preset_anime=$new_anime_preset/g" "$JDAutoConfig"
;;
"4)")
# Ändere die bitrate für Serien
new_serien_bitrate=$(bitrate_auswahl "Serien" OFF ON OFF)
sed -i "s/^bitrate_series.*/bitrate_series=$new_serien_bitrate/g" "$JDAutoConfig"
;;
"5)")
# Ändere das zu nutzende Preset für Serien
new_serien_preset=$(preset_auswahl "Serien")
sed -i "s/^preset_series=.*/preset_series=$new_serien_preset/g" "$JDAutoConfig"
;;
"6)")
# Ändere die bitrate für Filme
new_filme_bitrate=$(bitrate_auswahl "Filme" OFF OFF ON)
sed -i "s/^bitrate_movie.*/bitrate_movie=$new_filme_bitrate/g" "$JDAutoConfig"
;;
"7)")
# Ändere das zu nutzende Preset für Filme
new_filme_preset=$(preset_auswahl "Filme")
sed -i "s/^preset_movie=.*/preset_movie=$new_filme_preset/g" "$JDAutoConfig"
;;
"8)")
break
;;
esac
done
;;
"5)")
# _____ _ _ _ ___ __
#| ____|_ __ ___ ___ __| (_)_ __ __ _ | | | \ \ / /
#| _| | '_ \ / __/ _ \ / _` | | '_ \ / _` | | |_| |\ \ /\ / /
#| |___| | | | (_| (_) | (_| | | | | | (_| | | _ | \ V V /
#|_____|_| |_|\___\___/ \__,_|_|_| |_|\__, | |_| |_| \_/\_/
# |___/
# Wir schauen, ob wir kompatible Hardware anzeigen lassen können
gethw=$(lshw -class display 2>/dev/null | grep vendor)
for hw in $gethw; do
if [[ ${hw,,} == *"nvidia"* ]]; then
hw1="\nnVidia $(text_lang "085")"
elif [[ ${hw,,} == *"intel"* ]]; then
hw2="\nIntel iGPU"
elif [[ ${hw,,} == *"radeon"* ]]; then
hw3="\nAMD $(text_lang "085")"
elif [[ ${hw,,} == *"microsoft"* ]]; then
hw4="\nMicrosoft WSL $(text_lang "086")"
fi
done
Hardwareauswahl=$(
whiptail --title "$(text_lang "087")" --menu "$(text_lang "088") $hw1 $hw2 $hw3 $hw4" 20 100 9 \
"1)" "nVidia" \
"2)" "AMD" \
"3)" "Intel QuickSync (Intel CPU)" \
"4)" "Software (noch NICHT IMPLEMENTIERT!)" \
"5)" "Beenden" 3>&2 2>&1 1>&3
)
case $Hardwareauswahl in
"1)")
# Ändere Einstellung zu nVidia Encoding
sed -i 's/Encoder=.*/Encoder=nvidia/g' "$JDAutoConfig"
whiptail --msgbox "$(text_lang "089")\n$(text_lang "090")" 20 78
;;
"2)")
# Ändere Einstellung zu AMD Enconding
sed -i 's/Encoder=.*/Encoder=amd/g' "$JDAutoConfig"
whiptail --msgbox "$(text_lang "091")\n$(text_lang "092")" 20 78
;;
"3)")
# Ändere Einstellung zu Intel Quick Sync Encoding
sed -i 's/Encoder=.*/Encoder=intel/g' "$JDAutoConfig"
whiptail --msgbox "$(text_lang "093")\n$(text_lang "094")" 20 78
;;
"4)")
whiptail --msgbox "$(text_lang "095")" 20 78
return 2>/dev/null
;;
"5)")
return 2>/dev/null
;;
esac
;;
"6)")
# _____ _ _ ____ _ ____ _ _ _
#| ___(_) | ___| __ ) ___ | |_ / ___| ___| |_| |_(_)_ __ __ _ ___
#| |_ | | |/ _ \ _ \ / _ \| __| \___ \ / _ \ __| __| | '_ \ / _` / __|
#| _| | | | __/ |_) | (_) | |_ ___) | __/ |_| |_| | | | | (_| \__ \
#|_| |_|_|\___|____/ \___/ \__| |____/ \___|\__|\__|_|_| |_|\__, |___/
# |___/
while true; do
curr_movie_db=$(grep "MovieDB=" "$JDAutoConfig" | sed 's/.*MovieDB=//g')
curr_series_db=$(grep "SeriesDB=" "$JDAutoConfig" | sed 's/.*SeriesDB=//g')
curr_anime_db=$(grep "AnimeDB=" "$JDAutoConfig" | sed 's/.*AnimeDB=//g')
curr_movie_name=$(grep "MovieName=" "$JDAutoConfig" | sed 's/.*MovieName=//g')
curr_series_name=$(grep "SeriesName=" "$JDAutoConfig" | sed 's/.*SeriesName=//g')
curr_anime_name=$(grep "AnimeName=" "$JDAutoConfig" | sed 's/.*AnimeName=//g')
curr_Language=$(grep "FileBotLang=" "$JDAutoConfig" | sed 's/.*FileBotLang=//g')
FileBotMenu=$(
whiptail --title "$(text_lang "096")" --menu "$(text_lang "097")" 20 100 12 \
"1)" "$(text_lang "098") $curr_movie_db" \
"2)" "$(text_lang "099") $curr_series_db" \
"3)" "$(text_lang "100") $curr_anime_db" \
"" "" \
"4)" "$(text_lang "101") $curr_movie_name" \
"5)" "$(text_lang "102") $curr_series_name" \
"6)" "$(text_lang "103") $curr_anime_name" \
"" "" \
"7)" "$(text_lang "104") $curr_Language" \
"8)" "$(text_lang "017")" 3>&2 2>&1 1>&3
)
case $FileBotMenu in
"1)")
db_auswhal
sed -i "s/MovieDB.*/MovieDB=$newdb/g" "$JDAutoConfig"
;;
"2)")
db_auswhal
sed -i "s/SeriesDB.*/SeriesDB=$newdb/g" "$JDAutoConfig"
;;
"3)")
db_auswhal
sed -i "s/AnimeDB.*/AnimeDB=$newdb/g" "$JDAutoConfig"
;;
"4)")
new_film_name=$(whiptail --title "$(text_lang "051")" --inputbox "$(text_lang "105")\n{n} {y}\nThe Man From Earth 2007.mkv" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
if [[ -n $new_film_name ]]; then
sed -i "s/MovieName=.*/MovieName=$new_film_name/g" "$JDAutoConfig"
else
whiptail --msgbox "$(text_lang "108")" 20 78
fi
;;
"5)")
new_serien_name=$(whiptail --title "$(text_lang "051")" --inputbox "$(text_lang "106")\n{n} {y}/Season {s}/{n} - {s00e00} - {t}\nFirefly 2002/Season 1/Firefly - S01E01 - The Train Job" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
if [[ -n $new_serien_name ]]; then
sed -i "s/SeriesName=.*/SeriesName=$new_serien_name/g" "$JDAutoConfig"
else
whiptail --msgbox "$(text_lang "108")" 20 78
fi
;;
"6)")
new_anime_name=$(whiptail --title "$(text_lang "051")" --inputbox "$(text_lang "107")" 16 100 3>&1 1>&2 2>&3 | sed -e "s#/#\\\/#g")
if [[ -n $new_anime_name ]]; then
sed -i "s/AnimeName=.*/AnimeName=$new_anime_name/g" "$JDAutoConfig"
else
whiptail --msgbox "$(text_lang "108")" 20 78
fi
;;
"7)")
new_lang=$(
whiptail --title "$(text_lang "109")" --radiolist "$(text_lang "110")\n{n} {y}/Season {s}/{n} - {s00e00} - {t}\nElfenlied 2004/Season 1/Elfenlied - S01E01 - A Chance Encounter: Begegnung" 20 100 12 \
"Afar" "aa" OFF \
"Abkhazian" "ab" OFF \
"Afrikaans" "af" OFF \
"Akan" "ak" OFF \
"Albanian" "sq" OFF \
"Amharic" "am" OFF \
"Arabic" "ar" OFF \
"Aragonese" "an" OFF \
"Armenian" "hy" OFF \
"Assamese" "as" OFF \
"Avaric" "av" OFF \
"Avestan" "ae" OFF \
"Aymara" "ay" OFF \
"Azerbaijani" "az" OFF \
"Bashkir" "ba" OFF \
"Bambara" "bm" OFF \
"Basque" "eu" OFF \
"Belarusian" "be" OFF \
"Bengali" "bn" OFF \
"Bihari" "bh" OFF \
"Bislama" "bi" OFF \
"Tibetan" "bo" OFF \
"Bosnian" "bs" OFF \
"Breton" "br" OFF \
"Bulgarian" "bg" OFF \
"Burmese" "my" OFF \
"Catalan" "ca" OFF \
"Czech" "cs" OFF \
"Chamorro" "ch" OFF \
"Chechen" "ce" OFF \
"Chinese" "zh" OFF \
"Church" "cu" OFF \
"Chuvash" "cv" OFF \
"Cornish" "kw" OFF \
"Corsican" "co" OFF \
"Cree" "cr" OFF \
"Welsh" "cy" OFF \
"Czech" "cs" OFF \
"Danish" "da" OFF \
"German" "de" ON \
"Divehi" "dv" OFF \
"Dutch" "nl" OFF \
"Dzongkha" "dz" OFF \
"Greek" "el" OFF \
"English" "en" OFF \
"Esperanto" "eo" OFF \
"Estonian" "et" OFF \
"Basque" "eu" OFF \
"Ewe" "ee" OFF \
"Faroese" "fo" OFF \
"Persian" "fa" OFF \
"Fijian" "fj" OFF \
"Finnish" "fi" OFF \
"French" "fr" OFF \
"French" "fr" OFF \
"Western" "fy" OFF \
"Fulah" "ff" OFF \
"Georgian" "ka" OFF \
"German" "de" OFF \
"Gaelic" "gd" OFF \
"Irish" "ga" OFF \
"Galician" "gl" OFF \
"Manx" "gv" OFF \
"Greek" "el" OFF \
"Guarani" "gn" OFF \
"Gujarati" "gu" OFF \
"Haitian" "ht" OFF \
"Hausa" "ha" OFF \
"Hebrew" "he" OFF \
"Herero" "hz" OFF \
"Hindi" "hi" OFF \
"Hiri" "ho" OFF \
"Croatian" "hr" OFF \
"Hungarian" "hu" OFF \
"Armenian" "hy" OFF \
"Igbo" "ig" OFF \
"Icelandic" "is" OFF \
"Ido" "io" OFF \
"Sichuan" "ii" OFF \
"Inuktitut" "iu" OFF \
"Interlingue" "ie" OFF \
"Interlingua" "ia" OFF \
"Indonesian" "id" OFF \
"Inupiaq" "ik" OFF \
"Icelandic" "is" OFF \
"Italian" "it" OFF \
"Javanese" "jv" OFF \
"Japanese" "ja" OFF \
"Kalaallisut" "kl" OFF \
"Kannada" "kn" OFF \
"Kashmiri" "ks" OFF \
"Georgian" "ka" OFF \
"Kanuri" "kr" OFF \
"Kazakh" "kk" OFF \
"Central" "km" OFF \
"Kikuyu" "ki" OFF \
"Kinyarwanda" "rw" OFF \
"Kirghiz" "ky" OFF \
"Komi" "kv" OFF \
"Kongo" "kg" OFF \
"Korean" "ko" OFF \
"Kuanyama" "kj" OFF \
"Kurdish" "ku" OFF \
"Lao" "lo" OFF \
"Latin" "la" OFF \
"Latvian" "lv" OFF \
"Limburgan" "li" OFF \
"Lingala" "ln" OFF \
"Lithuanian" "lt" OFF \
"Luxembourgish" "lb" OFF \
"Luba-Katanga" "lu" OFF \
"Ganda" "lg" OFF \
"Macedonian" "mk" OFF \
"Marshallese" "mh" OFF \
"Malayalam" "ml" OFF \
"Maori" "mi" OFF \
"Marathi" "mr" OFF \
"Malay" "ms" OFF \
"Macedonian" "mk" OFF \
"Malagasy" "mg" OFF \
"Maltese" "mt" OFF \
"Mongolian" "mn" OFF \
"Maori" "mi" OFF \
"Malay" "ms" OFF \
"Burmese" "my" OFF \
"Nauru" "na" OFF \
"Navajo" "nv" OFF \
"Ndebele" "nr" OFF \
"Ndebele" "nd" OFF \
"Ndonga" "ng" OFF \
"Nepali" "ne" OFF \
"Dutch" "nl" OFF \
"Norwegian" "nn" OFF \
"Bokmål" "nb" OFF \
"Norwegian" "no" OFF \
"Chichewa" "ny" OFF \
"Occitan" "oc" OFF \
"Ojibwa" "oj" OFF \
"Oriya" "or" OFF \
"Oromo" "om" OFF \
"Ossetian" "os" OFF \
"Panjabi" "pa" OFF \
"Persian" "fa" OFF \
"Pali" "pi" OFF \
"Polish" "pl" OFF \
"Portuguese" "pt" OFF \
"Pushto" "ps" OFF \
"Quechua" "qu" OFF \
"Romansh" "rm" OFF \
"Romanian" "ro" OFF \
"Romanian" "ro" OFF \
"Rundi" "rn" OFF \
"Russian" "ru" OFF \
"Sango" "sg" OFF \
"Sanskrit" "sa" OFF \
"Sinhala" "si" OFF \
"Slovak" "sk" OFF \
"Slovak" "sk" OFF \
"Slovenian" "sl" OFF \
"Northern" "se" OFF \
"Samoan" "sm" OFF \
"Shona" "sn" OFF \
"Sindhi" "sd" OFF \
"Somali" "so" OFF \
"Sotho" "st" OFF \
"Spanish" "es" OFF \
"Albanian" "sq" OFF \
"Sardinian" "sc" OFF \
"Serbian" "sr" OFF \
"Swati" "ss" OFF \
"Sundanese" "su" OFF \
"Swahili" "sw" OFF \
"Swedish" "sv" OFF \
"Tahitian" "ty" OFF \
"Tamil" "ta" OFF \
"Tatar" "tt" OFF \
"Telugu" "te" OFF \
"Tajik" "tg" OFF \
"Tagalog" "tl" OFF \
"Thai" "th" OFF \
"Tibetan" "bo" OFF \
"Tigrinya" "ti" OFF \
"Tonga" "to" OFF \
"Tswana" "tn" OFF \
"Tsonga" "ts" OFF \
"Turkmen" "tk" OFF \
"Turkish" "tr" OFF \
"Twi" "tw" OFF \
"Uighur" "ug" OFF \
"Ukrainian" "uk" OFF \
"Urdu" "ur" OFF \
"Uzbek" "uz" OFF \
"Venda" "ve" OFF \
"Vietnamese" "vi" OFF \
"Volapük" "vo" OFF \
"Welsh" "cy" OFF \
"Walloon" "wa" OFF \
"Wolof" "wo" OFF \
"Xhosa" "xh" OFF \
"Yiddish" "yi" OFF \
"Yoruba" "yo" OFF \
"Zhuang" "za" OFF \
"Chinese" "zh" OFF \
"Zulu" "zu" OFF 3>&1 1>&2 2>&3
)
sed -i "s/FileBotLang=.*/FileBotLang=$new_lang/g" "$JDAutoConfig"
;;
"8)")
break
;;
esac
done
;;
"7)")
exit
;;
esac
done

217
jdautoenc.sh Normal file
View File

@ -0,0 +1,217 @@
#!/bin/bash
config=$(find ~ -type f -name "JDAutoConfig" 2>/dev/null)
log=$(grep "log=" "$config" | sed 's/.*=//g')
extracted=$(grep "extracted=" "$config" | sed 's/.*=//g')
encodes=$(grep "encodes=" "$config" | sed 's/.*=//g')
rename=$(grep "rename=" "$config" | sed 's/.*=//g')
discord=$(grep "discord=" "$config" | sed 's/.*=//g')
bitrate_anime=$(grep "bitrate_anime=" "$config" | sed 's/.*=//g')
preset_anime=$(grep "preset_anime=" "$config" | sed 's/.*=//g')
bitrate_series=$(grep "bitrate_series=" "$config" | sed 's/.*=//g')
preset_series=$(grep "preset_series=" "$config" | sed 's/.*=//g')
bitrate_movie=$(grep "bitrate_movie=" "$config" | sed 's/.*=//g')
preset_movie=$(grep "preset_movie=" "$config" | sed 's/.*=//g')
encode=$(grep "encode=" "$config" | sed 's/.*=//g')
encoder=$(grep "Encoder=" "$config" | sed 's/.*=//g')
discord=$(grep "discord=" "$config" | sed 's/.*=//g')
if [[ ${encoder,,} == "nvidia" ]]; then
hw_accel="cuda"
codec="hevc_nvenc"
elif [[ ${encoder,,} == "amd" ]]; then
hw_accel="auto"
codec="hevc_amf"
elif [[ ${encoder,,} == "intel" ]]; then
hw_accel="qsv"
codec="hevc_qsf"
elif [[ ${encoder,,} == "software" ]]; then
hw_accel="qsv"
codec="hevc_qsf"
fi
red='\033[0;31m' # ${red}
white='\033[0;37m' # ${white}
yellow='\033[0;33m' # ${yellow}
green='\033[0;32m' # ${green}
blue='\033[0;34m' # ${blue}
lblue='\033[1;34m' # ${lblue}
cyan='\033[0;36m' # ${cyan}
purple='\033[0;35m' # ${purple}
language_Folder=$(grep "language_folder=" "$config" | sed 's/.*=//g')
if [[ -n $(grep "language=" "$config" | sed 's/.*=//g') ]]; then
language=$(grep "language=" "$config" | sed 's/.*=//g')
else
language=$(locale | head -n 1 | sed 's/.*=\|\..*//g')
fi
if [[ $language == "C" ]] || [[ ! -d $language_Folder/$language ]]; then
language=en_US
fi
text_lang() {
if [ -f "$language_Folder"/"$language"/jdautoenc.lang ]; then
grep "$1" "$language_Folder"/"$language"/jdautoenc.lang | sed 's/^....//'
else
curl -s https://raw.githubusercontent.com/Pakobbix/JDownloader-Autoenc-rename/main/lang/en_US/jdautoenc.lang | grep "$1" | sed 's/^....//'
fi
}
if [ -f /tmp/jdautoenc.lock ]; then
log_msg "${red}$(text_lang "001")"
sleep 3
fi
while [ -f /tmp/jdautoenc.lock ]; do
sleep $(((RANDOM % 10) + 1))s
done
echo $$ >/tmp/jdautoenc.lock
log_msg() {
echo -e "${yellow}$(date +"%d.%m.%y %T")${white} $1${white}" >>"${log[@]}"
}
discord_msg() {
curl -s -H "Content-Type: application/json" -X POST -d "{\"content\": \"$1\"}" "$discord" &>/dev/null
}
NextcloudDomain=$(grep "NextcloudDomain=" "$config" | sed 's/.*=//g')
NextcloudTalkToken=$(grep "NextcloudTalkToken=" "$config" | sed 's/.*=//g')
NextcloudUser=$(grep "NextcloudUser=" "$config" | sed 's/.*=//g')
NextcloudPassword=$(grep "NextcloudPassword=" "$config" | sed 's/.*=//g')
nextcloud_msg() {
curl -d '{"token":"'"$NextcloudTalkToken"'", "message":"'"$1"'"}' -H "Content-Type: application/json" -H "Accept:application/json" -H "OCS-APIRequest:true" -u "$NextcloudUser:$NextcloudPassword" "$NextcloudDomain"/ocs/v1.php/apps/spreed/api/v1/chat/tokenid &>/dev/null
}
appriseurl=$(grep "appriseurl=" "$config" | sed 's/.*=//g')
apprisetag=$(grep "apprisetag=" "$config" | sed 's/.*=//g')
apprise_msg() {
if [[ -n $apprisetag ]]; then
curl -d '{"body":"'"$1"'", "title":"#### jdautoenc.sh ####","tag":"'"$apprisetag"'"}' -H "Content-Type: application/json" "$appriseurl" &>/dev/null
else
curl -d '{"body":"'"$1"'", "title":"#### jdautoenc.sh ####","tag":"all"}' -H "Content-Type: application/json" "$appriseurl" &>/dev/null
fi
}
ff_encode() {
if [[ ${encode,,} == "yes" ]]; then
if ffmpeg -hide_banner -v quiet -stats -nostdin -hwaccel "$1" -hwaccel_output_format "$1" -i "$i" -c:v "$2" -preset "$3" -b:v "$4"K -c:a "$5" -map 0 -c:s copy "${encodes[*]}""${fertig%.*}.mkv" >>"${log[@]}" 2>&1; then
finishedduration=$(ffprobe -hide_banner -loglevel error -v quiet -stats -i "${encodes[*]}""${fertig%.*}.mkv" -show_entries format=duration -v quiet -of csv="p=0" | sed 's/\..*//g')
if [[ $finishedduration -eq $duration ]]; then
log_msg "${red}$(text_lang "002")${white} $(text_lang "003")${purple}""$clear""${white}"
if ! rm -f "$i" &>/dev/null; then
log_msg "${red}$(text_lang "004")"
discord_msg "$(text_lang "004")"
nextcloud_msg "$(text_lang "004")"
apprise_msg "$(text_lang "004")"
fi
else
rmencoded=$(rm -f "${encodes[*]}""${fertig%.*}.mkv" 2>&1) || log_msg "$rmencoded"
log_msg "${red} $(text_lang "006")"
nextcloud_msg "$(text_lang "006") $clear $(text_lang "007") $2 $(text_lang "008"). $?"
discord_msg "$(text_lang "006") $clear $(text_lang "007") $2 $(text_lang "008"). $?"
apprise_msg "$(text_lang "006") $clear $(text_lang "007") $2 $(text_lang "008"). $?"
fi
fi
else
mv "$i" "${encodes[*]}""${fertig%.*}"
fi
}
log_msg ""
log_msg "##########################"
log_msg "$(text_lang "009") ${green}JDautoenc.sh${white} $(text_lang "010")"
log_msg "##########################"
log_msg ""
find -L "${extracted[@]}" -name '*.mkv' -or -name '*.mp4' 2>/dev/null | while IFS= read -r i; do
duration=$(ffprobe -hide_banner -loglevel error -v quiet -stats -i "$i" -show_entries format=duration -v quiet -of csv="p=0" | sed 's/\..*//g')
fertig=$(basename "$i")
clear=$(basename "$i" .mkv | sed 's/\./ /g;s/AAC\|1080p\|WebDL\|[a-z]26[0-9]\|[hH][eE][Vv][Cc]\|[tT]anuki\| dl \| web \|repack\|wayne\|\|[-]\|[gG]er\|[eE]ng\|[sS]ub//g;s/\[[^][]*\]\|WebDL\|JapDub\|CR\|REPACK\|V2DK\|man\|BluRay\|RSG//g;s/_/ /g;s/\( \)*/\1/g')
################################################ Anime Sektion ################################################
if [ -z "$duration" ] || [ "$duration" -lt "1560" ]; then
log_msg "${purple}$clear${white} $(text_lang "011") ${blue}$(text_lang "012")${white}. $(text_lang "013")"
vcodec=$(ffprobe -hide_banner -loglevel error -select_streams v:0 -show_entries stream=codec_name -of default=nw=1:nk=1 "$i")
if ! [ "$vcodec" == "hevc" ]; then
acodec=$(ffprobe -hide_banner -loglevel error -select_streams a:0 -show_entries stream=codec_name -of default=nw=1:nk=1 "$i")
if [ "$acodec" = "eac3" ] || [ "$acodec" = "dts" ]; then
log_msg "${blue}$(text_lang "012")${white} ${purple}""$clear""${white} $(text_lang "014") ${vcodec^^} & ${acodec^^} $(text_lang "015") HEVC & AC3"
ff_encode "$hw_accel" "$codec" "$preset_anime" "$bitrate_anime" ac3
else
log_msg "${blue}$(text_lang "012")${white} ${purple}""$clear""${white} $(text_lang "014") ${vcodec^^} $(text_lang "015") HEVC"
ff_encode "$hw_accel" "$codec" "$preset_anime" "$bitrate_anime" "copy"
fi
else
acodec=$(ffprobe -hide_banner -loglevel error -select_streams a:0 -show_entries stream=codec_name -of default=nw=1:nk=1 "$i")
log_msg "${purple}""$clear""${white} $(text_lang "016")"
if [ "$acodec" = "eac3" ] || [ "$acodec" = "dts" ]; then
log_msg "${purple}""$clear""${white} $(text_lang "014") ${acodec^^} $(text_lang "015") AC3"
ff_encode "$hw_accel" "copy" "$preset_anime" "$bitrate_anime" "ac3"
else
log_msg "$(text_lang "017") ${purple}$clear${white} $(text_lang "018")"
mv "$i" "${encodes[@]}"
fi
fi
################################################ Serien Sektion ################################################
elif [ "$duration" -gt "1561" ] && [ "$duration" -lt "4750" ]; then
log_msg "${purple}$fertig${white} $(text_lang "011") ${lblue}$(text_lang "019")${white}. $(text_lang "013")"
vcodec=$(ffprobe -hide_banner -loglevel error -select_streams v:0 -show_entries stream=codec_name -of default=nw=1:nk=1 "$i")
if ! [ "$vcodec" = "hevc" ]; then
acodec=$(ffprobe -hide_banner -loglevel error -select_streams a:0 -show_entries stream=codec_name -of default=nw=1:nk=1 "$i")
if [ "$acodec" = "eac3" ] || [ "$acodec" = "dts" ]; then
log_msg "${lblue}$(text_lang "019")${white} ${purple}$clear${white} $(text_lang "014") ${vcodec^^} & ${acodec^^} $(text_lang "015") HEVC 1700k & AC3"
ff_encode "$hw_accel" "$codec" "$preset_series" "$bitrate_series" "ac3"
else
log_msg "${lblue}$(text_lang "019")${white} $fertig $(text_lang "014") ${vcodec^^} $(text_lang "015") HEVC 1700k"
ff_encode "$hw_accel" "$codec" "$preset_series" "$bitrate_series" "copy"
fi
else
acodec=$(ffprobe -hide_banner -loglevel error -select_streams a:0 -show_entries stream=codec_name -of default=nw=1:nk=1 "$i")
if [ "$acodec" = "eac3" ] || [ "$acodec" = "dts" ]; then
log_msg "${purple}$clear${white} $(text_lang "014") ${acodec^^} $(text_lang "015") AC3"
ff_encode "$hw_accel" "copy" "$preset_series" "$bitrate_series" "ac3"
else
log_msg "$(text_lang "017") ${purple}$clear${white} $(text_lang "018")"
mv "$i" "${encodes[@]}"
fi
fi
################################################ Filme Sektion ################################################
elif [ "$duration" -gt "4751" ]; then
log_msg "${purple}$fertig${white} $(text_lang "011") ${cyan}$(text_lang "022")${white}, $(text_lang "013")"
vcodec=$(ffprobe -hide_banner -loglevel error -select_streams v:0 -show_entries stream=codec_name -of default=nw=1:nk=1 "$i")
if ! [ "$vcodec" = "hevc" ]; then
acodec=$(ffprobe -hide_banner -loglevel error -select_streams a:0 -show_entries stream=codec_name -of default=nw=1:nk=1 "$i")
if [ "$acodec" = "eac3" ] || [ "$acodec" = "dts" ]; then
log_msg "${cyan}$(text_lang "022")${white} ${purple}$clear${white} $(text_lang "014") $vcodec & $acodec $(text_lang "015") HEVC 2M & AC3 500k"
ff_encode "$hw_accel" "$codec" "$preset_movie" "$bitrate_movie" "ac3"
else
log_msg "${cyan}$(text_lang "022")${white} ${purple}$clear${white} $(text_lang "014") $vcodec $(text_lang "015") HEVC 2M"
ff_encode "$hw_accel" "$codec" "$preset_movie" "$bitrate_movie" "copy"
fi
else
acodec=$(ffprobe -hide_banner -loglevel error -select_streams a:0 -show_entries stream=codec_name -of default=nw=1:nk=1 "$i")
log_msg "${purple}$clear${white} $(text_lang "016")"
if [ "$acodec" = "eac3" ] || [ "$acodec" = "dts" ]; then
log_msg "${purple}$clear${white} $(text_lang "014") ${acodec^^} $(text_lang "015") AC3"
ff_encode "$hw_accel" "copy" "$preset_movie" "$bitrate_movie" "ac3"
else
log_msg "$(text_lang "017") ${purple}$clear${white} $(text_lang "018")"
mv "$i" "${encodes[@]}"
fi
fi
fi
done
log_msg "$(text_lang "020")"
rm -f /tmp/jdautoenc.lock
log_msg "${red}$(text_lang "002")${white} $(text_lang "021")"
find "${extracted[@]}"* -type d -empty -delete 2>/dev/null >>"${log[@]}"
/bin/bash "$rename" "$log" "$config" &

21
lang/de_DE/addrename.lang Normal file
View File

@ -0,0 +1,21 @@
001 Möchtest du einen
002 Film
003 oder eine/n
004 Anime
005 Serie
006 zum umbenennen hinzufügen?
007 Gebe Anime, Serie, Film oder beenden ein
008 Nach welchem
009 Stichwort
010 soll der
011 Eintrag abgeglichen werden?
012 Falls du möchtest
013 gebe nun ein zweites Schlagwort ein
014 Es handelt sich um den Anime:
015 Ist dies Korrekt? (Y/n)
016 Leider konnte deine Anfrage nicht automatisch abgearbeitet werden. Du kannst aber immernoch manuell einen Eintrag hinzufügen
017 Es handelt sich um die Serie:
018 Es handelt sich um den Film:
019 Gebe nun die
020 ein.
021 Nummer in der URL

200
lang/de_DE/config.lang Normal file
View File

@ -0,0 +1,200 @@
001 Ist der Pfad der JDAutoConfig richtig?
002 Wie lautet der Richtige Pfad?
003 Gebe hier den Vollständigen Pfad zum JDAutoConfig an
004 Pfad wurde nicht geändert
005 Der Pfad wurde nicht geändert
006 Der Pfad vom
007 wurde geändert!
008 Der neue Pfad lautet:
009 Fehler beim ändern des Pfads!
010 Der neue Pfad:
011 Konnte nicht geändert werden!
012 Wähle die zu nutzende Datenbank aus:
013 Bitrate Einstellungen
014 Gebe hier die Kbits (ohne endung) für
015 Leertaste zum auswählen, Enter zum bestätigen.
016 Wähle
017 Beenden
018 Preset Einstellungen
019 Gebe hier das zu nutzende FFmpeg Preset an für
020 Am Schnellsten, geringste Qualität
021 Schnell Geringe Qualität
022 Schnell annehmbare Qualität
023 Empfohlen. Relativ schnell, Qualität laut VMAF Tool im schnitt 96-99% vom Quellmedium
024 Balanced
025 Etwas langsam. Nur noch kleinere Dateigrößen, keine relevanten Qualitätseinbußen mehr
026 Noch langsamer.
027 Wirklich Langsam.
028 Vielleicht doch lieber auf ein Remux warten?
029 Naja, am besten encodieren ausschalten, huh?
030 Was möchtest du Konfigurieren?
031 WIP. Die Möglichkeiten zum Feinjustieren, werden noch erweitert.
032 Bei Problemen öffnet ein issue unter: shorturl.at/bvDQ6 (Github link, einfacher abzutippen oder https://exe.io/jdautoenc falls ihr mich per Werbung unterstützen wollt)
033 Ordnerpfade
034 Log Farben
035 Benachrichtigungssystem
036 Encoding Einstellungen
037 Encoding Hardware
038 FileBot Einstellungen
039 Befinden sich alle Skripte an der selben stelle?
040 Die JDAutoConfig wurde in
041 gefunden. Ist dies der Pfad aller Skripte?
042 ACHTUNG! Nur die Skripte werden dadurch angepasst. der Entpackt und der Encoding Ordner sowie der Pfad für das Log müssen manuell gesetzt werden!
043 Welchen Ordnerpfad möchtest du Anpassen?
044 Bitte Auswahl treffen
045 Entpackt Ordner
046 Encodes Ordner
047 Log Pfad
048 Filme:
049 Serien:
050 Animes:
051 Pfad Einstellung ändern
052 Neuer Pfad für
053 Ordnerpfad für den Ordner in dem vom JD2 entpackte Videos liegen:
054 Neuer Pfad für das Verzeichnis, in dem die Fertig encodierten Videos sind/sollen
055 Filme Ordner
056 Serien Ordner
057 Anime Ordner
058 Welchen Nachrichtendienst möchtest du Konfigurieren?
059 Wähle das Nachrichtensystem:
060 Konfiguration der Discord WebHook
061 Gebe hier die Vollständige Adresse der Discord Webhook an. Momentan:
062 Hier kannst du die Nextcloud Benachrichtigungen einstellen
063 Wähle hier die zu ändernde Einstellungen
064 Momentan:
065 Konfiguration für Nextcloud
066 Gebe hier die Vollständige Adresse zu deiner Nextcloud an.
067 Dies kann eine Domain zur Nextcloud sein: https://meineNextcloud.domain
068 Oder aber auch die IP (+Port falls nicht 80/443) falls der JDownloader und die Nextcloud im selben Netzwerk sind: 10.0.0.4:85
069 Gebe hier den Nextcloud User an, der die Nachrichten schreibt.
070 Gebe hier das Password vom User an.
071 Gebe hier den token des Chat-Kanals an.
072 Beispiel: https://nextcloud.domain/call/ne6ht3u7 ne6ht3u7 wäre in dem fall der Token
073 Die Encoding Einstellungen wurden zu nVidia geändert.
074 Hier kannst du die FFmpeg Settings ändern
075 Wähle hier die zu ändernden Einstellungen
076 Encodieren:
077 Bitrate Anime Aktuell:
078 FFmpeg Preset Animes Aktuell:
079 Bitrate Serien Aktuell:
080 FFmpeg Preset Serien Aktuell:
081 Bitrate Filme Aktuell:
082 FFmpeg Preset Filme Aktuell:
083 Encodieren ein/ausschalten
084 Wähle ob du Encodieren möchtest
085 Grafikkarte
086 Entdeckt!
087 Welche Hardware möchtest du verwenden?
088 Bitte wähle die zu nutzende Hardware. Folgende Hardware scheint installiert zu sein:
089 Die Encoding Einstellungen wurden zu nVidia geändert.
090 Es werden die Cuda Prozessoren mit dem NVENC encoder genutzt.
091 Die Encoding Einstellungen wurden zu AMD geändert.
092 Es werden mit der AMD-Transistoren mit dem amf encoder genutzt.
093 Die Encoding Einstellungen wurden zu nVidia geändert.
094 Es wird der Intel QuickSync Chip mit qsv encoder genutzt.
095 Das Encoding per Software wird zurzeit nicht unterstützt!
096 Ändere FileBot Spezifische Einstellungen
097 Was möchtest du verändern?
098 Film Datenbank zurzeit:
099 Serien Datenbank zurzeit:
100 Anime Datenbank zurzeit:
101 Film Namensschema zurzeit:
102 Serien Namensschema zurzeit:
103 Anime Namensschema zurzeit:
104 Abzugleichende Sprache zurzeit:
105 Neuer Pfad für Filme. Für Beispiele und Möglichkeiten: https://www.filebot.net/naming.html Beispiele:
106 Neuer Pfad für Serien. Für Beispiele und Möglichkeiten: https://www.filebot.net/naming.html Beispiele:
107 Neuer Pfad für Animes. Für Beispiele und Möglichkeiten: https://www.filebot.net/naming.html Beispiele:
108 Das Namenschema wurde nicht verändert!
109 Filebot zu nutzende Sprache auswählen
110 Wähle die von FileBot zu nutzende Sprache aus
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200

22
lang/de_DE/jdautoenc.lang Normal file
View File

@ -0,0 +1,22 @@
001 jdautoenc wurde bereits gestartet, warte auf dessen Beendigung.
002 Lösche
003 Quelldatei
004 Fehler beim löschen der Quelldatei
005 Dauer des Videos stimmen nicht überein!
006 Konnte
007 nicht mit
008 umwandeln
009 Starte
010 Skript
011 ist ein
012 Anime
013 Überprüfe nun den Video Codec.
014 Encode von
015 zu
016 ist bereits HEVC, Überprüfe Audio Codec. Wenn in eac3 oder dts dann Encode Audio zu AC3.
017 verschiebe
018 zum umbenennen.
019 Serie
020 Entferne jdautoenc.lock
021 leere Ordner im Entpackt verzeichnis.
022 Film

View File

@ -0,0 +1,6 @@
001 Wähle den zu löschenden Eintrag aus:
002 Beenden
003 Bist du sicher, dass du
004 löschen
005 willst?
006 Ungültige Eingabe.

19
lang/de_DE/rename.lang Normal file
View File

@ -0,0 +1,19 @@
001 Warte auf das beenden vom Encoden.
002 Renaming läuft bereits. Warte auf dessen durchlauf.
003 Starte
004 Skript
005 Bennene
006 stimmt nicht mit
007 überein.
008 Gehe zum nächsten Eintrag.
009 ist ein Film, extrahiere Namen für Ordner.
010 Erstelle Ordner:
011 Verschiebe
012 nach
013 Fange an mit der Umbenennung.
014 Falls Umbennung erfolgreich,
015 Lösche
016 Ordner
017 Fehler bei der Umbenennung!
018 Fehlgeschlagene Versuche.
019 Alles wurde erfolgreich beendet!

21
lang/en_GB/addrename.lang Normal file
View File

@ -0,0 +1,21 @@
001 Do you want a
002 film
003 or a
004 anime
005 series
006 to rename? (type exit to exit)
007 Enter anime, series or movie
008 By which
009 keyword
010 should the
011 entry be matched?
012 If you want
013 now enter a second keyword
014 This is the anime:
015 Is this correct? (Y/n)
016 Unfortunately your request could not be processed automatically. But you can still add an entry manually
017 This is the series:
018 This is the movie:
019 Now enter the
020 number.
021 number in the URL

200
lang/en_GB/config.lang Normal file
View File

@ -0,0 +1,200 @@
001 Is the path of the JDAutoConfig correct?
002 What is the correct path?
003 Enter here the complete path to the JDAutoConfig
004 Path was not changed
005 Path was not changed
006 The path from
007 was changed!
008 The new path is:
009 Error changing the path!
010 The new path:
011 Could not be changed!
012 Select the database to use:
013 Bitrate settings
014 Enter here the Kbits (without ending) for
015 Space to select, Enter to confirm.
016 Select
017 Exit
018 Preset settings
019 Enter here the FFmpeg preset to use for
020 Fastest, Lowest Quality
021 Fast Low quality
022 Fast acceptable quality
023 Recommended. Relatively fast, quality according to VMAF tool averages 96-99% of source media.
024 Balanced
025 Somewhat slow. Only smaller file sizes, no relevant quality loss anymore.
026 Even slower.
027 Really slow.
028 Maybe better wait for a remux?
029 Well, best to switch off encoding, huh?
030 What do you want to configure?
031 WIP. The possibilities for fine tuning will be extended.
032 If you have problems, open an issue at: shorturl.at/bvDQ6 (Github link, easier to type or https://exe.io/jdautoenc if you want to support me via advertisement)
033 Folder paths
034 Log colors
035 Notification system
036 Encoding settings
037 Encoding hardware
038 FileBot settings
039 Are all scripts in the same place?
040 The JDAutoConfig was
041 found. Is this the path of all scripts?
042 ATTENTION! Only the scripts are adapted thereby. the Unpacked and the Encoding folder as well as the path for the log must be set manually!
043 Which folder path do you want to adjust?
044 Please select
045 Unpacked folder
046 Encodes folder
047 Log path
048 Movies:
049 Series:
050 Anime:
051 Change path setting
052 New path for
053 Folder path for the folder where videos unzipped by JD2 are located:
054 New path for the folder where the Finished encoded videos are/should be.
055 Movies folder
056 Series folder
057 Anime folder
058 Which messaging service do you want to configure?
059 Choose the messaging system:
060 Configure the Discord WebHook
061 Enter the full address of the Discord Webhook here. Currently:
062 Here you can set the Nextcloud notifications.
063 Choose here the settings you want to change
064 Currently:
065 Configuration for Nextcloud
066 Enter here the full address to your Nextcloud.
067 This can be a domain to Nextcloud: https://meineNextcloud.domain
068 Or IP (+Port if not 80/443) if JDownloader and Nextcloud are in the same network: 10.0.0.4:85
069 Enter here the Nextcloud user who writes the messages.
070 Enter the password of the user.
071 Specify here the token of the chat channel.
072 Example: https://nextcloud.domain/call/ne6ht3u7 ne6ht3u7 would be the token in this case.
073 The encoding settings have been changed to nVidia.
074 Here you can change the FFmpeg Settings
075 Select here the settings to change
076 Encoding:
077 Bitrate Anime Current:
078 FFmpeg Preset Animes Current:
079 Bitrate Series Current:
080 FFmpeg Preset Series Current:
081 Bitrate Movies Current:
082 FFmpeg Preset Movies Current:
083 Encode on/off
084 Choose if you want to encode
085 Graphics card
086 Discover!
087 Which hardware do you want to use?
088 Please select the hardware you want to use. The following hardware seems to be installed:
089 The encoding settings have been changed to nVidia.
090 The Cuda processors with the NVENC encoder are used.
091 The encoding settings have been changed to AMD.
092 AMD transistors with the amf encoder are used.
093 The encoding settings have been changed to nVidia.
094 The Intel QuickSync chip with qsv encoder is used.
095 Encoding by software is currently not supported!
096 Change FileBot specific settings
097 What do you want to change?
098 Movie database currently:
099 Series database currently:
100 Anime database currently:
101 Movie naming scheme currently:
102 Series naming scheme currently:
103 Anime naming scheme currently:
104 Language to be deducted currently:
105 New path for movies. For examples and possibilities: https://www.filebot.net/naming.html examples:
106 New path for series. For examples and possibilities: https://www.filebot.net/naming.html Examples:
107 New path for anime. For examples and possibilities: https://www.filebot.net/naming.html Examples:
108 The naming scheme has not been changed!
109 Select language to be used by Filebot
110 Select the language to be used by FileBot
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200

22
lang/en_GB/jdautoenc.lang Normal file
View File

@ -0,0 +1,22 @@
001 jdautoenc has already been started, wait for it to finish.
002 Delete
003 source file
004 Error deleting source file
005 Duration of the video does not match!
006 Could
007 not with
008 convert
009 Start
010 script
011 is a
012 anime
013 Checking video codec.
014 Encode from
015 to
016 is already HEVC, check audio codec. If in eac3 or dts then encode audio to AC3.
017 move
018 to rename.
019 Series
020 remove jdautoenc.lock
021 empty folder in unpack directory.
022 Movie

View File

@ -0,0 +1,6 @@
001 Select the entry to be deleted:
002 Exit
003 Are you sure you want to
004 delete
005 want?
006 Invalid entry.

19
lang/en_GB/rename.lang Normal file
View File

@ -0,0 +1,19 @@
001 Wait for encoding to finish.
002 Renaming is already running. Wait for it to run.
003 Start
004 Script
005 Name
006 does not match
007 match.
008 Go to next entry.
009 Is a movie, extract names for folders.
010 Create folder:
011 Move
012 to
013 Start renaming.
014 If renaming successful,
015 Delete
016 folder
017 Error during renaming!
018 Failed attempts.
019 Everything was completed successfully!

21
lang/en_US/addrename.lang Normal file
View File

@ -0,0 +1,21 @@
001 Do you want a
002 film
003 or a
004 anime
005 series
006 to rename? (Type exit to exit)
007 Enter anime, series or movie
008 By which
009 keyword
010 should the
011 entry be matched?
012 If you want
013 now enter a second keyword
014 This is the anime:
015 Is this correct? (Y/n)
016 Unfortunately your request could not be processed automatically. But you can still add an entry manually
017 This is the series:
018 This is the movie:
019 Now enter the
020 number.
021 number in the URL

200
lang/en_US/config.lang Normal file
View File

@ -0,0 +1,200 @@
001 Is the path of the JDAutoConfig correct?
002 What is the correct path?
003 Enter here the complete path to the JDAutoConfig
004 Path was not changed
005 Path was not changed
006 The path from
007 was changed!
008 The new path is:
009 Error changing the path!
010 The new path:
011 Could not be changed!
012 Select the database to use:
013 Bitrate settings
014 Enter here the Kbits (without ending) for
015 Space to select, Enter to confirm.
016 Select
017 Exit
018 Preset settings
019 Enter here the FFmpeg preset to use for
020 Fastest, Lowest Quality
021 Fast Low quality
022 Fast acceptable quality
023 Recommended. Relatively fast, quality according to VMAF tool averages 96-99% of source media.
024 Balanced
025 Somewhat slow. Only smaller file sizes, no relevant quality loss anymore.
026 Even slower.
027 Really slow.
028 Maybe better wait for a remux?
029 Well, best to switch off encoding, huh?
030 What do you want to configure?
031 WIP. The possibilities for fine tuning will be extended.
032 If you have problems, open an issue at: shorturl.at/bvDQ6 (Github link, easier to type or https://exe.io/jdautoenc if you want to support me via advertisement)
033 Folder paths
034 Log colors
035 Notification system
036 Encoding settings
037 Encoding hardware
038 FileBot settings
039 Are all scripts in the same place?
040 The JDAutoConfig was
041 found. Is this the path of all scripts?
042 ATTENTION! Only the scripts are adapted thereby. the Unpacked and the Encoding folder as well as the path for the log must be set manually!
043 Which folder path do you want to adjust?
044 Please select
045 Unpacked folder
046 Encodes folder
047 Log path
048 Movies:
049 Series:
050 Anime:
051 Change path setting
052 New path for
053 Folder path for the folder where videos unzipped by JD2 are located:
054 New path for the folder where the Finished encoded videos are/should be.
055 Movies folder
056 Series folder
057 Anime folder
058 Which messaging service do you want to configure?
059 Choose the messaging system:
060 Configure the Discord WebHook
061 Enter the full address of the Discord Webhook here. Currently:
062 Here you can set the Nextcloud notifications.
063 Choose here the settings you want to change
064 Currently:
065 Configuration for Nextcloud
066 Enter here the full address to your Nextcloud.
067 This can be a domain to Nextcloud: https://meineNextcloud.domain
068 Or IP (+Port if not 80/443) if JDownloader and Nextcloud are in the same network: 10.0.0.4:85
069 Enter here the Nextcloud user who writes the messages.
070 Enter the password of the user.
071 Specify here the token of the chat channel.
072 Example: https://nextcloud.domain/call/ne6ht3u7 ne6ht3u7 would be the token in this case.
073 The encoding settings have been changed to nVidia.
074 Here you can change the FFmpeg Settings
075 Select here the settings to change
076 Encoding:
077 Bitrate Anime Current:
078 FFmpeg Preset Animes Current:
079 Bitrate Series Current:
080 FFmpeg Preset Series Current:
081 Bitrate Movies Current:
082 FFmpeg Preset Movies Current:
083 Encode on/off
084 Choose if you want to encode
085 Graphics card
086 Discover!
087 Which hardware do you want to use?
088 Please select the hardware you want to use. The following hardware seems to be installed:
089 The encoding settings have been changed to nVidia.
090 The Cuda processors with the NVENC encoder are used.
091 The encoding settings have been changed to AMD.
092 AMD transistors with the amf encoder are used.
093 The encoding settings have been changed to nVidia.
094 The Intel QuickSync chip with qsv encoder is used.
095 Encoding by software is currently not supported!
096 Change FileBot specific settings
097 What do you want to change?
098 Movie database currently:
099 Series database currently:
100 Anime database currently:
101 Movie naming scheme currently:
102 Series naming scheme currently:
103 Anime naming scheme currently:
104 Language to be deducted currently:
105 New path for movies. For examples and possibilities: https://www.filebot.net/naming.html examples:
106 New path for series. For examples and possibilities: https://www.filebot.net/naming.html Examples:
107 New path for anime. For examples and possibilities: https://www.filebot.net/naming.html Examples:
108 The naming scheme has not been changed!
109 Select language to be used by Filebot
110 Select the language to be used by FileBot
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200

22
lang/en_US/jdautoenc.lang Normal file
View File

@ -0,0 +1,22 @@
001 jdautoenc has already been started, wait for it to finish.
002 Delete
003 source file
004 Error deleting source file
005 Duration of the video does not match!
006 Could
007 not with
008 convert
009 Start
010 script
011 is a
012 anime
013 Checking video codec.
014 Encode from
015 to
016 is already HEVC, check audio codec. If in eac3 or dts then encode audio to AC3.
017 move
018 to rename.
019 Series
020 remove jdautoenc.lock
021 empty folder in unpack directory.
022 Movie

View File

@ -0,0 +1,6 @@
001 Select the entry to be deleted:
002 Exit
003 Are you sure you want to
004 delete
005 want?
006 Invalid entry.

19
lang/en_US/rename.lang Normal file
View File

@ -0,0 +1,19 @@
001 Wait for encoding to finish.
002 Renaming is already running. Wait for it to run.
003 Start
004 Script
005 Name
006 does not match
007 match.
008 Go to next entry.
009 Is a movie, extract names for folders.
010 Create folder:
011 Move
012 to
013 Start renaming.
014 If renaming successful,
015 Delete
016 folder
017 Error during renaming!
018 Failed attempts.
019 Everything was completed successfully!

57
removerename.sh Normal file
View File

@ -0,0 +1,57 @@
#!/bin/bash
# Farben für echo
red='\033[0;31m'
white='\033[0;37m'
yellow='\033[0;33m'
# Rename Skript:
JDAutoConfig=$(find ~ -type f -name "JDAutoConfig" 2>/dev/null)
renamelist=$(grep "renamelist=" "$JDAutoConfig" | sed 's/renamelist=//g')
language_Folder=$(grep "language_folder=" "$JDAutoConfig" | sed 's/.*=//g')
if [[ -n $(grep "language=" "$JDAutoConfig" | sed 's/.*=//g') ]]; then
language=$(grep "language=" "$JDAutoConfig" | sed 's/.*=//g')
else
language=$(locale | head -n 1 | sed 's/.*=\|\..*//g')
fi
if [[ $language == "C" ]] || [[ ! -d $language_Folder/$language ]]; then
language=en_US
fi
text_lang() {
if [ -f "$language_Folder"/"$language"/removerename.lang ]; then
grep "$1" "$language_Folder"/"$language"/removerename.lang | sed 's/^....//'
else
curl -s https://raw.githubusercontent.com/Pakobbix/JDownloader-Autoenc-rename/main/lang/en_US/removerename.lang | grep "$1" | sed 's/^....//'
fi
}
clear
IFS=$'\n'
frage="$(text_lang "001") "
entrys=($(awk 'NR % 6 == 1' "$renamelist" | sed 's/#.*/Beispiel Eintrag/g'))
PS3="$frage "
select entry in "${entrys[@]}" "$(text_lang "002")"; do
if ((REPLY == 1 + ${#entrys[@]})); then
exit
break
elif ((REPLY > 0 && REPLY <= ${#entrys[@]})); then
tvdbid=$(grep -A5 "$entry" "$renamelist" | awk 'NR % 5 == 0')
if [[ -z $(curl -sL https://www.thetvdb.com/dereferrer/series/"$tvdbid" | grep -i -A1 "deu" | grep "data-title" | sed 's/.*="\|"//g' | sed "s/&rsquo;/'/g") ]]; then
curl -sL https://www.thetvdb.com/dereferrer/series/"$tvdbid" | grep -i -A1 "en" | grep "data-title" | sed 's/.*="\|"//g' | sed "s/&rsquo;/'/g"
fi
echo ""
read -rp "$(echo -e "$(text_lang "003")" "${yellow}""$entry" "${red}""$(text_lang "004")""${white}" "$(text_lang "005")") (y/N) " sure
if [ "${sure,,}" == "y" ]; then
sed -i "/$entry/,+5d" "$renamelist"
fi
/bin/bash "${BASH_SOURCE[0]}"
else
text_lang "006"
fi
done

187
rename.sh Normal file
View File

@ -0,0 +1,187 @@
#!/bin/bash
## Farben für das Log
red='\033[0;31m'
green='\033[0;32m'
white='\033[0;37m'
yellow='\033[0;33m'
purple='\033[0;35m' # ${purple}
log="$1"
config="$2"
count=$(($3 + 1))
# Message System
discord=$(grep "discord=" "$config" | sed 's/.*=//g')
NextcloudDomain=$(grep "NextcloudDomain=" "$config" | sed 's/.*=//g')
NextcloudTalkToken=$(grep "NextcloudTalkToken=" "$config" | sed 's/.*=//g')
NextcloudUser=$(grep "NextcloudUser=" "$config" | sed 's/.*=//g')
NextcloudPassword=$(grep "NextcloudPassword=" "$config" | sed 's/.*=//g')
#Liste für die Umbenennung
renamelist=$(grep "renamelist=" "$config" | sed 's/.*=//g')
#Ordner Pfade
encodes=$(grep "encodes=" "$config" | sed 's/.*=//g')
Movies=$(grep "Movies=" "$config" | sed 's/.*=//g')
Series=$(grep "Series=" "$config" | sed 's/.*=//g')
Animes=$(grep "Animes=" "$config" | sed 's/.*=//g')
FilmDB=$(grep "MovieDB=" "$config" | sed 's/.*=//g')
SerienDB=$(grep "SeriesDB=" "$config" | sed 's/.*=//g')
AnimeDB=$(grep "AnimeDB=" "$config" | sed 's/.*=//g')
FilmName=$(grep "MovieName=" "$config" | sed 's/.*=//g')
SerienName=$(grep "SeriesName=" "$config" | sed 's/.*=//g')
AnimeNames=$(grep "AnimeName=" "$config" | sed 's/.*=//g')
FileBotLang=$(grep "FileBotLang=" "$config" | sed 's/.*=//g')
language_Folder=$(grep "language_folder=" "$config" | sed 's/.*=//g')
if [[ -n $(grep "language=" "$config" | sed 's/.*=//g') ]]; then
language=$(grep "language=" "$config" | sed 's/.*=//g')
else
language=$(locale | head -n 1 | sed 's/.*=\|\..*//g')
fi
if [[ $language == "C" ]] || [[ ! -d $language_Folder/$language ]]; then
language=en_US
fi
text_lang() {
if [ -f "$language_Folder"/"$language"/rename.lang ]; then
grep "$1" "$language_Folder"/"$language"/rename.lang | sed 's/^....//'
else
curl -s https://raw.githubusercontent.com/Pakobbix/JDownloader-Autoenc-rename/main/lang/en_US/rename.lang | grep "$1" | sed 's/^....//'
fi
}
log_msg() {
echo -e "${yellow}$(date +"%d.%m.%y %T")${white} $1${white}" >>"${log[@]}"
}
discord_msg() {
curl -s -H "Content-Type: application/json" -X POST -d "{\"content\": \"$1\"}" "$discord" &>/dev/null
}
nextcloud_msg() {
curl -d '{"token":"'"$NextcloudTalkToken"'", "message":"'"$1"'"}' -H "Content-Type: application/json" -H "Accept:application/json" -H "OCS-APIRequest:true" -u "$NextcloudUser:$NextcloudPassword" "$NextcloudDomain"/ocs/v1.php/apps/spreed/api/v1/chat/tokenid &>/dev/null
}
appriseurl=$(grep "appriseurl=" "$config" | sed 's/.*=//g')
apprisetag=$(grep "apprisetag=" "$config" | sed 's/.*=//g')
apprise_msg() {
if [[ -n $apprisetag ]]; then
curl -d '{"body":"'"$1"'", "title":"#### jdautoenc.sh ####","tag":"'"$apprisetag"'"}' -H "Content-Type: application/json" "$appriseurl" &>/dev/null
else
curl -d '{"body":"'"$1"'", "title":"#### jdautoenc.sh ####"}' -H "Content-Type: application/json" "$appriseurl" &>/dev/null
fi
}
filebot_rename() {
filebot -rename "$v" --db "$1" -non-strict --lang "$2" --format "$3/$4" --q "$5" >>"${log[@]}" 2>>"${log[@]}"
}
names() {
curl -sL https://www.thetvdb.com/dereferrer/series/"$1" | grep -i -A1 "deu" | grep "data-title" | sed 's/.*="\|"//g' | sed "s/&rsquo;/'/g"
}
if [[ -f /tmp/jdautoenc.lock ]]; then # ignore
log_msg "$(text_lang "001")"
sleep 2
fi
while [ -f /tmp/jdautoenc.lock ]; do
sleep 1m
done
sleep $(((RANDOM % 6) + 1))s
while [ -f /tmp/jdautoenc.lock ]; do
sleep 1m
done
# Erstelle lock Datei, Warte 5 Sekunden und überprüfe nochmals
while [ -f /tmp/rename.lock ]; do
sleep $(((RANDOM % 6) + 1))s
done
if [[ -f /tmp/rename.lock ]]; then # ignore
log_msg "$(text_lang "002")"
sleep $(((RANDOM % 2) + 1))s
fi
echo $$ >/tmp/rename.lock
## Script start
log_msg ""
log_msg "#######################"
log_msg "$(text_lang "003") ${green}rename.sh${white} $(text_lang "004")"
log_msg "#######################"
log_msg ""
while read -r name; do
read -r keyword1
read -r keyword2
read -r format
read -r dbid
read -r nextentry
find -L "${encodes[@]}" -name '*.mkv' -or -name '*.mp4' 2>/dev/null | while IFS= read -r v; do
if [[ ${v,,} == *"$keyword1"*"$keyword2"* ]]; then
log_msg "$(text_lang "005") $(basename "$v" | sed 's/\./ /g;s/AAC\|1080p\|WebDL\|[a-z]26[0-9]\|[hH][eE][Vv][Cc]\|[tT]anuki\| dl \| web \|repack\|wayne\|\|[-]\|[gG]er\|[eE]ng\|[sS]ub//g;s/\[[^][]*\]\|WebDL\|JapDub\|CR\|REPACK\|V2DK\|man\|BluRay\|RSG//g;s/_/ /g;s/\( \)*/\1/g')"
if [[ ${format,,} == "anime" ]]; then
filebot_rename "$AnimeDB" "$FileBotLang" "$Animes" "$AnimeNames" "$dbid"
elif [[ ${format,,} == "series" ]]; then
filebot_rename "$SerienDB" "$FileBotLang" "$Series" "$SerienName" "$dbid"
elif [[ ${format,,} == "movie" ]]; then
filebot_rename "$FilmDB" "$FileBotLang" "$Movies" "$FilmName" "$dbid"
else
log_msg "${red}$v $(text_lang "006") $name $(text_lang "007")"
log_msg "${red}$(text_lang "008")"
fi
fi
done
done <"$renamelist"
find -L "${encodes[@]}" -name '*.mkv' -or -name '*.mp4' 2>/dev/null | while IFS= read -r v; do
duration=$(ffprobe -hide_banner -loglevel error -v quiet -stats -i "$v" -show_entries format=duration -v quiet -of csv="p=0" | sed -e 's/\..*//g')
if [ "$duration" -gt "4751" ]; then # ignore
log_msg "${purple}$v${white} $(text_lang "009")"
movie=$(basename "$v")
folder=$(basename "$v" .mkv)
## Hier wird nun ein Ordner mit dem Namen des Videos erstellt. Dies ist eine Vorsichtsmaßnahme, da mein Ordner (encoded) auch bei eindeutigen Film
## Namen immer wieder dazu führte, dass der Film als "ENCODED EXPLODED" umbenannt wurde -.-
log_msg "$(text_lang "010") $folder" "$yellow" "$white" "$folder"
mkdir "$encodes""$folder" 2>/dev/null
log_msg "$(text_lang "011") ${purple}$v${white} $(text_lang "012") $folder"
mv "$v" "$encodes""$folder" >>"${log[@]}" 2>/dev/null
log_msg "$(text_lang "013")"
filebot -rename "$encodes""$folder"/"$movie" --db TheMovieDB -non-strict --lang German --format "/mnt/Medien/Filme/{n} ({y})" >>"${log[@]}"
log_msg "$(text_lang "014") ${red}$(text_lang "015")${white} $(text_lang "016")"
sleep 5s
rmdir "$encodes"* 2>/dev/null
fi
done
rm -f /tmp/rename.lock
if tail -n 20 "$log" | grep "Failure" &>/dev/null; then
if [ "$count" -lt 3 ]; then
/bin/bash "$0" "$log" "$config" "$count" &
exit
else
log_msg "$(text_lang "017") $count $(text_lang "018")"
discord_msg "$(text_lang "017") $count $(text_lang "018")"
nextcloud_msg "$(text_lang "017") $count $(text_lang "018")"
apprise_msg "$(text_lang "017") $count $(text_lang "018")"
fi
else
log_msg "$(text_lang "019")"
fi