zencoder¶
-
class
zencoder.core.Zencoder(api_key=None, api_version=None, base_url=None, timeout=None, test=False, proxies=None, cert=None, verify=True)¶ Bases:
objectThis is the entry point to the Zencoder API. You must have a valid
api_key.You can pass in the api_key as an argument, or set
ZENCODER_API_KEYas an environment variable, and it will use that, ifapi_keyis unspecified.Set
api_version='edge'to get the Zencoder development API. (defaults to ‘v2’)timeout,proxiesandverifycan be set to control the underlying HTTP requests that are made.
-
class
zencoder.core.Account(*args, **kwargs)¶ Bases:
zencoder.core.HTTPBackendContains all API methods relating to Accounts.
https://app.zencoder.com/docs/api/inputs
-
create(email, tos=1, options=None)¶ Creates an account with Zencoder, no API Key necessary.
-
details()¶ Gets account details.
-
integration()¶ Puts the account into integration mode.
-
live()¶ Puts the account into live mode.
-
-
class
zencoder.core.Job(*args, **kwargs)¶ Bases:
zencoder.core.HTTPBackendContains all API methods relating to transcoding Jobs.
https://app.zencoder.com/docs/api/jobs
-
cancel(job_id)¶ Cancels the given
job_id.
-
create(input=None, live_stream=False, outputs=None, options=None)¶ Creates a transcoding job. Here are some examples:
job.create('s3://zencodertesting/test.mov') job.create(live_stream=True) job.create(input='http://example.com/input.mov', outputs=({'label': 'test output'},))
-
delete(job_id)¶ Deletes the given
job_id.- WARNING: This method is aliased to Job.cancel – it is deprecated in
- API version 2 and greater.
-
details(job_id)¶ Returns details of the given
job_id.
-
finish(job_id)¶ Finishes the live stream for
job_id.
-
list(page=1, per_page=50)¶ Lists Jobs.
-
progress(job_id)¶ Returns the progress of the given
job_id.
-
resubmit(job_id)¶ Resubmits the given
job_id.
-
-
class
zencoder.core.Output(*args, **kwargs)¶ Bases:
zencoder.core.HTTPBackendContains all API methods relating to Outputs.
https://app.zencoder.com/docs/api/outputs
-
details(output_id)¶ Returns the details of the given
output_id.
-
progress(output_id)¶ Returns the progress for the given
output_id.
-
-
class
zencoder.core.Response(code, body, raw_body, raw_response)¶ Bases:
objectThe Response object stores the details of an API request.
Response.body contains the loaded JSON response from the API.
-
class
zencoder.core.HTTPBackend(base_url, api_key, resource_name=None, timeout=None, test=False, version=None, proxies=None, cert=None, verify=True)¶ Bases:
objectAbstracts out an HTTP backend. Required argument are
base_urlandapi_key.-
delete(url, params=None)¶ Executes an HTTP DELETE request for the given URL.
paramsshould be a dictionary
-
get(url, data=None)¶ Executes an HTTP GET request for the given URL.
datashould be a dictionary of url parameters
-
headers¶ Returns default headers, by setting the Content-Type, Accepts, User-Agent and API Key headers.
-
post(url, body=None)¶ Executes an HTTP POST request for the given URL.
-
process(response)¶ Returns HTTP backend agnostic
Responsedata.
-
put(url, data=None, body=None)¶ Executes an HTTP PUT request for the given URL.
-