wechat-chatgpt icon indicating copy to clipboard operation
wechat-chatgpt copied to clipboard

Cloudflare cookie support

Open yangchuansheng opened this issue 2 years ago • 9 comments

yangchuansheng avatar Dec 12 '22 03:12 yangchuansheng

_ No description provided. _

是不是还要升级 chatgpt 的一栏, 不然会报类型错误.

另外

_ No description provided. _

大佬您好, 在本地运行了, 但是我发现OpenAI一直会返回403 Forbidden, 即使我更换了IP也一样. 随后就发现F12里的token也变了, 这是不是说明OpenAI可以识别到了

RealTong avatar Dec 12 '22 05:12 RealTong

_ No description provided. _

need update revchatgpt version

sosmygirl avatar Dec 12 '22 05:12 sosmygirl

/app/node_modules/ts-node/src/index.ts:859 return new TSError(diagnosticText, diagnosticCodes, diagnostics); ^ TSError: ⨯ Unable to compile TypeScript: src/chatgpt.ts(108,13): error TS2345: Argument of type '{ sessionToken: string; clearanceToken: string; userAgent: string; }' is not assignable to parameter of type '{ sessionToken: string; markdown?: boolean | undefined; apiBaseUrl?: string | undefined; backendApiBaseUrl?: string | undefined; userAgent?: string | undefined; accessTokenTTL?: number | undefined; }'. Object literal may only specify known properties, and 'clearanceToken' does not exist in type '{ sessionToken: string; markdown?: boolean | undefined; apiBaseUrl?: string | undefined; backendApiBaseUrl?: string | undefined; userAgent?: string | undefined; accessTokenTTL?: number | undefined; }'. src/chatgpt.ts(165,11): error TS2345: Argument of type '{ sessionToken: string; clearanceToken: string; userAgent: string; }' is not assignable to parameter of type '{ sessionToken: string; markdown?: boolean | undefined; apiBaseUrl?: string | undefined; backendApiBaseUrl?: string | undefined; userAgent?: string | undefined; accessTokenTTL?: number | undefined; }'. Object literal may only specify known properties, and 'clearanceToken' does not exist in type '{ sessionToken: string; markdown?: boolean | undefined; apiBaseUrl?: string | undefined; backendApiBaseUrl?: string | undefined; userAgent?: string | undefined; accessTokenTTL?: number | undefined; }'.

at createTSError (/app/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/app/node_modules/ts-node/src/index.ts:863:19)
at getOutput (/app/node_modules/ts-node/src/index.ts:1077:36)
at Object.compile (/app/node_modules/ts-node/src/index.ts:1433:41)
at transformSource (/app/node_modules/ts-node/src/esm.ts:400:37)
at /app/node_modules/ts-node/src/esm.ts:278:53
at async addShortCircuitFlag (/app/node_modules/ts-node/src/esm.ts:409:15)
at async nextLoad (node:internal/modules/esm/loader:163:22)
at async ESMLoader.load (node:internal/modules/esm/loader:601:20)
at async ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:11) {

diagnosticCodes: [ 2345, 2345 ] } [nodemon] app crashed - waiting for file changes before starting...

vegaviazhang avatar Dec 12 '22 05:12 vegaviazhang

_ No description provided. _

need update revchatgpt version

/app/node_modules/ts-node/src/index.ts:859 return new TSError(diagnosticText, diagnosticCodes, diagnostics); ^ TSError: ⨯ Unable to compile TypeScript: src/chatgpt.ts(108,13): error TS2345: Argument of type '{ sessionToken: string; clearanceToken: string; userAgent: string; }' is not assignable to parameter of type '{ sessionToken: string; markdown?: boolean | undefined; apiBaseUrl?: string | undefined; backendApiBaseUrl?: string | undefined; userAgent?: string | undefined; accessTokenTTL?: number | undefined; }'. Object literal may only specify known properties, and 'clearanceToken' does not exist in type '{ sessionToken: string; markdown?: boolean | undefined; apiBaseUrl?: string | undefined; backendApiBaseUrl?: string | undefined; userAgent?: string | undefined; accessTokenTTL?: number | undefined; }'. src/chatgpt.ts(165,11): error TS2345: Argument of type '{ sessionToken: string; clearanceToken: string; userAgent: string; }' is not assignable to parameter of type '{ sessionToken: string; markdown?: boolean | undefined; apiBaseUrl?: string | undefined; backendApiBaseUrl?: string | undefined; userAgent?: string | undefined; accessTokenTTL?: number | undefined; }'. Object literal may only specify known properties, and 'clearanceToken' does not exist in type '{ sessionToken: string; markdown?: boolean | undefined; apiBaseUrl?: string | undefined; backendApiBaseUrl?: string | undefined; userAgent?: string | undefined; accessTokenTTL?: number | undefined; }'.

