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:
parent
db15a022ae
commit
37f94f2144
1 changed files with 3 additions and 2 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue