Giter VIP home page Giter VIP logo

openai_token's Introduction

食用方法

Usage: openai_token.py [OPTIONS]

Options:
  -p, --proxy TEXT     A http proxy str. (http://127.0.0.1:8080)
  -r, --refresh_token  Get refresh token.
  -a, --access_token   Get access token.
  -s, --sess_key       Get sess key.
  -f, --share-token    Get share key.
  --help               Show this message and exit.

栗子:

<script/execute> -p http://127.0.0.1:1082 -rsaf

会打印refresh token sess key access token share_token

preauth_cookie如何生成?

  1. 准备一台ios设备,想办法获取device token,device token是什么详见官方文档,具体的获取方法看这里

  2. 准备一个能访问openai的代理,发起以下请求即可得到preauth_cookie(device_id可自行修改),就cookie而言是1小时后过期

    rsp = requests.post(
        'https://ios.chat.openai.com/backend-api/preauth_devicecheck',
        json={
            "bundle_id": "com.openai.chat",
            "device_id": "12345678-042E-45C7-962F-AC725D0E7770",
            "device_token": "your device token",
            "request_flag": True
        },
        proxies={'all': 'http://127.0.0.1:8080'}
    )
    if rsp.status_code == 200:
        print(rsp.cookies['_preauth_devicecheck'])

    脚本中已添加相关逻辑,只需提前设置device_token即可

  3. 频繁使用其获取refresh token可能会封设备,原因可能是以下几个或之一:

    • 同一preauth_cookie多次用来获取refresh token
    • 同一device token生成的preauth_cookie用于大量用户账号登录

openai_token's People

Contributors

qy527145 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.