diff --git a/API/PLAYER.sh b/API/PLAYER.sh index 75926a99..30e9bd09 100755 --- a/API/PLAYER.sh +++ b/API/PLAYER.sh @@ -54,12 +54,15 @@ Content-Type: text/html; charset=UTF-8 fi ############################################## -# YOUTUBE : /?player=PLAYER&youtube=_URL_ +# YOUTUBE : /?player=PLAYER&(youtube | pdf | image) =_URL_ ############################################## - if [[ ${APPNAME} == "youtube" ]]; then + if [[ ${APPNAME} == "youtube" || ${APPNAME} == "pdf" || ${APPNAME} == "image" ]]; then + + APPNAME=$(echo ${APPNAME} | sed -r 's/\<./\U&/g' | sed 's/ //g') ## First letter Capital [[ ! ${WHAT} ]] && WHAT="https://www.youtube.com/watch?v=BCl2-0HBJ2c" - echo "COPY YOUTUBE ${PLAYER} ${WHAT}" + + echo ">>> COPY ${APPNAME} for ${PLAYER} from ${WHAT}" G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub) [[ ! ${G1PUB} ]] && espeak "NOT MY PLAYER " && echo "${PLAYER} IS NOT MY PLAYER" && exit 1 @@ -69,7 +72,7 @@ Content-Type: text/html; charset=UTF-8 echo " = /ipfs/${TW}" echo "================================================" - ${MY_PATH}/../ajouter_media.sh "${WHAT}" "${PLAYER}" "Video" & + ${MY_PATH}/../ajouter_media.sh "${WHAT}" "${PLAYER}" "${APPNAME}" & echo "${HTTPCORS}" > ~/.zen/tmp/${MOATS}.${PLAYER}.http echo "${myIPFS}/ipns/${ASTRONAUTENS}" >> ~/.zen/tmp/${MOATS}.${PLAYER}.http @@ -80,6 +83,7 @@ Content-Type: text/html; charset=UTF-8 end=`date +%s` echo "(TW) MOA Operation time was "`expr $end - $start` seconds. exit 0 + fi exit 1 diff --git a/API/SALT.sh b/API/SALT.sh index 1a7e0cf2..2356dc12 100755 --- a/API/SALT.sh +++ b/API/SALT.sh @@ -376,11 +376,15 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh g1friend=${WHAT} stars=${VAL:-1} // Default 1 ★ - $MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/tmp/coucou/${MOATS}.secret.key stars -p $g1friend -n $stars + $MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/tmp/coucou/${MOATS}.secret.key stars -p $g1friend -n $stars > ~/.zen/tmp/coucou/${MOATS}.log + + ( + echo "$HTTPCORS $(cat ~/.zen/tmp/coucou/${MOATS}.log)"| nc -l -p ${PORT} -q 1 > /dev/null 2>&1 + ) & + rm ~/.zen/tmp/coucou/${MOATS}.* - #~ echo "$HTTPCORS ${MESTAR}"| nc -l -p ${PORT} -q 1 > /dev/null 2>&1 & - #~ end=`date +%s` - #~ echo $APPNAME "(☉_☉ ) ${MESTAR} Execution time was "`expr $end - $start` seconds. + end=`date +%s` + echo $APPNAME "(☉_☉ ) ${MESTAR} Execution time was "`expr $end - $start` seconds. exit 0 fi @@ -401,11 +405,14 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh # GETG1PUB ############################################## if [[ $APPNAME == "getg1pub" ]]; then - ( echo "$HTTPCORS - url='"${G1PUB}"'" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && echo "SLURP getg1pub : ${G1PUB}" ) & + ( + echo "$HTTPCORS + url='"${G1PUB}"'" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && echo "SLURP getg1pub : ${G1PUB}" + echo "BLURP ${PORT}" + ) & end=`date +%s` echo $APPNAME "(☉_☉ ) /ipns/${ASTRONAUTENS} Execution time was "`expr $end - $start` seconds. - rm ~/.zen/tmp/coucou/${MOATS}.* + rm ~/.zen/tmp/coucou/${MOATS}* exit 0 fi @@ -435,9 +442,10 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh #~ sed -i "s~_UPEPPER_~${UPEPPER}~g" ~/.zen/tmp/coucou/${MOATS}.index.redirect echo "url='"${REPLACE}"'" >> ~/.zen/tmp/coucou/${MOATS}.index.redirect ( - cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 - echo "BLURP " && rm ~/.zen/tmp/coucou/${MOATS}* + cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 + echo "BLURP ${PORT}" ) & + rm ~/.zen/tmp/coucou/${MOATS}* end=`date +%s` echo $APPNAME "(☉_☉ ) Execution time was "`expr $end - $start` seconds. exit 0 diff --git a/README.md b/README.md index 540e6590..21cb5675 100644 --- a/README.md +++ b/README.md @@ -264,7 +264,7 @@ GET /?player=${PLAYER}&moa=json&tag=G1CopierYoutube | `tag` | `${VAL}` | TW filtering default G1CopierYoutube | -### Lancer la copie Video d'une URL Youtube par PLAYER +### Lancer la copie d'une URL (youtube | pdf ) par PLAYER dans son TW ```http GET /?player=${PLAYER}&youtube=URLENCODED ``` @@ -272,8 +272,7 @@ GET /?player=${PLAYER}&youtube=URLENCODED | Parameter | Type | Description | | :-------- | :------- | :-------------------------------- | | `player` | `string` | **Required**. Your EMAIL token | -| `youtube` | `string` | **Required** URL = Video URL | - +| `youtube | pdf` | `string` | **Required** URL kind = URL | ### QRCODE (API SandBox)