Skip to content

Instantly share code, notes, and snippets.

@flavioribeiro
Created June 24, 2016 19:05
Show Gist options
  • Select an option

  • Save flavioribeiro/037aed27095b67505c20f67fc250bb98 to your computer and use it in GitHub Desktop.

Select an option

Save flavioribeiro/037aed27095b67505c20f67fc250bb98 to your computer and use it in GitHub Desktop.
import requests, json, time
#jobs_url = "http://internal-video-pipeline-dev-1193624058.us-east-1.elb.amazonaws.com/jobs/"
jobs_url = "http://localhost:8080/jobs/"
source_url = 'https://vp.nyt.com/video/2016/05/15/40007_1_retro-lsd_wg_240p.mp4'
job_info = json.loads(requests.post(jobs_url, data=json.dumps({'productionId': '123'})).text)
json_data = {
'provider': 'elementalconductor',
'source': source_url,
'presets': ['hls_1080_3'],
'outputDestination': '/new/target/',
}
url = jobs_url + job_info['jobId'] + '/start'
response = requests.post(url, data=json.dumps(json_data))
while True:
print requests.get(jobs_url + job_info['jobId']).text
time.sleep(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment