Giter Site home page Giter Site logo

watermellye / vercel-captcha-helper Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 14.0 19 KB

借助 Vercel 部署 Geetest 过码验证,供公主连结B服玩家手动过码使用。

Home Page: https://vercel-captcha-helper-snowy.vercel.app

TypeScript 5.31% HTML 94.69%

vercel-captcha-helper's Introduction

借助 Vercel 部署 Geetest 过码验证,供公主连结B服玩家手动过码使用。

部署方式

  1. Fork本项目到你的仓库
  2. 注册并登录Vercel
  3. 点击此处以在Vercel中Import你Fork后的项目。项目此时很可能未出现在列表中,请点击Adjust GitHub App Permissions进行设置,授权Vercel访问你Fork后的项目。设置成功后,点击Import
  4. 在新页面中,不需要调整任何设置,直接点击Deploy。稍等片刻,Vercel部署完毕后会跳转页面。点击Continue to Dashboard进入项目面板。
  5. 点击导航栏中Storage,点击最下方的Browse Database Integrations,在新页面中找到Upstash - Serverless Redis and Kafka并点击。
  6. 在新页面中点击Add Integration,在悬浮窗中选择(步骤1中注册的)Vercel账户,点击Continue后,选择Specific Projects,选择(步骤3中)部署好的项目,点击Continue,点击Add Integration
  7. 在新页面中出现一个表格。点击下方的Upstash框中的Redis栏,点击Create new database...
  8. 在新页面中出现一个表格,Name栏填入任意名字,Type选择Global,勾选TLS (SSL) Enabled,点击Create Database
  9. 回到步骤6中的表格,在Project栏中选择(步骤3中)部署好的项目,在Redis栏中选择(步骤7中)创建好的数据库,点击Save
  10. 在步骤8完成后,Vercel会将你重定向至你的Dashboard。点击导航栏中的Overview,进入(步骤3中)部署好的项目。
  11. 在项目面板中,点击导航栏中的Settings。在左侧菜单栏中点击Integrations后,应看到Upstash;点击Environment Variables后,应看到由Upstash为你注册的三条记录。
  12. 在项目面板中,点击导航栏中的Deployments,找到下方记录中最右侧的设置(图标尾三圆点),点击Redeploy,在悬浮窗中再次点击Redeploy

验证是否部署成功

(临时说明)

可以参考此文件底部被注释掉的TestEllyeManual()测试函数。

将print()中的域名改为你的vercel项目域名,触发StartCaptcha()函数后,访问第一个print中的url。过码完毕后,访问第二或第三个url。若出现了一个dict样式的结果,说明部署成功。

请注意,如果你(或你的服务器)在境内,vercel提供的域名(很可能)无法访问。如有需要,请参考下方说明绑定您自己的(境内可访问的)域名。

绑定域名(可选)

Vercel提供的默认访问Url需科学上网访问。若需能让境内用户直连访问,请按照以下步骤绑定你的域名。

  1. 在项目面板中,点击导航栏中的Settings,在左侧菜单栏中点击Domains,在右侧输入你准备好的(二级)域名,点击Add
  2. 此时,Vercel会提示配置失败,并告知您需如何操作。以CNAME方式为例,您需登录您的域名提供商的解析面板,添加一条CNAME记录并保存使其生效。回到Vercel的配置页面后,即可看到配置成功。

提供的API说明

  • 展示一张待过码图片:/?captcha_type=1&challenge={challenge}&gt={gt}&userid={userid}&gs=1
    • 需传入的challenge, gt, userid字段的生成方式可参考此文件中的StartCaptcha()函数
  • 用户过码完毕后,获取过码结果:/api/block?userid={userid}//api/get?userid={userid}/
    • userid为上述生成的字段
    • /block方式会阻塞请求直到用户过码完毕获得过码结果。阻塞时长最长30秒,超时返回504状态码。
    • /get方式会直接响应,若有过码结果则返回,若尚无结果则返回204状态码。
    • 使用/block/getAPI时,过码结果均只会返回一次,随后删除。再次访问会返回204状态码。
    • 项目集成方式可参考此文件中的EllyeManualCaptchaVerifier()EllyeManualCaptchaResultListening()函数

vercel-captcha-helper's People

Contributors

watermellye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.