diff --git a/cloud/metering.py b/cloud/metering.py index eddb7bc..74ff6c0 100644 --- a/cloud/metering.py +++ b/cloud/metering.py @@ -76,13 +76,20 @@ _IP_SPECIFIC_HINTS = ( "http error 407", "http error 502", "http error 503", "proxyerror", "tunnel connection failed", "connection reset", "timed out", "timeout", "unable to download webpage", "unable to download api page", + # "Video unavailable" looks like a content error but is NOT reliable on + # the static pool: on 1-sep-2026 five videos "unavailable" on all three + # Decodo IPs downloaded fine through the residential proxy (proxy_usage + # rows 19:33-07:07). YouTube serves a fake unavailable to IPs it dislikes + # — the same symptom as the 19-aug server-IP ban. A truly dead link costs + # ~3 MB to re-check; a real video wrongly refused costs the job. + "video unavailable", "available in your country", "in your country", "geo-restricted", "geoblock", "blocked it in your country", "remote end closed", "connection refused", "network is unreachable", "name or service not known", "eof occurred", ) _CONTENT_HINTS = ( - "private video", "video unavailable", "has been removed", "members-only", + "private video", "has been removed", "members-only", "join this channel", "not available on this app", "is not a valid url", "unsupported url", "no video formats found", "premieres in", "will begin in", "this live event", "no duration in metadata", "requested format is not available", diff --git a/tests/test_proxy_ledger.py b/tests/test_proxy_ledger.py index 9260e7f..ea2d2be 100644 --- a/tests/test_proxy_ledger.py +++ b/tests/test_proxy_ledger.py @@ -18,6 +18,9 @@ from cloud import metering, proxy_ledger class TestStaticFailureWarrantsPaid: def test_ip_specific_failures_do(self): for err in ("ERROR: Sign in to confirm you're not a bot", + # fake on Decodo IPs: 5 videos "unavailable" on all three + # statics downloaded fine through the paid proxy (1-sep) + "ERROR: [youtube] BJW5gAgk4bg: Video unavailable", "HTTP Error 403: Forbidden", "HTTP Error 429: Too Many Requests", "ProxyError: Tunnel connection failed: 407", "Unable to download webpage: The read operation timed out", @@ -26,7 +29,7 @@ class TestStaticFailureWarrantsPaid: def test_content_failures_do_not(self): for err in ("ERROR: Private video. Sign in if you've been granted access", - "ERROR: Video unavailable", "This video has been removed by the uploader", + "This video has been removed by the uploader", "Join this channel to get access to members-only content", "no duration in metadata", "Premieres in 3 hours", "Unsupported URL: https://shopee.vn/product", "Sign in to confirm your age"):