Skip to content
Snippets Groups Projects
Commit a0076fbd authored by Florent Thiery's avatar Florent Thiery
Browse files

do not reupload video files, refs #26945

parent 8fa5e33a
No related branches found
No related tags found
No related merge requests found
......@@ -60,11 +60,16 @@ if __name__ == '__main__':
# ping
print(msc.api('/', method='get'))
with open('/tmp/file.zip', 'wb') as f:
f.write(requests.get(args.url).content)
# add media with a zip
#print(msc.add_media('Test multichunk upload zip', file_path='/tmp/file.zip'))
print(msc.add_media(file_path='/tmp/file.zip'))
basename = os.path.basename(args.url)
r = msc.api('/search', method='get', data={'search': basename})
if r.get('videos'):
print('Video %s seems to be already present on the portal, not reuploading' % basename)
else:
with open('/tmp/file.zip', 'wb') as f:
f.write(requests.get(args.url).content)
# add media with a zip
#print(msc.add_media('Test multichunk upload zip', file_path='/tmp/file.zip'))
print(msc.add_media(file_path='/tmp/file.zip'))
# add user
# print(msc.api('users/add/', method='post', data={'email': 'test@test.com'}))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment