Skip to content

Instantly share code, notes, and snippets.

@digitaldavenyc
Created May 29, 2014 18:04
Show Gist options
  • Save digitaldavenyc/8e5e7915b53120b59f5a to your computer and use it in GitHub Desktop.
Save digitaldavenyc/8e5e7915b53120b59f5a to your computer and use it in GitHub Desktop.
import json
import urllib2
from django.http import HttpResponse
def send(request):
url = 'http://manage.encoding.com:80'
params = {
"query": {
"userid": "31165",
"userkey": "923eced57b904ec0037987e343fefb7e",
"action": "addMedia",
"source": "http://markusbucket.s3.amazonaws.com/source/OfficeSpace1999.mp4",
"format": "",
"output": "mp4",
"file_extension": "mp4",
"size": "0x360",
"framerate": "30",
"video_codec": "libx264",
"keyframe": "150",
"profile": "main",
"bitrate": "700k",
"audio_codec": "dolby_heaac",
"audio_bitrate": "64k"
}
}
req = urllib2.Request(url=url,
data=json.dumps(params),
headers={'Content-Type': 'application/json'})
response = urllib2.urlopen(req)
return HttpResponse(response.read(), content_type="application/json")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment