Private
Public Access
Minamp 1.3
- Fix NoSuchMethodError on Android 2.x: Dalvik before 4.0 can't link Object methods (toString/equals/...) called through an interface. Patch the bundled Bouncy Castle (tools/patch_bc_dalvik.py) and our own CertVerifier, and make build.sh fail if tools/scan_dalvik.py finds any such call - Treat a manually entered private address (10.x, 172.16-31.x, 192.168.x, .local) as home, so LAN servers that allow access without sign-in work - Send Plex client headers on media requests (files and transcodes) - Explain a 503 on a file as the server being unable to open it (drive or folder not available) - Connection log: home/away, token presence, Plex's file check and a direct file request in the streaming test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a4b875ef34
commit
58d21b6d68
14 files changed
+218
-13
No files matched your search
+11
-2
@@ -107,16 +107,25 @@ class H(BaseHTTPRequestHandler):
|
||||
if n:
|
||||
self.rfile.read(n)
|
||||
u = urlparse(self.path)
|
||||
q = parse_qs(u.query)
|
||||
q = parse_qs(u.query, keep_blank_values=True)
|
||||
p = u.path
|
||||
host = self.headers.get("Host", "")
|
||||
tok = self.headers.get("X-Plex-Token") or (q.get("X-Plex-Token") or [None])[0]
|
||||
empty_token_param = "X-Plex-Token" in q and q["X-Plex-Token"][0] == "" and not self.headers.get("X-Plex-Token")
|
||||
log.append((method, host, self.path, tok, self.headers.get("Range")))
|
||||
if host.startswith("plex.tv"):
|
||||
return self.tv(method, p, tok)
|
||||
if p == "/identity":
|
||||
return self.send_json({"MediaContainer": {"machineIdentifier": MACHINE, "version": "1.40"}})
|
||||
if tok != TOKEN:
|
||||
# Like a server with "allowed without auth" for its LAN: no token at all is fine from here,
|
||||
# but media requests carrying an *empty* token are refused (503 files / 400 transcoder).
|
||||
lan_no_auth = tok is None and self.server.server_address[1] == 32400
|
||||
if empty_token_param:
|
||||
if p.startswith("/library/parts/"):
|
||||
return self.send_json({"error": "Service Unavailable"}, 503)
|
||||
if "/transcode/" in p:
|
||||
return self.send_json({"error": "Bad Request"}, 400)
|
||||
if tok != TOKEN and not lan_no_auth:
|
||||
return self.send_json({"error": "unauthorized"}, 401)
|
||||
if p == "/library/sections":
|
||||
return self.send_json({"MediaContainer": {"Directory": [
|
||||
|
||||
Reference in new issue
Block a user