mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-18 17:27:47 +01:00
parent
8993721ecb
commit
dbd8b1bff9
@ -962,8 +962,9 @@ def __exit__(self, *args):
|
|||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.save_cookies()
|
self.save_cookies()
|
||||||
self._request_director.close()
|
if '_request_director' in self.__dict__:
|
||||||
del self._request_director
|
self._request_director.close()
|
||||||
|
del self._request_director
|
||||||
|
|
||||||
def trouble(self, message=None, tb=None, is_error=True):
|
def trouble(self, message=None, tb=None, is_error=True):
|
||||||
"""Determine action to take when a download problem appears.
|
"""Determine action to take when a download problem appears.
|
||||||
|
@ -68,7 +68,7 @@ def __init__(self, logger, verbose=False):
|
|||||||
def close(self):
|
def close(self):
|
||||||
for handler in self.handlers.values():
|
for handler in self.handlers.values():
|
||||||
handler.close()
|
handler.close()
|
||||||
self.handlers = {}
|
self.handlers.clear()
|
||||||
|
|
||||||
def add_handler(self, handler: RequestHandler):
|
def add_handler(self, handler: RequestHandler):
|
||||||
"""Add a handler. If a handler of the same RH_KEY exists, it will overwrite it"""
|
"""Add a handler. If a handler of the same RH_KEY exists, it will overwrite it"""
|
||||||
|
Loading…
Reference in New Issue
Block a user