{"record":{"id":"ce5803679f32ea3c","repo":"Jackett/Jackett","slug":"errormessage-ce5803","errorCode":null,"errorMessage":"errorMessage","messagePattern":"errorMessage","errorType":"exception","errorClass":"ExceptionWithConfigData","httpStatus":null,"severity":"error","filePath":"src/Jackett.Common/Indexers/Definitions/LostFilm.cs","lineNumber":216,"sourceCode":"                { \"pass\", configData.Password.Value },\n                { \"rem\", \"1\" }\n            };\n\n            if (!string.IsNullOrWhiteSpace(configData.CaptchaText.Value))\n            {\n                data.Add(\"need_captcha\", \"1\");\n                data.Add(\"captcha\", configData.CaptchaText.Value);\n            }\n\n            var result = await RequestLoginAndFollowRedirect(ApiUrl, data, CookieHeader, true, SiteLink, ApiUrl, true);\n            await ConfigureIfOK(result.Cookies, result.ContentString != null && result.ContentString.Contains(\"\\\"success\\\":true\"), () =>\n            {\n                var errorMessage = result.ContentString;\n                if (errorMessage.Contains(\"\\\"error\\\":1\") || errorMessage.Contains(\"\\\"error\\\":2\") || errorMessage.Contains(\"\\\"error\\\":4\"))\n                    errorMessage = \"Captcha is incorrect\";\n                if (errorMessage.Contains(\"\\\"error\\\":3\"))\n                    errorMessage = \"E-mail or password is incorrect\";\n                throw new ExceptionWithConfigData(errorMessage, configData);\n            });\n\n            return IndexerConfigurationStatus.RequiresTesting;\n        }\n\n        private async Task<bool> Logout()\n        {\n            logger.Info(\"Performing logout\");\n\n            var data = new Dictionary<string, string>\n            {\n                { \"act\", \"users\" },\n                { \"type\", \"logout\" }\n            };\n\n            var response = await RequestWithCookiesAsync(ApiUrl, method: RequestType.POST, data: data);\n            logger.Debug(\"Logout result: \" + response.ContentString);\n","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/Jackett/Jackett/blob/adff1941476d8057a430cf55360356c1d23e971e/src/Jackett.Common/Indexers/Definitions/LostFilm.cs#L198-L234","documentation":"Thrown by LostFilm.ApplyConfiguration when the login API response does not contain '\"success\":true'. The code inspects the raw response string for specific error codes: error:1/2/4 are mapped to 'Captcha is incorrect', error:3 is mapped to 'E-mail or password is incorrect'. If none match, the raw response body is used as the error message. This is an ExceptionWithConfigData.","triggerScenarios":"POST to ApiUrl with credentials returns a JSON object without success=true — captcha is wrong or expired (error 1/2/4), e-mail or password is wrong (error 3), or an unrecognized error code/shape is returned.","commonSituations":"The captcha text was typed incorrectly or expired before submission; the password is wrong; the e-mail is wrong (note: error 136 catches non-email usernames first, but a valid-format wrong email reaches here); LostFilm changed its API error codes.","solutions":["If the message says 'Captcha is incorrect', re-enter a fresh captcha and re-test quickly.","If the message says 'E-mail or password is incorrect', verify and re-enter both fields.","If the message is raw JSON, read the error code to understand the specific API rejection.","Perform a manual login on LostFilm to confirm credentials and observe any captcha.","Re-test the configuration immediately after entering a fresh captcha (they expire)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Validate credentials and captcha before login\nif (string.IsNullOrWhiteSpace(configData.Username?.Value) || string.IsNullOrWhiteSpace(configData.Password?.Value))\n    throw new InvalidOperationException(\"LostFilm e-mail and password are required.\");\nif (!configData.Username.Value.Contains(\"@\"))\n    throw new InvalidOperationException(\"LostFilm username must be an e-mail address.\");","typeGuard":null,"tryCatchPattern":"try\n{\n    await indexer.ApplyConfiguration(configJson);\n}\ncatch (ExceptionWithConfigData ex)\n{\n    // ex.Message may be 'Captcha is incorrect', 'E-mail or password is incorrect', or raw JSON\n    logger.Error(\"LostFilm login error: {Message}\", ex.Message);\n    if (ex.Message.Contains(\"Captcha\"))\n    {\n        // Re-enter a fresh captcha and retry immediately\n    }\n    else if (ex.Message.Contains(\"password\"))\n    {\n        // Verify and re-enter credentials\n    }\n}","preventionTips":["Enter the captcha text immediately before submitting — it expires quickly.","Verify e-mail and password on LostFilm's website first.","Handle the specific error codes (1/2/4 = captcha, 3 = credentials) programmatically.","Re-test promptly after correcting captcha or credentials."],"tags":["login","authentication","captcha","lostfilm","config","api"],"backgroundTag":null,"analyzedSha":"adff1941476d8057a430cf55360356c1d23e971e","analyzedAt":"2026-08-13T15:06:32.872Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}