Created
September 30, 2016 00:58
-
-
Save timmyw/1f932fabc3471989a645121e9ef0a72e to your computer and use it in GitHub Desktop.
auth then playout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| [email protected] | |
| pass=timmytest1 | |
| # Assumes vimond-api-proxy is running locally on port 8001 | |
| apiproxyhost=http://localhost:8001 | |
| assetid=1667 | |
| echo "Authenticating..." | |
| curl -s -o /tmp/authprog -D /tmp/authheaders -H "Accept: application/json" --data "[email protected]&password=timmytest1" http://sit1-play.iflix.com/api/authentication/user/login | |
| grep -q x-vimond-playout-access-token /tmp/authheaders | |
| if [ $? -ne 0 ]; then | |
| echo "Authorisation failed. Check /tmp/authheaders" | |
| exit 2 | |
| fi | |
| token=$(grep x-vimond-playout-access-token /tmp/authheaders | | |
| sed -e 's/.*token: \(.*\)/\1/' -e 's/\r$//') | |
| echo "Using token: $token" | |
| echo curl -H "'Authorization: $token'" -H \'Accept:application/json\' $apiproxyhost/layer/playout/web/asset/$assetid > /tmp/runplay | |
| cat /tmp/runplay | |
| sh /tmp/runplay | |
| rm /tmp/authheaders |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment