mirror of
https://github.com/Free-TV/IPTV.git
synced 2026-11-12 08:26:59 +01:00
Merge pull request #1158 from KAMI911/fix-incompleteread-crash
Fix crash on IncompleteRead, which killed the first live run
This commit is contained in:
+5
-1
@@ -51,6 +51,7 @@ Usage:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import http.client
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
@@ -139,7 +140,10 @@ def probe(url, timeout):
|
|||||||
if error.code in REFUSING_CODES:
|
if error.code in REFUSING_CODES:
|
||||||
return REFUSED
|
return REFUSED
|
||||||
return UNREACHABLE
|
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 UNREACHABLE
|
||||||
return OK if looks_like_a_playlist(head) else GONE
|
return OK if looks_like_a_playlist(head) else GONE
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user