Fix spaces
Fix spaces
This commit is contained in:
parent
ec4dead6b1
commit
9386cf9afd
@ -1019,8 +1019,8 @@ class YoutubeDL(object):
|
|||||||
except (ContentTooShortError, ) as err:
|
except (ContentTooShortError, ) as err:
|
||||||
self.report_error('content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded))
|
self.report_error('content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded))
|
||||||
return
|
return
|
||||||
except StopDownloads:
|
except StopDownloads
|
||||||
return
|
return
|
||||||
|
|
||||||
if success:
|
if success:
|
||||||
try:
|
try:
|
||||||
@ -1032,16 +1032,16 @@ class YoutubeDL(object):
|
|||||||
self.record_download_archive(info_dict)
|
self.record_download_archive(info_dict)
|
||||||
|
|
||||||
def get_stop_state(self):
|
def get_stop_state(self):
|
||||||
return self._stop_state
|
return self._stop_state
|
||||||
|
|
||||||
def get_pause_state(self):
|
def get_pause_state(self):
|
||||||
return self._pause_state
|
return self._pause_state
|
||||||
|
|
||||||
def set_stop_state(self, stop_state):
|
def set_stop_state(self, stop_state):
|
||||||
self._stop_state = stop_state
|
self._stop_state = stop_state
|
||||||
|
|
||||||
def set_pause_state(self, pause_state):
|
def set_pause_state(self, pause_state):
|
||||||
self._pause_state = pause_state
|
self._pause_state = pause_state
|
||||||
|
|
||||||
def download(self, url_list):
|
def download(self, url_list):
|
||||||
"""Download a given list of URLs."""
|
"""Download a given list of URLs."""
|
||||||
|
@ -158,7 +158,7 @@ class FileDownloader(object):
|
|||||||
speed = float(byte_counter) / elapsed
|
speed = float(byte_counter) / elapsed
|
||||||
if speed > rate_limit:
|
if speed > rate_limit:
|
||||||
time.sleep((byte_counter - rate_limit * (now - start_time)) / rate_limit)
|
time.sleep((byte_counter - rate_limit * (now - start_time)) / rate_limit)
|
||||||
|
|
||||||
def temp_name(self, filename):
|
def temp_name(self, filename):
|
||||||
"""Returns a temporary filename for the given filename."""
|
"""Returns a temporary filename for the given filename."""
|
||||||
if self.params.get('nopart', False) or filename == u'-' or \
|
if self.params.get('nopart', False) or filename == u'-' or \
|
||||||
@ -302,23 +302,23 @@ class FileDownloader(object):
|
|||||||
ph(status)
|
ph(status)
|
||||||
|
|
||||||
def _check_stop_handler(self):
|
def _check_stop_handler(self):
|
||||||
if self._stop_handler is not None:
|
if self._stop_handler is not None:
|
||||||
if self._stop_handler():
|
if self._stop_handler():
|
||||||
raise StopDownloads()
|
raise StopDownloads()
|
||||||
|
|
||||||
def _check_pause_handler(self):
|
def _check_pause_handler(self):
|
||||||
if self._pause_handler is not None:
|
if self._pause_handler is not None:
|
||||||
while self._pause_handler():
|
while self._pause_handler():
|
||||||
if self._stop_handler(): break
|
if self._stop_handler(): break
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
def set_stop_handler(self, stop_handler):
|
def set_stop_handler(self, stop_handler):
|
||||||
""" stop_handler gets checked. If True raise StopDownloads """
|
""" stop_handler gets checked. If True raise StopDownloads """
|
||||||
self._stop_handler = stop_handler
|
self._stop_handler = stop_handler
|
||||||
|
|
||||||
def set_pause_handler(self, pause_handler):
|
def set_pause_handler(self, pause_handler):
|
||||||
""" pause_handler gets checked. If True pause downloads """
|
""" pause_handler gets checked. If True pause downloads """
|
||||||
self._pause_handler = pause_handler
|
self._pause_handler = pause_handler
|
||||||
|
|
||||||
def add_progress_hook(self, ph):
|
def add_progress_hook(self, ph):
|
||||||
""" ph gets called on download progress, with a dictionary with the entries
|
""" ph gets called on download progress, with a dictionary with the entries
|
||||||
|
Loading…
x
Reference in New Issue
Block a user