1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-04 00:55:15 +00:00

[cleanup] misc

This commit is contained in:
pukkandan
2021-10-23 02:07:20 +05:30
parent 457f6d6866
commit 49a57e70a9
17 changed files with 104 additions and 69 deletions

View File

@ -448,7 +448,9 @@ class InfoExtractor(object):
}
def __init__(self, downloader=None):
"""Constructor. Receives an optional downloader."""
"""Constructor. Receives an optional downloader (a YoutubeDL instance).
If a downloader is not passed during initialization,
it must be set using "set_downloader()" before "extract()" is called"""
self._ready = False
self._x_forwarded_for_ip = None
self._printed_messages = set()
@ -664,7 +666,7 @@ class InfoExtractor(object):
See _download_webpage docstring for arguments specification.
"""
if not self._downloader._first_webpage_request:
sleep_interval = float_or_none(self.get_param('sleep_interval_requests')) or 0
sleep_interval = self.get_param('sleep_interval_requests') or 0
if sleep_interval > 0:
self.to_screen('Sleeping %s seconds ...' % sleep_interval)
time.sleep(sleep_interval)