[downloader/fragment] Use temp file for current fragment

This commit is contained in:
Sergey M․ 2017-04-24 02:54:17 +07:00
parent a4d6cf970c
commit d3f0687cf7
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D
2 changed files with 41 additions and 26 deletions

View file

@ -20,14 +20,10 @@ from ..utils import (
class HttpFD(FileDownloader):
def real_download(self, filename_or_stream, info_dict):
def real_download(self, filename, info_dict):
url = info_dict['url']
filename = filename_or_stream
stream = None
if hasattr(filename_or_stream, 'write'):
stream = filename_or_stream
filename = '-'
tmpfilename = self.temp_name(filename)
stream = None
# Do not include the Accept-Encoding header
headers = {'Youtubedl-no-compression': 'True'}