Suppress YouTube Test ConnectionError (#13357)
This commit is contained in:
parent
cf081c4db7
commit
993ba7a20b
1 changed files with 2 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue