{"record":{"id":"553a38cfe976627b","repo":"jackwener/OpenCLI","slug":"not-logged-into-weibo-please-login-at-weibo-com-i","errorCode":null,"errorMessage":"Not logged into Weibo. Please login at weibo.com in your Chrome browser.","messagePattern":"Not logged into Weibo\\. Please login at weibo\\.com in your Chrome browser\\.","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/weibo/publish.js","lineNumber":110,"sourceCode":"        },\n    ],\n    columns: ['status', 'message', 'text'],\n    func: async (page, kwargs) => {\n        if (!page) throw new CommandExecutionError('Browser session required for weibo publish');\n\n        const text = validateText(kwargs.text);\n        const absPaths = validateImagePaths(kwargs.images);\n\n        // Step 1: Navigate to weibo.com and wait for feed to load\n        await page.goto('https://weibo.com', { waitUntil: 'load', settleMs: 2000 });\n        await page.wait({ time: 2 });\n\n        // Step 2: Check login\n        try {\n            await getSelfUid(page);\n        } catch (err) {\n            if (err instanceof AuthRequiredError) throw err;\n            throw new CommandExecutionError('Not logged into Weibo. Please login at weibo.com in your Chrome browser.');\n        }\n\n        // Step 3: Click \"发微博\" button to open inline compose editor\n        const clickResult = await page.evaluate(`\n            () => {\n                const visible = el => !!el && el.offsetParent !== null && !el.disabled;\n                const buttons = document.querySelectorAll('button[title=\"发微博\"], button[title=\"写微博\"]');\n                for (const btn of buttons) {\n                    if (visible(btn)) {\n                        btn.click();\n                        return { ok: true };\n                    }\n                }\n                return { ok: false, message: 'Could not find 发微博 button' };\n            }\n        `);\n        if (!clickResult?.ok) {\n            throw new CommandExecutionError(clickResult?.message ?? 'Could not open compose editor.');","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/weibo/publish.js#L92-L128","documentation":"After loading weibo.com, the CLI calls getSelfUid(page) to verify login. If that fails with anything other than AuthRequiredError, it assumes the session is logged out and throws this CommandExecutionError directing you to log in at weibo.com in the controlled Chrome browser.","triggerScenarios":"Running publish while the Chrome profile has no Weibo session; cookies expired or cleared; weibo.com returning an unexpected page (captcha, redirect) that makes getSelfUid fail.","commonSituations":"Long-lived automation profiles whose Weibo cookies expired; incognito/fresh profiles; corporate proxies or regions triggering login walls/captchas.","solutions":["Open weibo.com in the controlled Chrome browser and log in manually, then re-run","Persist cookies in the Chrome profile used by the session","Re-run after clearing captcha/login-wall; if it persists, check whether Weibo changed its identity API"],"exampleFix":"// before\nweibo publish --text \"hi\"   # logged-out profile\n// after\n# 1) open weibo.com in the managed Chrome, log in\n# 2) then:\nweibo publish --text \"hi\"","handlingStrategy":"try-catch","validationCode":"// pre-flight: verify login by fetching identity as the CLI does\ntry { await getSelfUid(page); } catch { throw new Error('log in at weibo.com first'); }","typeGuard":null,"tryCatchPattern":"try {\n  await cli.run(['weibo', 'publish', '--text', text]);\n} catch (err) {\n  if (/Not logged into Weibo/.test(err.message)) {\n    console.error('Open weibo.com in the managed Chrome and log in, then retry');\n  } else throw err;\n}","preventionTips":["Log in once in the persistent Chrome profile","Re-check login periodically in long-running automation","Clear captchas/login walls before publishing"],"tags":["authentication","weibo","login"],"backgroundTag":"not-logged-in","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}