at createTSError (/app/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/app/node_modules/ts-node/src/index.ts:863:19)
at getOutput (/app/node_modules/ts-node/src/index.ts:1077:36)
at Object.compile (/app/node_modules/ts-node/src/index.ts:1433:41)
at transformSource (/app/node_modules/ts-node/src/esm.ts:400:37)
at /app/node_modules/ts-node/src/esm.ts:278:53
at async addShortCircuitFlag (/app/node_modules/ts-node/src/esm.ts:409:15)
at async nextLoad (node:internal/modules/esm/loader:163:22)
at async ESMLoader.load (node:internal/modules/esm/loader:601:20)
at async ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:11) {

diagnosticCodes: [ 2345, 2345 ] } [nodemon] app crashed - waiting for file changes before starting...

这个问题升级chatgpt 到2.1.1可解决

RealTong avatar Dec 12 '22 06:12 RealTong

_ No description provided. _

need update revchatgpt version

/app/node_modules/ts-node/src/index.ts:859 return new TSError(diagnosticText, diagnosticCodes, diagnostics); ^ TSError: ⨯ Unable to compile TypeScript: src/chatgpt.ts(108,13): error TS2345: Argument of type '{ sessionToken: string; clearanceToken: string; userAgent: string; }' is not assignable to parameter of type '{ sessionToken: string; markdown?: boolean | undefined; apiBaseUrl?: string | undefined; backendApiBaseUrl?: string | undefined; userAgent?: string | undefined; accessTokenTTL?: number | undefined; }'. Object literal may only specify known properties, and 'clearanceToken' does not exist in type '{ sessionToken: string; markdown?: boolean | undefined; apiBaseUrl?: string | undefined; backendApiBaseUrl?: string | undefined; userAgent?: string | undefined; accessTokenTTL?: number | undefined; }'. src/chatgpt.ts(165,11): error TS2345: Argument of type '{ sessionToken: string; clearanceToken: string; userAgent: string; }' is not assignable to parameter of type '{ sessionToken: string; markdown?: boolean | undefined; apiBaseUrl?: string | undefined; backendApiBaseUrl?: string | undefined; userAgent?: string | undefined; accessTokenTTL?: number | undefined; }'. Object literal may only specify known properties, and 'clearanceToken' does not exist in type '{ sessionToken: string; markdown?: boolean | undefined; apiBaseUrl?: string | undefined; backendApiBaseUrl?: string | undefined; userAgent?: string | undefined; accessTokenTTL?: number | undefined; }'.

at createTSError (/app/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/app/node_modules/ts-node/src/index.ts:863:19)
at getOutput (/app/node_modules/ts-node/src/index.ts:1077:36)
at Object.compile (/app/node_modules/ts-node/src/index.ts:1433:41)
at transformSource (/app/node_modules/ts-node/src/esm.ts:400:37)
at /app/node_modules/ts-node/src/esm.ts:278:53
at async addShortCircuitFlag (/app/node_modules/ts-node/src/esm.ts:409:15)
at async nextLoad (node:internal/modules/esm/loader:163:22)
at async ESMLoader.load (node:internal/modules/esm/loader:601:20)
at async ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:11) {

diagnosticCodes: [ 2345, 2345 ] } [nodemon] app crashed - waiting for file changes before starting...

这个问题升级chatgpt 到2.1.1可解决

老哥,你是用的docker启动的吗,这个chatgpt 2.1.1版本是啥,你用的pip install来安装的吗,具体怎么操作的,详细说下呗,感谢感谢。

vegaviazhang avatar Dec 12 '22 06:12 vegaviazhang

https://github.com/fuergaosi233/wechat-chatgpt/pull/313 Update

fuergaosi233 avatar Dec 12 '22 06:12 fuergaosi233

升级chatgpt到2.1.1,扫码登录后提示: uncaughtException AssertionError [ERR_ASSERTION]: 1 == 0 at Object.equal (/app/node_modules/wechat4u/src/util/global.js:53:14) at /app/node_modules/wechat4u/src/core.js:195:16 at processTicksAndRejections (node:internal/process/task_queues:96:5) { code: 2, details: 'AssertionError [ERR_ASSERTION]: 1 == 0\n' + ' at Object.equal (/app/node_modules/wechat4u/src/util/global.js:53:14)\n' + ' at /app/node_modules/wechat4u/src/core.js:195:16\n' + ' at processTicksAndRejections (node:internal/process/task_queues:96:5)'

greevsky avatar Dec 12 '22 07:12 greevsky

这只是临时的方案,2小时后token依旧会过期.仍需手动续期

https://github.com/acheong08/ChatGPT/wiki/Setup#session-token-authentication

Use this only if all else fails. Refreshing the session does not work here. You have to refresh manually.

baymax55 avatar Dec 12 '22 07:12 baymax55

这只是临时的方案,2小时后token依旧会过期.仍需手动续期

https://github.com/acheong08/ChatGPT/wiki/Setup#session-token-authentication

Use this only if all else fails. Refreshing the session does not work here. You have to refresh manually.

那还有啥优雅的解决方案吗

Lukangkang123 avatar Dec 12 '22 08:12 Lukangkang123

Now we use browser API.

fuergaosi233 avatar Dec 20 '22 14:12 fuergaosi233