{"id":20578765,"url":"https://github.com/cclient/sina_multi_account_login","last_synced_at":"2025-07-04T05:09:07.639Z","repository":{"id":93977641,"uuid":"85310494","full_name":"cclient/sina_multi_account_login","owner":"cclient","description":"新浪账号批量刷新工具,phantomjs不支持官方npm包(需重新编译),因此以server/client模式实现,web模拟操作外的逻辑都在client中,新版以electron实现,简单清晰很多,这是过时的phantomjs版","archived":false,"fork":false,"pushed_at":"2017-09-06T13:32:39.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T11:43:48.788Z","etag":null,"topics":["clawler","phantomjs","sina","sina-login","spider"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cclient.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-17T12:42:17.000Z","updated_at":"2019-03-15T03:07:39.000Z","dependencies_parsed_at":"2023-08-28T09:23:41.215Z","dependency_job_id":null,"html_url":"https://github.com/cclient/sina_multi_account_login","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cclient/sina_multi_account_login","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cclient%2Fsina_multi_account_login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cclient%2Fsina_multi_account_login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cclient%2Fsina_multi_account_login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cclient%2Fsina_multi_account_login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cclient","download_url":"https://codeload.github.com/cclient/sina_multi_account_login/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cclient%2Fsina_multi_account_login/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263450010,"owners_count":23468154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clawler","phantomjs","sina","sina-login","spider"],"created_at":"2024-11-16T06:14:30.222Z","updated_at":"2025-07-04T05:09:07.595Z","avatar_url":"https://github.com/cclient.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Sina Refresh Token\n## Stack\n* [phantomjs](http://phantomjs.org/)\n* [nodejs](https://nodejs.org/en/)\n* [typescript](http://www.typescriptlang.org/)\n* [gm.js](https://www.npmjs.com/package/gm)\n* [jquery](http://jquery.com/)\n\n## Quick Start\n\n#### start server\n1. cd ./server\n2. npm install \n3. npm run server\n\n#### start client\n* 单项刷新(server目录下 cd server/)\n * npm run test [email] [passwd] \n\n* 批量刷新(client目录下 cd client/)\n 1. 修改client/src/cron/sinaRefreshToken.ts accountObj\n 2. 修改client/src/config/index.ts\n 3. npm install\n 4. gulp build\n 5. 执行\n     * 执行一次 node lib/cron/sinaRefreshToken.js\n     * 作为后台定时服务 node lib/cron/index.js\n  \n\n### 补充说明\n账号刷新token受限于io，以串行方式运行，如需并行，需要修改server的cookies清除策略，和client。\n\n验证码识别服务采用阿里的[here](https://market.aliyun.com/products/57124001/cmapi011148.html?spm=5176.8216963.522267.4.LFGKZ1#sku=yuncode514800004).\n同服务只需修改client/src/config内appcode,若要变更,则需重写getCodeImgB64fromImgB64方法\n\n### utils\n\n* tool/html/drag/ImgGetLayout.html 列出选中区域坐标(列出验证码部分坐标)\n* tool/gmcropimg.js 截图测试\n* tool/showimage.html 输入base64查看img\n\n### server\n\n* server/server.js 新浪小号刷新token server\n* server/client.js 新浪小号刷新token client 单项账号\n\n### client\n\n* client/src/cron/sinaRefreshToken.ts 批量刷新(在客户端作100%保证，每执行一次检查所有账号状态，所有成功都则退出，否则一直执行)\n* client/src/cron/index.ts 定时后台(如果上次的任务还未运行完，则下次定时不会新启任务，以任务名标识)\n\n### 遇到的问题\n\n1. 计划通过canvas 拿验证码图片转为base64，但toDataURL方法无法跨域，失败\n2. 先拿html页，再单独打开验证码，用新页的验证码验证，chrome里成功，但phantomjs设cookies依然失败，失败，应是不同page的跨域cookies有问题。\n3. 拿html,整页截图，按坐标，截取出验证验部分，成功。\n\n现项目采用方案3。\n\n### 若使用或测试有疑问\n\n可以联系邮箱\ncclient@hotmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcclient%2Fsina_multi_account_login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcclient%2Fsina_multi_account_login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcclient%2Fsina_multi_account_login/lists"}