This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source.sh | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import StreamingHttpResponse | |
from wsgiref.util import FileWrapper | |
import mimetypes | |
import os | |
import re | |
range_re = re.compile(r'bytes\s*=\s*(\d+)\s*-\s*(\d*)', re.I) | |
class RangeFileWrapper (object): | |
def __init__(self, filelike, blksize=8192, offset=0, length=None): |