Browse Source

Merge branch 'master' into astrXbian_et_one_nation

astrXbian_et_one_nation
qo-op 1 year ago
parent
commit
fda0f64b77
  1. 29
      ajouter_video.sh
  2. 2
      install.sh
  3. 6
      zen/new_file_in_astroport.sh
  4. 8
      zen/new_mp3_in_astroport.sh

29
ajouter_video.sh

@ -85,14 +85,17 @@ FILE_PATH="$HOME/astroport/youtube/$YID"
mkdir -p ${FILE_PATH} && mv -f ${YTEMP}/* ${FILE_PATH}/
## CORRECT PARAMETERS to Make Kodi compatible YASTRXBIAN FILE
CAT="film"
PREFIX="Y"
TITLE="${YNAME%.*}"
GENRES="[Youtube]"
GROUPES="${XZUID}"
GROUPES="_IPNSKEY_"
FILE_RES=$(ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "${FILE_PATH}/${FILE_NAME}" | cut -d "x" -f 2)
RES=${FILE_RES%?}0p
## CREATE "~/astroport/${CAT}/${TMDB}/ajouter_video.txt" (with film CAT !!!)
URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
echo "film;${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${TMDB}/ajouter_video.txt
# _IPFSREPFILEID_ is replaced later
rm -Rf ${YTEMP}
;;
@ -179,8 +182,13 @@ zenity --question --width 300 --text "IMPORTANT! Nous allons ouvrir le site them
[ $? == 1 ] && exit 1
xdg-open "https://www.themoviedb.org/search?query=${FILE_TITLE}"
TMDB=$(zenity --entry --title="Identification TMDB" --text="Indiquez le numéro de la fiche du film. Exemple: https://www.themoviedb.org/movie/301528-toy-story-4 => 301528" --entry-text="")
TMDB=$(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="")
[[ $TMDB == "" ]] && exit 1
if ! [[ "$TMDB" =~ ^[0-9]+$ ]]
then
zenity --warning --width ${large} --text "Vous devez renseigner un numéro! Merci de recommencer..." && exit 1
fi
# VIDEO TITLE
TITLE=$(zenity --entry --width 300 --title "Titre" --text "Indiquez le titre de la vidéo" --entry-text="${FILE_TITLE}")
@ -261,6 +269,12 @@ mkdir -p ~/astroport/${CAT}/${TMDB}/
mv -f "${FILE_PATH}/${FILE_NAME}" "$HOME/astroport/${CAT}/${TMDB}/${TITLE}.${FILE_EXT}" && zenity --warning --width ${large} --text "Votre fichier ~/astroport/${CAT}/${TMDB}/${TITLE}.${FILE_EXT} est prêt à embarquer. Cliquez sur OK puis patientez quelques minutes..."
FILE_NAME="${TITLE}.${FILE_EXT}"
## CREATE "~/astroport/${CAT}/${TMDB}/ajouter_video.txt"
URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
echo "${CAT};${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${TMDB}/ajouter_video.txt
# _IPFSREPFILEID_ is replaced later
;;
########################################################################
@ -276,13 +290,6 @@ FILE_NAME="${TITLE}.${FILE_EXT}"
esac
########################################################################
## CREATE "~/astroport/${CAT}/${TMDB}/ajouter_video.txt"
########################################################################
URLENCODE_FILE_NAME=$(echo ${FILE_NAME} | jq -Rr @uri)
echo "${CAT};${TMDB};${YEAR};${TITLE};${SAISON};${GENRES};${GROUPES};${RES};/ipfs/_IPFSREPFILEID_/$URLENCODE_FILE_NAME" > ~/astroport/${CAT}/${TMDB}/ajouter_video.txt
# _IPFSREPFILEID_ is replaced later
########################################################################
# ADD $FILE to IPFS / ASTROPORT / KODI
########################################################################
~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/${CAT}/${TMDB}/" "${FILE_NAME}" > /tmp/${CAT}_${TMDB}.log 2>&1

2
install.sh

@ -15,7 +15,7 @@ sudo apt-get update
sudo apt-get install git fail2ban inotify-tools curl net-tools libsodium* python3-dev python3-pip python3-setuptools python3-wheel mpack libssl-dev libffi-dev -y
sudo apt-get install build-essential qrencode jq bc gawk ffmpeg sqlite dnsutils vlc mp3info -y
[[ ! $(which kodi) ]] && sudo apt-get install kodi -y
[[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils zenity handbrake-gtk -y
[[ "$USER" != "xbian" ]] && sudo apt-get install x11-utils zenity handbrake* -y
# [[ ! $(which apache2) ]] && sudo apt-get install mariadb-server nginx python3-certbot-nginx certbot ssl-cert php-imap php-cli php-curl php-sqlite3 php-gd php-json php-xml php-mbstring php-gettext php-mysql php-fpm -y
pip3 install cryptography Ed25519 base58 google protobuf duniterpy

6
zen/new_file_in_astroport.sh

@ -72,7 +72,11 @@ case ${CAT} in
film | serie | anime)
INDEXPREFIX="TMDB_"
REFERENCE=$(echo "$path" | cut -d '/' -f 6 ) # Path contains TMDB id
[ "${REFERENCE}" -ne "${REFERENCE}" ] && echo "ERROR: $path BAD TMDB code. Get it from https://www.themoviedb.org/ " && exit 1 # ${REFERENCE} NOT A NUMBER
if ! [[ "$REFERENCE" =~ ^[0-9]+$ ]] # ${REFERENCE} NOT A NUMBER
then
echo "ERROR: $path BAD TMDB code. Get it from https://www.themoviedb.org/ "
exit 1
fi
;;
*)
echo "$CAT inconnu" && exit 1

8
zen/new_mp3_in_astroport.sh

@ -126,9 +126,9 @@ IPNS=$(ipfs name publish --quieter --key="${INDEXPREFIX}${REFERENCE}" $NEWIPFS)
## CHECK CONFIANCE and decide to fingerprint
if (( $(echo "$CONFIANCE < 0.9" | bc -l) )); then
# USE IPNS KEY for "song_name"
NEWCOG=$(curl -X POST "http://localhost:8600/api/v1/mazash/fingerprint" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"cid\":\"${SAMPLEID}\",\"extension\":\".mp3\",\"song\":\"${IPNS}\"}")
echo "NEWCOG" | jq
# fingerprint track & USE IPNS KEY for "song_name"
NEWCOG=$(curl -X POST "http://localhost:8600/api/v1/mazash/fingerprint" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"cid\":\"${IPFSREPFILEID}\",\"extension\":\".mp3\",\"song\":\"${IPNS}\"}")
echo "$NEWCOG" | jq
fi
# MEMORIZE NEW PIN
@ -142,5 +142,7 @@ touch ~/.zen/ipfs/.${IPFSNODEID}/PIN/${IPFSREPFILEID}/${G1PUB}
########################################################################
rm -Rf ${YTEMP}
echo "NEW ($file) ADDED."
echo "IPNS LINK : http://127.0.0.1:8181/ipns/$KEY/$G1PUB/"
exit 0

Loading…
Cancel
Save