4
dmedia.configure_logging('upload')
6
from dmedia.core import Core
11
uds_o = 'EIJ5EVPOJSO5ZBDYANRM2XT7'
14
#for row in c.db.view('user/video', include_docs=True):
17
# if 'proxy' not in doc:
18
# print 'no proxy {_id}'.format(**doc)
20
# doc = c.db.get(doc['proxy'])
21
# doc['content_type'] = 'video/webm'
22
# doc['name'] = 'uds-o-%04d.webm' % i
30
for row in c.db.view('user/video', include_docs=True):
32
if 'proxy' not in doc:
33
print 'no proxy {_id}'.format(**doc)
35
doc = c.db.get(doc['proxy'])
36
if uds_o in doc['stored']:
37
print 'already in uds-o bucket {_id}'.format(**doc)
39
print 'will upload {_id}'.format(**doc)
41
if len(c.manager.list_jobs()) < 3:
42
c.upload(doc['_id'], uds_o)
45
print 'waiting for an upload to finish...'