mirror of
https://github.com/ultralytics/ultralytics.git
synced 2025-09-15 15:48:41 +08:00
Suppress YouTube Test ConnectionError (#13357)
This commit is contained in:
parent
cf081c4db7
commit
993ba7a20b
@ -140,7 +140,8 @@ def test_youtube():
|
||||
model = YOLO(MODEL)
|
||||
try:
|
||||
model.predict("https://youtu.be/G17sBkb38XQ", imgsz=96, save=True)
|
||||
except urllib.error.HTTPError as e: # handle 'urllib.error.HTTPError: HTTP Error 429: Too Many Requests'
|
||||
# Handle internet connection errors and 'urllib.error.HTTPError: HTTP Error 429: Too Many Requests'
|
||||
except (urllib.error.HTTPError, ConnectionError) as e:
|
||||
LOGGER.warning(f"WARNING: YouTube Test Error: {e}")
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user