Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit38d1e4e

Browse files
author
Alex Schworer
committed
Merge branch 'master' into requests-http
Conflicts:zencoder/__init__.py
2 parents754b3b4 +7907cfd commit38d1e4e

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

‎zencoder/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from .coreimportZencoder
22
from .coreimportZencoderResponseError
3-
43
from .coreimportAccount
4+
from .coreimport__version__
55

6-
__version__='0.5.2'
76
__title__='zencoder'
87
__author__='Alex Schworer'
98

‎zencoder/core.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
importrequests
33
fromdatetimeimportdatetime
44

5-
LIB_VERSION='0.5.2'
6-
75
# Note: I've seen this pattern for dealing with json in different versions of
86
# python in a lot of modules -- if there's a better way, I'd love to use it.
97
try:
@@ -20,6 +18,8 @@
2018
fromdjango.utilsimportsimplejson
2119
json=simplejson
2220

21+
__version__='0.5.2'
22+
2323
classZencoderError(Exception):
2424
pass
2525

@@ -62,7 +62,7 @@ def headers(self):
6262
'Content-Type':'application/json',
6363
'Accept':'application/json',
6464
'Zencoder-Api-Key':self.api_key,
65-
'User-Agent':'zencoder-py v{0}'.format(LIB_VERSION)
65+
'User-Agent':'zencoder-py v{0}'.format(__version__)
6666
}
6767

6868
returnheaders
@@ -237,17 +237,16 @@ def __init__(self, *args, **kwargs):
237237
kwargs['resource_name']='jobs'
238238
super(Job,self).__init__(*args,**kwargs)
239239

240-
defcreate(self,input,outputs=None,options=None):
240+
defcreate(self,input=None,live_stream=False,outputs=None,options=None):
241241
"""
242-
Creates a job
242+
Creates atranscodingjob.
243243
244244
@param input: the input url as string
245+
@param live_stream: starts an RTMP Live Stream
245246
@param outputs: a list of output dictionaries
246247
@param options: a dictionary of job options
247248
"""
248-
as_test=int(self.test)
249-
250-
data= {"input":input,"test":as_test}
249+
data= {"input":input,"test":self.test}
251250
ifoutputs:
252251
data['outputs']=outputs
253252

@@ -304,6 +303,10 @@ def delete(self, job_id):
304303
"""
305304
returnself.cancel(job_id)
306305

306+
deffinish(self,job_id):
307+
""" Finishes the live stream for `job_id`. """
308+
returnself.put(self.base_url+'/%s/finish'%str(job_id))
309+
307310
classReport(HTTPBackend):
308311
def__init__(self,*args,**kwargs):
309312
"""
@@ -344,3 +347,4 @@ def minutes(self, start_date=None, end_date=None, grouping=None):
344347

345348
url=self.base_url+'/minutes'
346349
returnself.get(url,data=data)
350+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp