Merge pull request #1158 from KAMI911/fix-incompleteread-crash

Fix crash on IncompleteRead, which killed the first live run
pull/1159/head
KAMI 2026-09-04 12:06:01 +02:00 committed by GitHub
commit 90d124bff6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -51,6 +51,7 @@ Usage:
"""
import argparse
import http.client
import json
import os
import re
@ -139,7 +140,10 @@ def probe(url, timeout):
if error.code in REFUSING_CODES:
return REFUSED
return UNREACHABLE
except (urllib.error.URLError, OSError, ValueError):
except (urllib.error.URLError, OSError, ValueError, http.client.HTTPException):
# http.client.HTTPException covers a server that started a chunked
# response and then hung up mid-chunk (IncompleteRead) and similar
# low-level protocol violations - a broken connection, not a bad URL
return UNREACHABLE
return OK if looks_like_a_playlist(head) else GONE