Commit 56729ed8 authored by Ilya Simonov's avatar Ilya Simonov

revert 66b10e45

parent 0ae86211
...@@ -4,6 +4,7 @@ import logging ...@@ -4,6 +4,7 @@ import logging
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from moviepy.editor import VideoFileClip from moviepy.editor import VideoFileClip
from wsgiref.util import FileWrapper
from .models import Video, Playlist, TagToObject, DYNAMIC, PlaylistVideo from .models import Video, Playlist, TagToObject, DYNAMIC, PlaylistVideo
...@@ -24,10 +25,13 @@ def download_file(url): ...@@ -24,10 +25,13 @@ def download_file(url):
return local_filename return local_filename
def handle_uploaded_file(f, file_name): def handle_uploaded_file(file, filename):
chunk_count = 0 chunk_count = 0
with open(file_name, 'wb+') as destination:
for chunk in f.chunks(): wrapper = FileWrapper(file, blksize=100)
with open(filename, 'wb+') as destination:
# for chunk in file.chunks():
for chunk in wrapper:
destination.write(chunk) destination.write(chunk)
chunk_count += 1 chunk_count += 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment