Created
May 5, 2014 19:28
-
-
Save digitaldavenyc/ef40996323dda810d04b to your computer and use it in GitHub Desktop.
Encoding.com AddMedia Request
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
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