mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
added a test mode to FileDownloader that fetches only first 10K
This commit is contained in:
parent
863baa16ec
commit
37c8fd4842
1 changed files with 4 additions and 0 deletions
|
@ -78,6 +78,7 @@ class FileDownloader(object):
|
|||
writeinfojson: Write the video description to a .info.json file
|
||||
writesubtitles: Write the video subtitles to a .srt file
|
||||
subtitleslang: Language of the subtitles to download
|
||||
test: Download only first bytes to test the downloader.
|
||||
"""
|
||||
|
||||
params = None
|
||||
|
@ -594,6 +595,9 @@ def _do_download(self, filename, info_dict):
|
|||
basic_request = compat_urllib_request.Request(url, None, headers)
|
||||
request = compat_urllib_request.Request(url, None, headers)
|
||||
|
||||
if self.params.get('test', False):
|
||||
request.add_header('Range','bytes=0-10240')
|
||||
|
||||
# Establish possible resume length
|
||||
if os.path.isfile(encodeFilename(tmpfilename)):
|
||||
resume_len = os.path.getsize(encodeFilename(tmpfilename))
|
||||
|
|
Loading…
Reference in a new issue