diff --git a/peertube_list_videos.sh b/peertube_list_videos.sh new file mode 100644 index 0000000..e544aeb --- /dev/null +++ b/peertube_list_videos.sh @@ -0,0 +1,26 @@ +CONFIG_FILE_PATH=pt.conf + +if [ ! -f $CONF_FILE_PATH ]; then echo "Config file not found...." && exit 1; fi + + +PT_HOST=$(cat $CONFIG_FILE_PATH | jq -r .host) +PT_ACCESS_TOKEN=$(cat $CONFIG_FILE_PATH | jq -r .access_token) + + +echo Fetching User.... + +TMPF=$(mktemp) + + +curl -sn -H "Authorization: Bearer $PT_ACCESS_TOKEN" https://$PT_HOST/api/v1/me/videos > videos + +echo + +cat $TMPF | jq .data[].id + + +echo + +rm $TMPF +# debug +#echo $(cat $TMPF | jq) diff --git a/peertube_upload.sh b/peertube_upload.sh index 7092508..0ccf81c 100644 --- a/peertube_upload.sh +++ b/peertube_upload.sh @@ -35,8 +35,13 @@ echo Uploading.... curl -sn -H "Authorization: Bearer $PT_TOKEN" https://$PT_HOST/api/v1/videos/upload --max-time 600 \ --form videofile=@"$FILE_PATH" \ --form channelId=$CHANNEL_ID \ + --form waitTranscoding="true" \ + --form privacy=1 \ --form name="$UPLOAD_NAME" > $TMPF + # 1=Public, 2=Unlisted, 3=Private, 4=Internal + + echo