Ouvrir navigateur en option
This commit is contained in:
parent
3af578d0ff
commit
8fd13c049b
203
ajouter_video.sh
203
ajouter_video.sh
|
@ -13,9 +13,9 @@
|
|||
# 5. RES: Résolution 1080p, 4K, SD, 720, HD
|
||||
# 6. SAISON: Pour les séries, c'est le numéro de saison.
|
||||
# Pour un film, le champ SAISON est utilisé pour renseigner la Saga
|
||||
# 7. GENRES: Action, Aventure, Fantastique, Animation, etc (choix multiple).
|
||||
# 7. GENRES: Action, Aventure, Fantastique, Animation, etc (choix multiple).
|
||||
# 8. GROUPES: Permet de regrouper des films. (choix multiple)
|
||||
#
|
||||
#
|
||||
# https://github.com/Kodi-vStream/venom-xbmc-addons/wiki/Voir-et-partager-sa-biblioth%C3%A8que-priv%C3%A9e#d%C3%A9clarer-des-films
|
||||
########################################################################
|
||||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
|
@ -59,18 +59,18 @@ zenity --width ${large} --height=${haut} --text-info \
|
|||
case $? in
|
||||
0)
|
||||
echo "AUTORISATION COPIE PRIVE ASTROPORT OK !"
|
||||
echo "$G1PUB" > ~/.zen/legal
|
||||
# next step
|
||||
;;
|
||||
echo "$G1PUB" > ~/.zen/legal
|
||||
# next step
|
||||
;;
|
||||
1)
|
||||
echo "Refus conditions"
|
||||
rm -f ~/.zen/legal
|
||||
exit 1
|
||||
;;
|
||||
;;
|
||||
-1)
|
||||
echo "Erreur."
|
||||
exit 1
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
@ -92,17 +92,17 @@ PREFIX=$(echo "${CAT}" | head -c 1 | awk '{ print toupper($0) }' ) # ex: F, S, A
|
|||
case ${CAT} in
|
||||
########################################################################
|
||||
# CASE ## YOUTUBE
|
||||
# _ _
|
||||
# _ _ ___ _ _| |_ _ _| |__ ___
|
||||
# _ _
|
||||
# _ _ ___ _ _| |_ _ _| |__ ___
|
||||
#| | | |/ _ \| | | | __| | | | '_ \ / _ \
|
||||
#| |_| | (_) | |_| | |_| |_| | |_) | __/
|
||||
# \__, |\___/ \__,_|\__|\__,_|_.__/ \___|
|
||||
# |___/
|
||||
# |___/
|
||||
########################################################################
|
||||
youtube)
|
||||
youtube)
|
||||
|
||||
zenity --warning --width 600 --text 'DEVELOPPEMENT. SVP. Envoyez le LOG : https://git.p2p.legal .DEVELOPPEMENT'
|
||||
|
||||
|
||||
YTURL=$(zenity --entry --width 300 --title "Lien ou identifiant à copier" --text "Indiquez le lien (URL) ou l'ID de la vidéo" --entry-text="")
|
||||
[[ $YTURL == "" ]] && exit 1
|
||||
|
||||
|
@ -173,18 +173,18 @@ echo "youtube;${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};
|
|||
|
||||
rm -Rf ${YTEMP}
|
||||
|
||||
;;
|
||||
;;
|
||||
|
||||
########################################################################
|
||||
# CASE ## MP3
|
||||
# _____
|
||||
# _ __ ___ _ __|___ /
|
||||
#| '_ ` _ \| '_ \ |_ \
|
||||
# _____
|
||||
# _ __ ___ _ __|___ /
|
||||
#| '_ ` _ \| '_ \ |_ \
|
||||
#| | | | | | |_) |__) |
|
||||
#|_| |_| |_| .__/____/
|
||||
# |_|
|
||||
#|_| |_| |_| .__/____/
|
||||
# |_|
|
||||
########################################################################
|
||||
mp3)
|
||||
mp3)
|
||||
|
||||
zenity --warning --width 600 --text 'DEVELOPPEMENT. SVP. Envoyez le LOG : https://git.p2p.legal .DEVELOPPEMENT'
|
||||
|
||||
|
@ -200,12 +200,12 @@ length=${#artist}
|
|||
islink=$(echo "$artist" | grep "http")
|
||||
if [[ ! $islink && $length != 11 ]]
|
||||
then
|
||||
# Ask for song name
|
||||
song=$(zenity --entry --width 300 --title "Titre à chercher sur Youtube" --text "Titre recherché" --entry-text="")
|
||||
[[ $song == "" ]] && exit 1
|
||||
# Ask for song name
|
||||
song=$(zenity --entry --width 300 --title "Titre à chercher sur Youtube" --text "Titre recherché" --entry-text="")
|
||||
[[ $song == "" ]] && exit 1
|
||||
else
|
||||
song=$(zenity --entry --width 300 --title "Confirmer ID" --text "Titre recherché (ou confirmer la saisie précédente)" --entry-text="$artist")
|
||||
[[ "$song" == "$artist" ]] && song=""
|
||||
song=$(zenity --entry --width 300 --title "Confirmer ID" --text "Titre recherché (ou confirmer la saisie précédente)" --entry-text="$artist")
|
||||
[[ "$song" == "$artist" ]] && song=""
|
||||
fi
|
||||
|
||||
# Download mp3 from 1st youtube search video result (--write-info-json)
|
||||
|
@ -246,18 +246,18 @@ cat /tmp/${CHOICE}_${MEDIAID}.log
|
|||
|
||||
exit 0
|
||||
|
||||
;;
|
||||
;;
|
||||
|
||||
########################################################################
|
||||
# __ _ _
|
||||
# / _(_) |_ __ ___
|
||||
#| |_| | | '_ ` _ \
|
||||
#| _| | | | | | | |
|
||||
# __ _ _
|
||||
# / _(_) |_ __ ___
|
||||
#| |_| | | '_ ` _ \
|
||||
#| _| | | | | | | |
|
||||
#|_| |_|_|_| |_| |_| THE MOVIE DATABASE INDEX
|
||||
#
|
||||
#
|
||||
########################################################################
|
||||
film | serie)
|
||||
|
||||
film | serie)
|
||||
|
||||
# SELECT FILE TO ADD TO ASTROPORT/KODI
|
||||
FILE=$(zenity --file-selection --title="Sélectionner le fichier à ajouter")
|
||||
echo "${FILE}"
|
||||
|
@ -270,11 +270,10 @@ FILE_EXT="${FILE_NAME##*.}"
|
|||
FILE_TITLE="${FILE_NAME%.*}"
|
||||
|
||||
# OPEN default browser and search TMDB
|
||||
zenity --question --width 300 --text "IMPORTANT! Indiquez le numéro d'identification TMDB de votre vidéo"
|
||||
[ $? == 1 ] && exit 1
|
||||
xdg-open "https://www.themoviedb.org/search?query=$(echo ${FILE_TITLE} | sed 's/_/%20/g')"
|
||||
zenity --question --width 300 --text "Ouvrir https://www.themoviedb.org pou récupérer le numéro d'identification de $(echo ${FILE_TITLE} | sed 's/_/%20/g') ?"
|
||||
[ $? == 0 ] && xdg-open "https://www.themoviedb.org/search?query=$(echo ${FILE_TITLE} | sed 's/_/%20/g')"
|
||||
|
||||
MEDIAID=$(zenity --entry --title="Identification TMDB" --text="Indiquez le numéro de la fiche du film. Exemple: 301528 (à extraire du lien https://www.themoviedb.org/movie/301528-toy-story-4)" --entry-text="")
|
||||
MEDIAID=$(zenity --entry --title="Identification TMDB" --text="Indiquez le numéro de la fiche du film. Ex: 301528 pour une adresse https://www.themoviedb.org/movie/301528-toy-story-4)" --entry-text="")
|
||||
[[ $MEDIAID == "" ]] && exit 1
|
||||
if ! [[ "$MEDIAID" =~ ^[0-9]+$ ]]
|
||||
then
|
||||
|
@ -363,10 +362,10 @@ GROUPES="_IPNSKEY_" # USE GROUPES TO RECORD MEDIAKEY
|
|||
mkdir -p ~/astroport/${CAT}/${MEDIAID}/
|
||||
mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}"
|
||||
if [ $? == 0 ]; then
|
||||
zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK puis patientez quelques minutes..."
|
||||
zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK puis patientez quelques minutes..."
|
||||
else
|
||||
zenity --warning --width ${large} --text "Impossible de déplacer votre fichier ${FILE_PATH}/${FILE_NAME} vers ~/astroport - EXIT -"
|
||||
exit 1
|
||||
zenity --warning --width ${large} --text "Impossible de déplacer votre fichier ${FILE_PATH}/${FILE_NAME} vers ~/astroport - EXIT -"
|
||||
exit 1
|
||||
fi
|
||||
FILE_NAME="${TITLE}.${FILE_EXT}"
|
||||
|
||||
|
@ -375,88 +374,88 @@ URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
|
|||
echo "${CAT};${MEDIAID};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${MEDIAID}/ajouter_video.txt
|
||||
# _IPFSREPFILEID_ is replaced later
|
||||
|
||||
;;
|
||||
# _ _
|
||||
#__ _(_) __| | ___ ___
|
||||
#\ \ / / |/ _` |/ _ \/ _ \
|
||||
;;
|
||||
# _ _
|
||||
#__ _(_) __| | ___ ___
|
||||
#\ \ / / |/ _` |/ _ \/ _ \
|
||||
# \ V /| | (_| | __/ (_) |
|
||||
# \_/ |_|\__,_|\___|\___/
|
||||
# \_/ |_|\__,_|\___|\___/
|
||||
# TIMESTAMP INDEX
|
||||
|
||||
video)
|
||||
|
||||
zenity --warning --width 600 --text 'DEVELOPPEMENT. SVP. Envoyez le LOG : https://git.p2p.legal .DEVELOPPEMENT'
|
||||
video)
|
||||
|
||||
## GENERAL MEDIAKEY for uploaded video. Title + Decription + hashtag + hashipfs
|
||||
# SELECT FILE TO ADD TO ASTROPORT/KODI
|
||||
FILE=$(zenity --file-selection --title="Sélectionner le fichier vidéo à ajouter")
|
||||
echo "${FILE}"
|
||||
[[ $FILE == "" ]] && exit 1
|
||||
zenity --warning --width 600 --text 'DEVELOPPEMENT. SVP. Envoyez le LOG : https://git.p2p.legal .DEVELOPPEMENT'
|
||||
|
||||
# Remove file extension to get file name => STITLE
|
||||
FILE_PATH="$(dirname "${FILE}")"
|
||||
FILE_NAME="$(basename "${FILE}")"
|
||||
FILE_EXT="${FILE_NAME##*.}"
|
||||
FILE_TITLE="${FILE_NAME%.*}"
|
||||
# VIDEO TITLE
|
||||
TITLE=$(zenity --entry --width 300 --title "Titre" --text "Indiquez le titre de la vidéo" --entry-text="${FILE_TITLE}")
|
||||
[[ $TITLE == "" ]] && exit 1
|
||||
TITLE=$(echo "${TITLE}" | sed "s/[(][^)]*[)]//g" | sed -e 's/;/_/g' ) # Clean TITLE (NO ;)
|
||||
|
||||
OUTPUT=$(zenity --forms --width ${large} --title="METADATA" --text="Ajouter des métadonnées" --separator=";" --add-entry="Sous titres" --add-entry="Hashtag(s)")
|
||||
[[ $? != 0 ]] && echo "FAIL" && exit 1
|
||||
## GENERAL MEDIAKEY for uploaded video. Title + Decription + hashtag + hashipfs
|
||||
# SELECT FILE TO ADD TO ASTROPORT/KODI
|
||||
FILE=$(zenity --file-selection --title="Sélectionner le fichier vidéo à ajouter")
|
||||
echo "${FILE}"
|
||||
[[ $FILE == "" ]] && exit 1
|
||||
|
||||
DESCRIPTION=$(awk -F ';' '{print $1}' <<<$OUTPUT)
|
||||
HASHTAG=$(awk -F ';' '{print $2}' <<<$OUTPUT)
|
||||
# Remove file extension to get file name => STITLE
|
||||
FILE_PATH="$(dirname "${FILE}")"
|
||||
FILE_NAME="$(basename "${FILE}")"
|
||||
FILE_EXT="${FILE_NAME##*.}"
|
||||
FILE_TITLE="${FILE_NAME%.*}"
|
||||
# VIDEO TITLE
|
||||
TITLE=$(zenity --entry --width 300 --title "Titre" --text "Indiquez le titre de la vidéo" --entry-text="${FILE_TITLE}")
|
||||
[[ $TITLE == "" ]] && exit 1
|
||||
TITLE=$(echo "${TITLE}" | sed "s/[(][^)]*[)]//g" | sed -e 's/;/_/g' ) # Clean TITLE (NO ;)
|
||||
|
||||
## video_timestamp INDEX
|
||||
MEDIAID="$(date -u +%s%N | cut -b1-13)"
|
||||
mkdir -p ~/astroport/${CAT}/${MEDIAID}/
|
||||
OUTPUT=$(zenity --forms --width ${large} --title="METADATA" --text="Ajouter des métadonnées" --separator=";" --add-entry="Sous titres" --add-entry="Hashtag(s)")
|
||||
[[ $? != 0 ]] && echo "FAIL" && exit 1
|
||||
|
||||
DESCRIPTION=$(awk -F ';' '{print $1}' <<<$OUTPUT)
|
||||
HASHTAG=$(awk -F ';' '{print $2}' <<<$OUTPUT)
|
||||
|
||||
## video_timestamp INDEX
|
||||
MEDIAID="$(date -u +%s%N | cut -b1-13)"
|
||||
mkdir -p ~/astroport/${CAT}/${MEDIAID}/
|
||||
MEDIAKEY="VIDEO_${MEDIAID}"
|
||||
|
||||
## CREATE SIMPLE JSON
|
||||
jq -n --arg ts "$MEDIAID" --arg title "$TITLE" --arg desc "$DESCRIPTION" --arg htag "$HASHTAG" '{"timestamp":$ts,"ipfs":"_IPFSREPFILEID_","ipns":"_IPNSKEY_","title":$title,"desc":$desc,"htag":$htag}' > ~/astroport/${CAT}/${MEDIAID}/video.json
|
||||
## MOVE FILE TO IMPORT ZONE
|
||||
mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}"
|
||||
FILE_NAME="${TITLE}.${FILE_EXT}"
|
||||
|
||||
;;
|
||||
## CREATE SIMPLE JSON
|
||||
jq -n --arg ts "$MEDIAID" --arg title "$TITLE" --arg desc "$DESCRIPTION" --arg htag "$HASHTAG" '{"timestamp":$ts,"ipfs":"_IPFSREPFILEID_","ipns":"_IPNSKEY_","title":$title,"desc":$desc,"htag":$htag}' > ~/astroport/${CAT}/${MEDIAID}/video.json
|
||||
## MOVE FILE TO IMPORT ZONE
|
||||
mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${MEDIAID}/${TITLE}.${FILE_EXT}"
|
||||
FILE_NAME="${TITLE}.${FILE_EXT}"
|
||||
|
||||
# _ _ _
|
||||
;;
|
||||
|
||||
# _ _ _
|
||||
#| | _____ __| (_)
|
||||
#| |/ / _ \ / _` | |
|
||||
#| < (_) | (_| | |
|
||||
#|_|\_\___/ \__,_|_|
|
||||
# COPY UQLOAD LINKS DETECTED IN KODI LOG
|
||||
|
||||
kodi)
|
||||
|
||||
if [[ ! -f $HOME/.local/bin/uqload_downloader ]]; then
|
||||
cd /tmp
|
||||
git clone https://github.com/papiche/uqload_downloader.git
|
||||
cd uqload_downloader/cli
|
||||
./download_from_kodi_log.sh
|
||||
[[ -f $HOME/.local/bin/uqload_downloader ]] && zenity --warning --width ${large} --text "INSTALLATION download_from_kodi_log.sh OK"
|
||||
cp download_from_kodi_log.sh $HOME/.local/bin/
|
||||
else
|
||||
## UTILISEZ $HOME/.local/bin/download_from_kodi_log.sh
|
||||
zenity --warning --width ${large} --text "UTILISEZ download_from_kodi_log.sh en ligne de commande..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
;;
|
||||
|
||||
kodi)
|
||||
|
||||
if [[ ! -f $HOME/.local/bin/uqload_downloader ]]; then
|
||||
cd /tmp
|
||||
git clone https://github.com/papiche/uqload_downloader.git
|
||||
cd uqload_downloader/cli
|
||||
./download_from_kodi_log.sh
|
||||
[[ -f $HOME/.local/bin/uqload_downloader ]] && zenity --warning --width ${large} --text "INSTALLATION download_from_kodi_log.sh OK"
|
||||
cp download_from_kodi_log.sh $HOME/.local/bin/
|
||||
else
|
||||
## UTILISEZ $HOME/.local/bin/download_from_kodi_log.sh
|
||||
zenity --warning --width ${large} --text "UTILISEZ download_from_kodi_log.sh en ligne de commande..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
;;
|
||||
|
||||
########################################################################
|
||||
# CASE ## DEFAULT
|
||||
########################################################################
|
||||
*)
|
||||
|
||||
zenity --warning --width ${large} --text "Impossible d'interpréter votre commande $CAT"
|
||||
exit 1
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
zenity --warning --width ${large} --text "Impossible d'interpréter votre commande $CAT"
|
||||
exit 1
|
||||
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
########################################################################
|
||||
|
|
Loading…
Reference in New Issue