1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-03-09 12:50:23 -05:00

Use network_exceptions

This commit is contained in:
sepro 2025-02-17 17:33:26 +01:00
parent db15a022ae
commit 37f94f2144

View file

@ -5,6 +5,7 @@
from .common import FileDownloader from .common import FileDownloader
from . import HlsFD from . import HlsFD
from ..networking import Request from ..networking import Request
from ..networking.exceptions import network_exceptions
class BunnyCdnFD(FileDownloader): class BunnyCdnFD(FileDownloader):
@ -42,8 +43,8 @@ def send_ping():
try: try:
self.ydl.urlopen(request).read() self.ydl.urlopen(request).read()
except Exception: except network_exceptions as e:
self.to_screen(f'[{self.FD_NAME}] Ping failed') self.to_screen(f'[{self.FD_NAME}] Ping failed: {e}')
with ping_lock: with ping_lock:
if not download_complete: if not download_complete: