Skip to content

Instantly share code, notes, and snippets.

@dardo82
Last active May 26, 2019 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dardo82/3ea05405481dbffe8b8f1013f8f0b5cf to your computer and use it in GitHub Desktop.
Save dardo82/3ea05405481dbffe8b8f1013f8f0b5cf to your computer and use it in GitHub Desktop.
YT to VideoIndexer
#!/bin/sh
API="https://api.videoindexer.ai/auth/trial/Accounts/be4863e0-b5be-416d-9de2-91dbdd0afd11"
TOKEN=$(curl -s -H "Ocp-Apim-Subscription-Key:5ebebe8abada42c4a04065544942edf5" "$API/AccessToken?allowEdit=true" | tr -d \")
NAME=$(youtube-dl --get-title $1 | tr \ _); URL=$(curl -s "https://tinyurl.com/api-create.php?url=$(youtube-dl -g -f mp4 $1)")
curl -s -X POST -H "Content-Length:0" "${API//\/auth/}/Videos?language=auto&name=$NAME&videoUrl=$URL&accessToken=$TOKEN"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment