Skip to content

Instantly share code, notes, and snippets.

@jmfergeau
Last active October 29, 2025 14:29
Show Gist options
  • Select an option

  • Save jmfergeau/5b58365d1061874e8cf0f689c9dd1e29 to your computer and use it in GitHub Desktop.

Select an option

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.
#!/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