Xbox Cloud Gaming app for PS5 Homebrew
C
chore(triage): add DNS/NanoDNS, Xbox profile, F2P claim rules and PT/ES language support
Rafael Abud Ferreiraf6340f600fdb
diff --git a/.github/triage/rules.json b/.github/triage/rules.jsonindex 3d9d974..2f6eb29 100644--- a/.github/triage/rules.json+++ b/.github/triage/rules.json@@ -1,6 +1,51 @@{- "_comment": "Known problems, matched against the issue's title and text (case-insensitive regular expressions). label: added to the issue. fixed_in: the release that fixes it (the reply asks to update when the reporter's release is older). reply: one paragraph for the triage comment. Keep replies short and in English. where: the parts searched (\"title\", \"what\", \"log\"; all when absent) - words common in logs only in title/what.",+ "_comment": "Known problems, matched against the issue's title and text (case-insensitive regular expressions). label: added to the issue. fixed_in: the release that fixes it (the reply asks to update when the reporter's release is older). reply / reply_pt / reply_es: one paragraph for the triage comment in the reporter's language. where: the parts searched (\"title\", \"what\", \"log\"; all when absent) - words common in logs only in title/what.","rules": [+ {+ "id": "dns-blocked",+ "label": "area: network",+ "patterns": [+ "0x8041013d",+ "0x804101e1",+ "dns lookup failed",+ "sinkhole ip",+ "connect failed to (?:login\\.live\\.com|[^\\s]+\\.xboxlive\\.com|[^\\s]+\\.microsoft\\.com)[^\\n]*errno 61"+ ],+ "fixed_in": "1.3.2",+ "reply": "**DNS blocked or sinkholed** (`0x8041013d` / `0x804101e1` / `errno 61`): the DNS configured on your PS5 or router is blocking Microsoft/Xbox domains (`login.live.com`, `*.xboxlive.com`). To keep Sony updates blocked while allowing Xbox Cloud Gaming, run the **NanoDNS** payload on your PS5 and set the PS5 network **Primary DNS** to your PS5's local IP address and **Secondary DNS** to `0.0.0.0` (or use `1.1.1.1` / `8.8.8.8` if you don't use a DNS blocker).",+ "reply_pt": "**DNS bloqueado ou redirecionado (sinkhole)** (`0x8041013d` / `0x804101e1` / `errno 61`): o DNS configurado no seu PS5 ou roteador está bloqueando os domínios da Microsoft/Xbox (`login.live.com`, `*.xboxlive.com`). Para manter os servidores da Sony bloqueados sem bloquear o Xbox Cloud Gaming, execute o payload **NanoDNS** no próprio PS5 e configure na rede do console o **DNS Primário** com o IP local do seu PS5 e o **DNS Secundário** como `0.0.0.0` (ou use `1.1.1.1` / `8.8.8.8` caso não utilize bloqueio de DNS).",+ "reply_es": "**DNS bloqueado o redirigido (sinkhole)** (`0x8041013d` / `0x804101e1` / `errno 61`): el DNS configurado en tu PS5 o router está bloqueando los dominios de Microsoft/Xbox (`login.live.com`, `*.xboxlive.com`). Para mantener bloqueados los servidores de Sony sin bloquear Xbox Cloud Gaming, ejecuta el payload **NanoDNS** en tu PS5 y configura en la red de la consola el **DNS Primario** con la IP local de tu PS5 y el **DNS Secundario** como `0.0.0.0` (o usa `1.1.1.1` / `8.8.8.8` si no usas bloqueador de DNS)."+ },+ {+ "id": "xbox-profile",+ "label": "area: auth",+ "patterns": [+ "2148916233",+ "8015dc09",+ "xsts authorization for http://gssv\\.xboxlive\\.com/ failed: http 401",+ "no xbox profile"+ ],+ "fixed_in": "1.3.1",+ "reply": "**No Xbox profile (Gamertag) on this Microsoft account** (`XErr 2148916233` / `HTTP 401` on XSTS): this Microsoft account has never signed into Xbox before. Open https://www.xbox.com in a browser, sign in once with the same account to create your free Xbox Gamertag, and then sign in again on the PS5.",+ "reply_pt": "**Conta Microsoft sem perfil Xbox / Gamertag** (`XErr 2148916233` / `HTTP 401` no XSTS): esta conta Microsoft ainda não possui um perfil Xbox criado. Acesse https://www.xbox.com pelo celular ou PC, faça login uma vez com a mesma conta para criar sua Gamertag gratuita e tente entrar novamente no PS5.",+ "reply_es": "**Cuenta Microsoft sin perfil de Xbox / Gamertag** (`XErr 2148916233` / `HTTP 401` en XSTS): esta cuenta de Microsoft aún no tiene un perfil de Xbox creado. Entra una vez en https://www.xbox.com desde el móvil o PC con la misma cuenta para crear tu Gamertag gratuito y vuelve a iniciar sesión en la PS5."+ },+ {+ "id": "claim-free",+ "label": "area: catalog",+ "patterns": [+ "failed to claim free game",+ "error al adquirir el juego gratuito",+ "erro ao resgatar",+ "purchasefd\\.mp\\.microsoft\\.com",+ "useralreadyownscontent",+ "9p22thr57fv7"+ ],+ "fixed_in": "1.3.2",+ "reply": "**Claiming a free-to-play game failed**: v1.3.2 fixes in-app claiming for titles like *Call of Duty®* (`9P22THR57FV7`), automatically refreshes the Microsoft Store token when needed, selects direct free offers, and treats `UserAlreadyOwnsContent` as already owned. Please update to **v1.3.2** or newer (or claim the game for free at https://www.xbox.com).",+ "reply_pt": "**Falha ao resgatar jogo gratuito**: a versão v1.3.2 corrige o resgate direto pelo app para títulos como *Call of Duty®* (`9P22THR57FV7`), renova automaticamente o token da Microsoft Store quando necessário, seleciona ofertas gratuitas diretas e reconhece `UserAlreadyOwnsContent` como já adquirido na conta. Atualize para a **v1.3.2** ou mais recente (ou resgate gratuitamente em https://www.xbox.com).",+ "reply_es": "**Error al adquirir un juego gratuito**: la versión v1.3.2 corrige la adquisición desde la app para títulos como *Call of Duty®* (`9P22THR57FV7`), renueva automáticamente el token de Microsoft Store cuando es necesario, selecciona ofertas gratuitas directas y reconoce `UserAlreadyOwnsContent` como ya adquirido en la cuenta. Actualiza a **v1.3.2** o superior (o reclámalo gratis en https://www.xbox.com)."+ },{"id": "ca-unreadable","label": "area: certificates",@@ -10,16 +55,22 @@"secure connections could not be set up"],"fixed_in": "0.9.6",- "reply": "**Certificates file unreadable** (`assets/cacert.pem`, error -15872): since v0.9.6 the app uses a copy built into it, so updating fixes this. On an older version, copy the whole `PPSA99810` folder again (an incomplete copy is the usual cause)."+ "reply": "**Certificates file unreadable** (`assets/cacert.pem`, error -15872): since v0.9.6 the app uses a copy built into it, so updating fixes this. On an older version, copy the whole `PPSA99810` folder again (an incomplete copy is the usual cause).",+ "reply_pt": "**Arquivo de certificados ilegível** (`assets/cacert.pem`, erro -15872): desde a v0.9.6 o app possui uma cópia embutida no binário, então basta atualizar o aplicativo. Em versões antigas, copie toda a pasta `PPSA99810` novamente.",+ "reply_es": "**Archivo de certificados ilegible** (`assets/cacert.pem`, error -15872): desde la v0.9.6 la app incluye una copia integrada en el binario, por lo que actualizar lo soluciona. En versiones anteriores, vuelve a copiar toda la carpeta `PPSA99810`."},{"id": "tls-verify","label": "area: certificates","patterns": ["-9984",- "certificate verification failed"+ "certificate verification failed",+ "certificate refused"],- "reply": "**Certificate verification failed** (-9984): the most common cause is the console's **date and time** being wrong (Settings > System > Date and Time: set it correctly, or set it from the internet). A DNS server or proxy that intercepts Microsoft's sites can cause it too: try without it."+ "fixed_in": "1.3.2",+ "reply": "**Certificate verification failed** (-9984): if this happens when starting a game on a regional server (such as Central India `CIA.core.gssv-play-prod.xboxlive.com`), **v1.3.2** fixes out-of-order intermediate certificate chains automatically. Otherwise, the most common cause is the console's **date and time** being wrong (Settings > System > Date and Time: set it correctly, or set it from the internet), or a DNS/proxy intercepting Microsoft's sites.",+ "reply_pt": "**Falha na verificação de certificado TLS** (-9984): se o erro ocorrer ao iniciar um jogo em servidores regionais (como Índia Central `CIA.core.gssv-play-prod.xboxlive.com`), a **v1.3.2** corrige automaticamente cadeias de certificados intermediários fora de ordem. Caso contrário, a causa mais comum é a **data e hora** do console incorreta (Configurações > Sistema > Data e Hora) ou um servidor DNS/proxy interceptando os domínios da Microsoft.",+ "reply_es": "**Error de verificación de certificado TLS** (-9984): si ocurre al iniciar un juego en un servidor regional (como India Central `CIA.core.gssv-play-prod.xboxlive.com`), la **v1.3.2** corrige automáticamente las cadenas de certificados intermedios fuera de orden. De lo contrario, la causa más común es que la **fecha y hora** de la consola sea incorrecta (Ajustes > Sistema > Fecha y hora) o que un DNS/proxy esté interceptando los sitios de Microsoft."},{"id": "region",@@ -32,7 +83,9 @@"sign in as another country"],"fixed_in": "0.9.6",- "reply": "**xCloud refused the sign-in**: cloud gaming may not be offered in your country, or the account has no Game Pass plan with cloud gaming. Since v0.9.6 that error offers *Sign in as another country* (opt-in, at your own risk)."+ "reply": "**xCloud refused the sign-in**: cloud gaming may not be offered in your country, or the account has no Game Pass plan with cloud gaming. Since v0.9.6 that error offers *Sign in as another country* (opt-in, at your own risk).",+ "reply_pt": "**xCloud recusou o login**: o Cloud Gaming pode não estar disponível no país da sua conta ou a conta não possui assinatura Game Pass compatível. Desde a v0.9.6, essa tela oferece a opção de *Entrar como outro país*.",+ "reply_es": "**xCloud rechazó el inicio de sesión**: es posible que el juego en la nube no esté disponible en tu país o que la cuenta no tenga un plan de Game Pass compatible. Desde la v0.9.6 ese error ofrece la opción *Iniciar sesión como otro país*."},{"id": "xbox-wake",@@ -44,7 +97,9 @@"didn't wake","did not wake"],- "reply": "**Your Xbox didn't answer**: on the Xbox, Settings > General > Power options: choose *Sleep* (not *Shutdown*), and Settings > Devices & connections > Remote features: turn them on. If it was asleep for long, turn it on by hand once and try again."+ "reply": "**Your Xbox didn't answer**: on the Xbox, Settings > General > Power options: choose *Sleep* (not *Shutdown*), and Settings > Devices & connections > Remote features: turn them on. If it was asleep for long, turn it on by hand once and try again.",+ "reply_pt": "**Seu console Xbox não respondeu**: no Xbox, vá em Configurações > Geral > Opções de energia e escolha *Suspensão* (não *Desligar*), e ative os *Recursos remotos* em Configurações > Dispositivos e conexões. Se o console estiver desligado há muito tempo, ligue-o manualmente uma vez e tente novamente.",+ "reply_es": "**Tu consola Xbox no respondió**: en la Xbox, ve a Configuración > General > Opciones de energía y elige *Suspensión* (no *Apagar*), y activa las *Características remotas* en Configuración > Dispositivos y conexiones. Si estuvo suspendida mucho tiempo, enciéndela manualmente una vez e inténtalo de nuevo."},{"id": "no-entitlement",@@ -53,7 +108,9 @@"noentitlement","not entitled"],- "reply": "**Not on your account / plan**: xCloud says the account can't stream that game. It may need another Game Pass plan, or buying it."+ "reply": "**Not on your account / plan**: xCloud says the account can't stream that game. It may need another Game Pass plan, or buying it.",+ "reply_pt": "**Jogo não disponível na sua conta / plano**: o xCloud informou que sua conta não possui permissão para transmitir este jogo. Pode ser necessário adquirir o jogo ou um plano Game Pass compatível.",+ "reply_es": "**No disponible en tu cuenta / plan**: xCloud indica que tu cuenta no puede transmitir ese juego. Puede requerir otro plan de Game Pass o comprarlo."},{"id": "free-to-play",@@ -62,7 +119,10 @@"free[- ]to[- ]play","fortnite"],- "reply": "**Free-to-play games**: they appear in the *Free to play* row once they are on your Microsoft account (get them free on xbox.com or in the Xbox app first).",+ "fixed_in": "1.3.2",+ "reply": "**Free-to-play games**: they appear in the *Free to play* row and can be claimed for free directly from the game's page in the app (improved in v1.3.2) or on https://www.xbox.com.",+ "reply_pt": "**Jogos gratuitos (Free-to-play)**: aparecem na fileira *Faça streaming de jogos gratuitos* e podem ser adquiridos gratuitamente direto na tela do jogo dentro do app (aprimorado na v1.3.2) ou em https://www.xbox.com.",+ "reply_es": "**Juegos gratuitos (Free-to-play)**: aparecen en la fila de juegos gratuitos y se pueden reclamar gratis directamente desde la página del juego en la app (mejorado en v1.3.2) o en https://www.xbox.com.","where": ["title","what"@@ -81,9 +141,13 @@"vibration","rumble","bot[aã]o",- "controle"+ "controle",+ "mando",+ "bot[oó]n"],- "reply": "**Controller**: the DualSense's Create button is kept by the PS5 (screenshots) and can't be used by apps. Xbox *View* is a touchpad click, Xbox *Menu* is OPTIONS. Button remapping is on the roadmap.",+ "reply": "**Controller**: the DualSense's Create button is kept by the PS5 (screenshots) and can't be used by apps. By default, Xbox *View* is a touchpad click and Xbox *Menu* is OPTIONS; you can customize button and keyboard mappings in *Settings > Controller buttons* (or per game in the game's settings).",+ "reply_pt": "**Controle**: o botão Create do DualSense é reservado pelo sistema do PS5 (capturas de tela). Por padrão, o botão *View* (Select) do Xbox é o clique no touchpad e *Menu* é OPTIONS; você pode remapear todos os botões em *Configurações > Botões do controle* (ou individualmente nas configurações de cada jogo).",+ "reply_es": "**Mando**: el botón Create del DualSense está reservado por el sistema de PS5 (capturas de pantalla). Por defecto, el botón *View* (Select) de Xbox es el clic en el panel táctil y *Menu* es OPTIONS; puedes personalizar los botones en *Configuración > Botones del mando* (o por juego).","where": ["title","what"@@ -98,7 +162,9 @@"signal 11\\b","\\bstalled\\b"],- "reply": "**The app closed unexpectedly**: thanks for the report. The log lines above show what it was doing; if you can, tell us what you did just before."+ "reply": "**The app closed unexpectedly**: thanks for the report. The log lines above show what it was doing; if you can, tell us what you did just before.",+ "reply_pt": "**O aplicativo fechou inesperadamente**: obrigado pelo relato. As linhas de log acima mostram o que ele estava fazendo; se puder, conte-nos o que você estava fazendo imediatamente antes.",+ "reply_es": "**La aplicación se cerró inesperadamente**: gracias por el reporte. Las líneas de registro de arriba muestran lo que estaba haciendo; si puedes, cuéntanos qué hiciste justo antes."}]}diff --git a/.github/triage/test_triage.py b/.github/triage/test_triage.pyindex d6bc09e..2613b85 100644--- a/.github/triage/test_triage.py+++ b/.github/triage/test_triage.py@@ -22,12 +22,13 @@ LOG = "10:00:00 [I] === PSBox Cloud Gaming starting ===\n"class Triage(unittest.TestCase):- def run_triage(self, body, title="A problem", latest="0.9.6"):+ def run_triage(self, body, title="A problem", latest="1.3.2"):return triage.triage({"title": title, "body": body}, RULES, latest)def test_known_error_fixed_in_newer_release(self):labels, comment = self.run_triage(form("It doesn't start", "v0.9.5", "13.00",- LOG + "10:00:01 [E] TLS setup: certificates cacert.pem: (-15872)"))+ LOG + "10:00:01 [E] TLS setup: certificates cacert.pem: (-15872)"),+ latest="0.9.6")self.assertIn("area: certificates", labels)self.assertIn("outdated-version", labels)self.assertIn("fw: 13.00", labels)@@ -46,20 +47,20 @@ class Triage(unittest.TestCase):def test_controller_words_only_in_the_description(self):# "vibration" in the log alone isn't a controller problem.- labels, _ = self.run_triage(form("It froze", "0.9.6", "13.60", LOG + "10:00:02 [I] pad 0 vibration suppression"))+ labels, _ = self.run_triage(form("It froze", "1.3.2", "13.60", LOG + "10:00:02 [I] pad 0 vibration suppression"))self.assertNotIn("area: controller", labels)- labels, comment = self.run_triage(form("The select button does nothing", "0.9.6", "13.60", LOG))+ labels, comment = self.run_triage(form("The select button does nothing", "1.3.2", "13.60", LOG))self.assertIn("area: controller", labels)self.assertIn("touchpad click", comment)def test_no_false_crash_from_installed(self):- labels, _ = self.run_triage(form("app installed without issue", "0.9.6", "13.60", LOG))+ labels, _ = self.run_triage(form("app installed without issue", "1.3.2", "13.60", LOG))self.assertNotIn("crash", labels)- labels, _ = self.run_triage(form("Closed unexpectedly: signal 11 (SIGSEGV) while home", "0.9.6", "13.60", LOG))+ labels, _ = self.run_triage(form("Closed unexpectedly: signal 11 (SIGSEGV) while home", "1.3.2", "13.60", LOG))self.assertIn("crash", labels)def test_up_to_date_and_complete_says_nothing(self):- labels, comment = self.run_triage(form("Something odd", "v0.9.6", "13.60", LOG))+ labels, comment = self.run_triage(form("Something odd", "v1.3.2", "13.60", LOG))self.assertEqual(labels, ["fw: 13.60"])self.assertIsNone(comment)@@ -73,16 +74,62 @@ class Triage(unittest.TestCase):self.assertIsNone(comment)def test_region_and_wake(self):- labels, _ = self.run_triage(form("no login", "0.9.6", "", LOG + "10:00:03 [E] sign-in failed: xCloud login failed: HTTP 403"))+ labels, _ = self.run_triage(form("no login", "1.3.2", "", LOG + "10:00:03 [E] sign-in failed: xCloud login failed: HTTP 403"))self.assertIn("area: region", labels)- labels, comment = self.run_triage(form("my xbox", "0.9.6", "", LOG + "10:00:03 [I] State WaitingForServerToRegister"))+ labels, comment = self.run_triage(form("my xbox", "1.3.2", "", LOG + "10:00:03 [I] State WaitingForServerToRegister"))self.assertIn("area: remote play", labels)self.assertIn("Power options", comment)+ def test_dns_blocked_and_xbox_profile(self):+ labels, comment = self.run_triage(+ form("can't sign in", "1.3.0", "13.60",+ LOG + "10:00:03 [E] sign-in failed: device code request failed: DNS lookup failed for login.live.com: 0x8041013d")+ )+ self.assertIn("area: network", labels)+ self.assertIn("NanoDNS", comment)+ self.assertIn("please update to v1.3.2", comment)++ labels, comment = self.run_triage(+ form("sign in failed", "1.3.0", "13.60",+ LOG + "10:00:03 [E] sign-in failed: XSTS authorization for http://gssv.xboxlive.com/ failed: HTTP 401 (XErr 2148916233)")+ )+ self.assertIn("area: auth", labels)+ self.assertIn("Gamertag", comment)++ def test_multilingual_spanish_and_portuguese(self):+ labels, comment = self.run_triage(+ form("Error al adquirir el juego gratuito: 9P22THR57FV7", "1.3.0", "13.60", LOG),+ title="Error al adquirir el juego gratuito"+ )+ self.assertIn("area: catalog", labels)+ self.assertIn("Triaje automático", comment)+ self.assertIn("Error al adquirir un juego gratuito", comment)+ self.assertIn("actualiza a la v1.3.2", comment)++ labels, comment = self.run_triage(+ form("Não consigo resgatar jogo gratuito no controle", "1.3.0", "13.60",+ LOG + "10:00:01 [I] settings: language pt-BR, best, region auto\n10:00:05 [E] erro ao resgatar 9P22THR57FV7"),+ title="Erro ao resgatar jogo"+ )+ self.assertIn("area: catalog", labels)+ self.assertIn("Triagem automática", comment)+ self.assertIn("Falha ao resgatar jogo gratuito", comment)+ self.assertIn("atualize para a v1.3.2", comment)++ # Fallback to log language when user text has no prose+ labels, comment = self.run_triage(+ form("", "1.3.0", "13.60",+ LOG + "10:00:01 [I] settings: language pt-BR\n10:00:02 [E] DNS lookup failed: 0x8041013d"),+ title="0x8041013d"+ )+ self.assertIn("Triagem automática", comment)+ self.assertIn("DNS bloqueado", comment)+def test_rules_are_valid(self):import refor rule in RULES:self.assertTrue(rule["label"] and rule["reply"] and rule["patterns"], rule["id"])+ self.assertTrue(rule.get("reply_pt") and rule.get("reply_es"), rule["id"])for pattern in rule["patterns"]:re.compile(pattern)for where in rule.get("where", []):diff --git a/.github/triage/triage.py b/.github/triage/triage.pyindex 0f731ee..1a80958 100644--- a/.github/triage/triage.py+++ b/.github/triage/triage.py@@ -6,15 +6,16 @@Reads the bug form's fields (What happened?, App release, PS5 firmware,xcloud.log), matches rules.json's known problems, and then on the issue:adds labels (never removes one), and writes or updates ONE comment (marked-with MARKER) saying what is known, asking to update when the release is-older than the fix or the latest, and asking for what is missing.+with MARKER) in the reporter's language (English, Portuguese, or Spanish)+saying what is known, asking to update when the release is older than the+fix or the latest, and asking for what is missing.The issue's text is someone else's: it is only matched with regularexpressions here, never run or put in a command.GitHub Actions: triage.py (GITHUB_EVENT_PATH, GITHUB_TOKEN, GITHUB_REPOSITORY;TRIAGE_ISSUE=<number> for one already there)- Locally: triage.py --dry-run issue.json --latest 0.9.6+ Locally: triage.py --dry-run issue.json --latest 1.3.2(issue.json: {"title": ..., "body": ...}, e.g. from `gh issue view N --json title,body`)"""import json@@ -36,6 +37,87 @@ LABEL_COLOURS = {AREA_COLOUR = "1d76db"FIRMWARE_COLOUR = "ededed"+STRINGS = {+ "en": {+ "header": "Automatic triage (rules, not a person; the maintainer will read this too):",+ "update_rule": " You're on v{current}: please update to v{fixed} or newer.",+ "outdated_latest": (+ "- This was reported on v{current}; the latest is **v{latest}** "+ "(the app offers it after sign-in, or Settings > Updates). Does it still happen there?"+ ),+ "ask_release": "the **app release** (Settings > Updates shows it, e.g. v1.3.2)",+ "ask_log": (+ "the **xcloud.log** (`/data/psbox/xcloud.log` over FTP; before v0.9.7 in `/data/homebrew/PPSA99810/`, "+ "or use *Report a problem* (△ in Settings or on the error) to fill this form from the app)"+ ),+ "ask_join": " and ",+ "ask_line": "- To look into it, please add {asks}.",+ },+ "pt": {+ "header": "Triagem automática (regras automáticas; o mantenedor também lerá esta issue):",+ "update_rule": " Você está na v{current}: por favor, atualize para a v{fixed} ou mais recente.",+ "outdated_latest": (+ "- Este relato foi enviado na v{current}; a versão mais recente é a **v{latest}** "+ "(o app oferece a atualização após o login ou em Configurações > Atualizações). O problema ainda ocorre nela?"+ ),+ "ask_release": "a **versão do app** (mostrada em Configurações > Atualizações, ex.: v1.3.2)",+ "ask_log": (+ "o **xcloud.log** (`/data/psbox/xcloud.log` via FTP, ou use *Relatar um problema* "+ "(△ nas Configurações ou na tela de erro) para preencher este formulário pelo app)"+ ),+ "ask_join": " e ",+ "ask_line": "- Para investigarmos melhor, por favor adicione {asks}.",+ },+ "es": {+ "header": "Triaje automático (reglas automáticas; el mantenedor también leerá este reporte):",+ "update_rule": " Estás en la v{current}: por favor, actualiza a la v{fixed} o superior.",+ "outdated_latest": (+ "- Este reporte fue enviado en la v{current}; la versión más reciente es la **v{latest}** "+ "(la app ofrece actualizar tras iniciar sesión o en Configuración > Actualizaciones). ¿Sigue ocurriendo ahí?"+ ),+ "ask_release": "la **versión de la app** (se muestra en Configuración > Actualizaciones, ej.: v1.3.2)",+ "ask_log": (+ "el **xcloud.log** (`/data/psbox/xcloud.log` por FTP, o usa *Informar de un problema* "+ "(△ en Configuración o en la pantalla de error) para rellenar este formulario desde la app)"+ ),+ "ask_join": " y ",+ "ask_line": "- Para revisarlo, por favor añade {asks}.",+ },+}++PT_WORDS = re.compile(+ r"[ãõç]|\b(n[aã]o|consigo|jogo|jogos|resgatar|erro ao|iniciar sess[aã]o|posso|quando|"+ r"aparece|tela|ajuda|ol[aá]|obrigado|bot[aã]o|controle|carrega|logar|minha|meu|fazer)\b",+ re.I,+)+ES_WORDS = re.compile(+ r"[¿¡ñ]|\b(no me|juego|juegos|adquirir|error al|iniciar sesi[oó]n|puedo|consola|cuando|"+ r"sale|pantalla|ayuda|hola|gracias|bot[oó]n|mando|carga|guarda|hacer|est[aá]n)\b",+ re.I,+)+EN_WORDS = re.compile(+ r"\b(the|when|doesn't|does not|can't|cannot|failed|while|after|before|screen|button|"+ r"controller|game|sign-in|login|started| freezes|froze|crashed|issue|without)\b",+ re.I,+)+++def detect_lang(title, what, log):+ """Detects 'pt', 'es', or 'en' from the reporter's text or the log's language setting."""+ user_text = f"{title or ''}\n{what or ''}"+ pt_hits = len(PT_WORDS.findall(user_text))+ es_hits = len(ES_WORDS.findall(user_text))+ en_hits = len(EN_WORDS.findall(user_text))+ if pt_hits > es_hits and pt_hits >= en_hits and pt_hits > 0:+ return "pt"+ if es_hits > pt_hits and es_hits >= en_hits and es_hits > 0:+ return "es"+ if en_hits == 0:+ m = re.search(r"settings:\s+language\s+(pt|es|en)\b", log or "", re.I)+ if m:+ return m.group(1).lower()+ return "en"+def parse_form(body):"""The issue form's sections: '### Heading' -> text (without _No response_ or code fences)."""@@ -96,6 +178,9 @@ def triage(issue, rules, latest):release = version_tuple(field(fields, "app release"))firmware = firmware_of(field(fields, "ps5 firmware"))latest_t = version_tuple(latest) if latest else None+ lang = detect_lang(title, parts["what"], log)+ tr = STRINGS[lang]+ reply_key = f"reply_{lang}" if lang != "en" else "reply"labels, notes = [], []asked_update = False@@ -106,10 +191,10 @@ def triage(issue, rules, latest):continueif rule["label"] not in labels:labels.append(rule["label"])- note = rule["reply"]+ note = rule.get(reply_key) or rule["reply"]fixed = version_tuple(rule.get("fixed_in"))if fixed and release and release < fixed:- note += f" You're on v{'.'.join(map(str, release))}: please update to v{rule['fixed_in']} or newer."+ note += tr["update_rule"].format(current=".".join(map(str, release)), fixed=rule["fixed_in"])asked_update = Truenotes.append(note)@@ -117,10 +202,9 @@ def triage(issue, rules, latest):if not fields: # not the bug form (a question, an idea): nothing to ask forpasselif not release:- asks.append("the **app release** (Settings > Updates shows it, e.g. v0.9.6)")+ asks.append(tr["ask_release"])if fields and not looks_like_log(log):- asks.append("the **xcloud.log** (`/data/psbox/xcloud.log` over FTP; before v0.9.7 in `/data/homebrew/PPSA99810/`, or use *Report a problem* "- "(△ in Settings or on the error) to fill this form from the app)")+ asks.append(tr["ask_log"])if asks:labels.append("needs-info")outdated = release and latest_t and release < latest_t@@ -131,14 +215,13 @@ def triage(issue, rules, latest):if not notes and not asks and not outdated:return labels, None- out = [MARKER, "Automatic triage (rules, not a person; the maintainer will read this too):", ""]+ out = [MARKER, tr["header"], ""]for note in notes:out.append(f"- {note}")if outdated and not asked_update:- out.append(f"- This was reported on v{'.'.join(map(str, release))}; the latest is **v{latest}** "- "(the app offers it after sign-in, or Settings > Updates). Does it still happen there?")+ out.append(tr["outdated_latest"].format(current=".".join(map(str, release)), latest=latest))if asks:- out.append("- To look into it, please add " + " and ".join(asks) + ".")+ out.append(tr["ask_line"].format(asks=tr["ask_join"].join(asks)))return labels, "\n".join(out)