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__': ...@@ -60,11 +60,16 @@ if __name__ == '__main__':
# ping # ping
print(msc.api('/', method='get')) print(msc.api('/', method='get'))
with open('/tmp/file.zip', 'wb') as f: basename = os.path.basename(args.url)
f.write(requests.get(args.url).content) r = msc.api('/search', method='get', data={'search': basename})
# add media with a zip if r.get('videos'):
#print(msc.add_media('Test multichunk upload zip', file_path='/tmp/file.zip')) print('Video %s seems to be already present on the portal, not reuploading' % basename)
print(msc.add_media(file_path='/tmp/file.zip')) 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 # add user
# print(msc.api('users/add/', method='post', data={'email': 'test@test.com'})) # 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