Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
chatgpt.ai-pro.org
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
3
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
b674f2da
authored
2024-05-10 14:16:06 +0800
by
Leff Tubat
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update
1 parent
7c2be8ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
index.js
index.js
View file @
b674f2d
...
...
@@ -346,6 +346,7 @@ async function runOpensource(req, res) {
}
async
function
authenticate
(
params
)
{
console
.
log
(
"349"
,
params
)
let
data
=
await
fetch
(
`
${
hostapi
}
/e/authenticate/v2`
,
{
method
:
"POST"
,
headers
:
{
...
...
@@ -354,10 +355,12 @@ async function authenticate(params) {
body
:
JSON
.
stringify
(
params
),
referrer
:
"https://chatgpt.ai-pro.org"
});
console
.
log
(
"358"
,
data
);
return
await
data
.
json
();
}
async
function
getLimitedUsage
(
params
)
{
console
.
log
(
"363"
,
params
)
let
data
=
await
fetch
(
`
${
hostapi
}
/e/get-usage`
,
{
method
:
"POST"
,
headers
:
{
...
...
@@ -366,9 +369,11 @@ async function getLimitedUsage(params) {
body
:
JSON
.
stringify
(
params
),
referrer
:
"https://chatgpt.ai-pro.org"
});
console
.
log
(
"372"
,
data
);
return
await
data
.
json
();
}
async
function
getUsage
(
params
)
{
console
.
log
(
"376"
,
params
)
let
data
=
await
fetch
(
`
${
hostapi
}
/e/get-chat-usage`
,
{
method
:
"POST"
,
headers
:
{
...
...
@@ -377,9 +382,11 @@ async function getUsage(params) {
body
:
JSON
.
stringify
(
params
),
referrer
:
"https://chatgpt.ai-pro.org"
});
console
.
log
(
"373"
,
data
);
return
await
data
.
json
();
}
async
function
setUsage
(
params
)
{
console
.
log
(
"389"
,
params
)
fetch
(
`
${
hostapi
}
/e/set-usage`
,
{
method
:
"POST"
,
headers
:
{
...
...
@@ -390,6 +397,7 @@ async function setUsage(params) {
});
}
async
function
setChatUsage
(
params
)
{
console
.
log
(
"400"
,
params
)
fetch
(
`
${
hostapi
}
/e/set-chat-usage`
,
{
method
:
"POST"
,
headers
:
{
...
...
@@ -401,13 +409,14 @@ async function setChatUsage(params) {
}
async
function
validation
(
aiwp_app_id
,
req
,
res
)
{
const
aiwp_logged_in
=
req
.
cookies
[
user_secret_id
]
?
decodeURIComponent
(
req
.
cookies
[
user_secret_id
])
:
"
asdasd
"
;
const
aiwp_logged_in
=
req
.
cookies
[
user_secret_id
]
?
decodeURIComponent
(
req
.
cookies
[
user_secret_id
])
:
""
;
const
limit
=
req
.
cookies
[
"WcvYPABR"
]
?
parseInt
(
req
.
cookies
[
"WcvYPABR"
].
replace
(
/
\D
/g
,
''
))
:
-
1
;
let
IS_FREE_USER
=
false
;
let
TRIED_USAGE
=
0
;
if
(
aiwp_logged_in
)
{
let
auth
=
await
authenticate
({
"aiwp_logged_in"
:
aiwp_logged_in
,
"user_event_data"
:
{},
"user_event"
:
"endpoint"
});
console
.
log
(
auth
)
if
(
!
auth
.
success
)
{
IS_FREE_USER
=
true
;
if
(
auth
.
is_restrict
)
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment