show size of file that is currently uploading
This commit is contained in:
parent
ab00769f7d
commit
070ab9c187
1 changed files with 4 additions and 3 deletions
|
@ -334,15 +334,15 @@ class Client(object):
|
||||||
post = {'info': {}}
|
post = {'info': {}}
|
||||||
r = self.api.update(post)
|
r = self.api.update(post)
|
||||||
|
|
||||||
print 'Uploading %s files' % len(r['data']['file'])
|
|
||||||
if r['data']['file']:
|
if r['data']['file']:
|
||||||
|
print 'Uploading %s files' % len(r['data']['file'])
|
||||||
for oshash in r['data']['file']:
|
for oshash in r['data']['file']:
|
||||||
if oshash in filenames:
|
if oshash in filenames:
|
||||||
filename = filenames[oshash]
|
filename = filenames[oshash]
|
||||||
self.api.uploadData(os.path.join(prefix, filename), oshash)
|
self.api.uploadData(os.path.join(prefix, filename), oshash)
|
||||||
|
|
||||||
print 'Encoding and uploading %s videos' % len(r['data']['data'])
|
|
||||||
if r['data']['data']:
|
if r['data']['data']:
|
||||||
|
print 'Encoding and uploading %s videos' % len(r['data']['data'])
|
||||||
for oshash in r['data']['data']:
|
for oshash in r['data']['data']:
|
||||||
data = {}
|
data = {}
|
||||||
if oshash in filenames:
|
if oshash in filenames:
|
||||||
|
@ -417,8 +417,9 @@ class API(ox.API):
|
||||||
r = self._json_request(self.url, form)
|
r = self._json_request(self.url, form)
|
||||||
|
|
||||||
#upload video
|
#upload video
|
||||||
print "Uploading", filename
|
|
||||||
if os.path.exists(i['video']):
|
if os.path.exists(i['video']):
|
||||||
|
size = ox.formatBytes(os.path.getsize(i['video']))
|
||||||
|
print "Uploading %s (%s) of %s" % (profile, size, filename)
|
||||||
url = self.url + 'upload/' + '?profile=' + str(profile) + '&id=' + i['oshash']
|
url = self.url + 'upload/' + '?profile=' + str(profile) + '&id=' + i['oshash']
|
||||||
ogg = Firefogg(cj=self._cj, debug=DEBUG)
|
ogg = Firefogg(cj=self._cj, debug=DEBUG)
|
||||||
if not ogg.upload(url, i['video'], data):
|
if not ogg.upload(url, i['video'], data):
|
||||||
|
|
Loading…
Add table
Reference in a new issue