32 lines
603 B
Plaintext
32 lines
603 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
set -o errexit
|
||
|
|
||
|
main() {
|
||
|
[[ "${OOM_YOUTUBE_ACCESS_TOKEN}" ]] || {
|
||
|
echo "Missing \$OOM_YOUTUBE_ACCESS_TOKEN"
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
[[ "${OOM_CLIENT_SECRET}" ]] || {
|
||
|
echo "Missing \$OOM_CLIENT_SECRET"
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
[[ "${OOM_CLIENT_ID}" ]] || {
|
||
|
echo "Missing \$OOM_CLIENT_ID"
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
curl \
|
||
|
-vvvv \
|
||
|
-X POST \
|
||
|
-sSL \
|
||
|
-d client_id="${OOM_CLIENT_ID}" \
|
||
|
-d client_secret="${OOM_CLIENT_SECRET}" \
|
||
|
-d refresh_token="${OOM_YOUTUBE_ACCESS_TOKEN}" \
|
||
|
-d grant_type=refresh_token \
|
||
|
'https://accounts.google.com/o/oauth2/token'
|
||
|
}
|
||
|
|
||
|
main "$@"
|