Last active
October 29, 2025 14:29
-
-
Save jmfergeau/5b58365d1061874e8cf0f689c9dd1e29 to your computer and use it in GitHub Desktop.
Ce script permet de générer des fichiers .disc vides pour les séries, afin de les analyser après avec Kodi ou Jellyfin.
This file contains hidden or 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/sh | |
| clear | |
| echo "Création d'épisodes pour DVD pour Kodi/Jellyfin" | |
| echo "===============================================" | |
| echo " " | |
| read -r -p "Ecrire le nom du dossier de la série :" SERIE | |
| read -p "Combien de saisons ? :" SEASONS | |
| read -p "Combien d'épisodes par saison ? :" EPISODES | |
| ################################################ | |
| re='^[0-9]+$' | |
| if ! [[ $SEASONS =~ $re ]] ; then | |
| echo "ERROR 'Seasons' is not a number" >&2; exit 1 | |
| fi | |
| if ! [[ $EPISODES =~ $re ]] ; then | |
| echo "ERROR 'Episodes' is not a number" >&2; exit 2 | |
| fi | |
| ################################################ | |
| echo "Création des fichiers épisodes..." | |
| mkdir "${SERIE}" | |
| cd "${SERIE}" | |
| if [[ $SEASONS < 2 ]]; then | |
| for i in $(seq -w 01 $EPISODES); | |
| do | |
| touch "${SERIE} EP${i}.disc" | |
| done | |
| else | |
| for i in $(seq -w 01 $SEASONS); | |
| do | |
| mkdir "S${i}" | |
| cd "S${i}" | |
| for j in $(seq -w 01 $EPISODES); | |
| do | |
| touch "${SERIE} S${i}E${j}.disc" | |
| done | |
| cd .. | |
| done | |
| fi | |
| echo "Terminé. Plus qu'à le faire analyser par Kodi." | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment