Skip to content

Commit 7187d00

Browse files
committed
Updated apis[api].expectedOrigin.headers, abstracted majority ones to createHeaders()
1 parent 214c88c commit 7187d00

File tree

4 files changed

+37
-68
lines changed

4 files changed

+37
-68
lines changed

amazongpt/greasemonkey/amazongpt.user.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Adds the magic of AI to Amazon shopping
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2025.1.14.1
6+
// @version 2025.1.14.2
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png?v=0fddfc7
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon64.png?v=0fddfc7
@@ -403,10 +403,7 @@
403403
endpoint: 'https://am.aifree.site/api/generate',
404404
expectedOrigin: {
405405
url: 'https://am.aifree.site',
406-
headers: {
407-
'Accept': '*/*', 'Alt-Used': 'am.aifree.site', 'Content-Type': 'text/plain;charset=UTF-8',
408-
'Priority': 'u=4', 'Sec-Fetch-Site': 'same-origin'
409-
}
406+
headers: { 'Alt-Used': 'am.aifree.site', 'Content-Type': 'text/plain;charset=UTF-8', 'Priority': 'u=4' }
410407
},
411408
method: 'POST', streamable: true
412409
},
@@ -415,7 +412,8 @@
415412
expectedOrigin: {
416413
url: 'https://ai28.gptforlove.com',
417414
headers: {
418-
'Accept': 'application/json, text/plain, */*', 'Priority': 'u=0', 'Sec-Fetch-Site': 'same-site'
415+
'Accept': 'application/json, text/plain, */*',
416+
'Priority': 'u=0', 'Sec-Fetch-Site': 'same-site', 'TE': 'trailers'
419417
}
420418
},
421419
method: 'POST', streamable: true, accumulatesText: true,
@@ -424,9 +422,7 @@
424422
'MixerBox AI': {
425423
endpoint: 'https://chatai.mixerbox.com/api/chat/stream',
426424
expectedOrigin: {
427-
url: 'https://chatai.mixerbox.com',
428-
headers: { 'Accept': '*/*', 'Alt-Used': 'chatai.mixerbox.com', 'Sec-Fetch-Site': 'same-origin' }
429-
},
425+
url: 'https://chatai.mixerbox.com', headers: { 'Alt-Used': 'chatai.mixerbox.com', 'TE': 'trailers' }},
430426
method: 'POST', streamable: true, accumulatesText: false
431427
},
432428
'OpenAI': {
@@ -435,10 +431,7 @@
435431
completions: 'https://api.openai.com/v1/chat/completions',
436432
session: 'https://chatgpt.com/api/auth/session'
437433
},
438-
expectedOrigin: {
439-
url: 'https://chatgpt.com',
440-
headers: { 'Accept': '*/*', 'Priority': 'u=4', 'Sec-Fetch-Site': 'same-site' }
441-
},
434+
expectedOrigin: { url: 'https://chatgpt.com', headers: { 'Priority': 'u=4' }},
442435
method: 'POST', streamable: true
443436
}
444437
}
@@ -2513,12 +2506,11 @@
25132506
createHeaders(api) {
25142507
const ip = ipv4.generate({ verbose: false })
25152508
const headers = {
2516-
'Accept-Encoding': 'gzip, deflate, br, zstd',
2509+
'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, br, zstd',
25172510
'Connection': 'keep-alive', 'Content-Type': 'application/json', 'DNT': '1',
25182511
'Host': new URL(apis[api].endpoints?.completions || apis[api].endpoint).hostname,
2519-
'Origin': apis[api].expectedOrigin.url,
2520-
'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors',
2521-
'TE': 'trailers', 'X-Forwarded-For': ip, 'X-Real-IP': ip
2512+
'Origin': apis[api].expectedOrigin.url, 'Sec-Fetch-Site': 'same-origin',
2513+
'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors', 'X-Forwarded-For': ip, 'X-Real-IP': ip
25222514
}
25232515
headers.Referer = headers.Origin + '/'
25242516
if (api == 'OpenAI') headers.Authorization = 'Bearer ' + config.openAIkey

bravegpt/greasemonkey/bravegpt.user.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.1.14
151+
// @version 2025.1.14.1
152152
// @license MIT
153153
// @icon https://assets.bravegpt.com/images/icons/bravegpt/icon48.png?v=df624b0
154154
// @icon64 https://assets.bravegpt.com/images/icons/bravegpt/icon64.png?v=df624b0
@@ -577,10 +577,7 @@
577577
endpoint: 'https://am.aifree.site/api/generate',
578578
expectedOrigin: {
579579
url: 'https://am.aifree.site',
580-
headers: {
581-
'Accept': '*/*', 'Alt-Used': 'am.aifree.site', 'Content-Type': 'text/plain;charset=UTF-8',
582-
'Priority': 'u=4', 'Sec-Fetch-Site': 'same-origin'
583-
}
580+
headers: { 'Alt-Used': 'am.aifree.site', 'Content-Type': 'text/plain;charset=UTF-8', 'Priority': 'u=4' }
584581
},
585582
method: 'POST', streamable: true
586583
},
@@ -589,7 +586,8 @@
589586
expectedOrigin: {
590587
url: 'https://ai28.gptforlove.com',
591588
headers: {
592-
'Accept': 'application/json, text/plain, */*', 'Priority': 'u=0', 'Sec-Fetch-Site': 'same-site'
589+
'Accept': 'application/json, text/plain, */*',
590+
'Priority': 'u=0', 'Sec-Fetch-Site': 'same-site', 'TE': 'trailers'
593591
}
594592
},
595593
method: 'POST', streamable: true, accumulatesText: true,
@@ -598,9 +596,7 @@
598596
'MixerBox AI': {
599597
endpoint: 'https://chatai.mixerbox.com/api/chat/stream',
600598
expectedOrigin: {
601-
url: 'https://chatai.mixerbox.com',
602-
headers: { 'Accept': '*/*', 'Alt-Used': 'chatai.mixerbox.com', 'Sec-Fetch-Site': 'same-origin' }
603-
},
599+
url: 'https://chatai.mixerbox.com', headers: { 'Alt-Used': 'chatai.mixerbox.com', 'TE': 'trailers' }},
604600
method: 'POST', streamable: true, accumulatesText: false
605601
},
606602
'OpenAI': {
@@ -609,10 +605,7 @@
609605
completions: 'https://api.openai.com/v1/chat/completions',
610606
session: 'https://chatgpt.com/api/auth/session'
611607
},
612-
expectedOrigin: {
613-
url: 'https://chatgpt.com',
614-
headers: { 'Accept': '*/*', 'Priority': 'u=4', 'Sec-Fetch-Site': 'same-site' }
615-
},
608+
expectedOrigin: { url: 'https://chatgpt.com', headers: { 'Priority': 'u=4' }},
616609
method: 'POST', streamable: true
617610
}
618611
}
@@ -3151,6 +3144,7 @@
31513144
} catch (err) { return false }
31523145
}
31533146
}
3147+
31543148
// Define API functions
31553149

31563150
const api = {
@@ -3163,12 +3157,11 @@
31633157
createHeaders(api) {
31643158
const ip = ipv4.generate({ verbose: false })
31653159
const headers = {
3166-
'Accept-Encoding': 'gzip, deflate, br, zstd',
3160+
'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, br, zstd',
31673161
'Connection': 'keep-alive', 'Content-Type': 'application/json', 'DNT': '1',
31683162
'Host': new URL(apis[api].endpoints?.completions || apis[api].endpoint).hostname,
3169-
'Origin': apis[api].expectedOrigin.url,
3170-
'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors',
3171-
'TE': 'trailers', 'X-Forwarded-For': ip, 'X-Real-IP': ip
3163+
'Origin': apis[api].expectedOrigin.url, 'Sec-Fetch-Site': 'same-origin',
3164+
'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors', 'X-Forwarded-For': ip, 'X-Real-IP': ip
31723165
}
31733166
headers.Referer = headers.Origin + '/'
31743167
if (api == 'OpenAI') headers.Authorization = 'Bearer ' + config.openAIkey

duckduckgpt/greasemonkey/duckduckgpt.user.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.1.14
151+
// @version 2025.1.14.1
152152
// @license MIT
153153
// @icon https://assets.ddgpt.com/images/icons/duckduckgpt/icon48.png?v=06af076
154154
// @icon64 https://assets.ddgpt.com/images/icons/duckduckgpt/icon64.png?v=06af076
@@ -585,10 +585,7 @@
585585
endpoint: 'https://am.aifree.site/api/generate',
586586
expectedOrigin: {
587587
url: 'https://am.aifree.site',
588-
headers: {
589-
'Accept': '*/*', 'Alt-Used': 'am.aifree.site', 'Content-Type': 'text/plain;charset=UTF-8',
590-
'Priority': 'u=4', 'Sec-Fetch-Site': 'same-origin'
591-
}
588+
headers: { 'Alt-Used': 'am.aifree.site', 'Content-Type': 'text/plain;charset=UTF-8', 'Priority': 'u=4' }
592589
},
593590
method: 'POST', streamable: true
594591
},
@@ -597,7 +594,8 @@
597594
expectedOrigin: {
598595
url: 'https://ai28.gptforlove.com',
599596
headers: {
600-
'Accept': 'application/json, text/plain, */*', 'Priority': 'u=0', 'Sec-Fetch-Site': 'same-site'
597+
'Accept': 'application/json, text/plain, */*',
598+
'Priority': 'u=0', 'Sec-Fetch-Site': 'same-site', 'TE': 'trailers'
601599
}
602600
},
603601
method: 'POST', streamable: true, accumulatesText: true,
@@ -606,9 +604,7 @@
606604
'MixerBox AI': {
607605
endpoint: 'https://chatai.mixerbox.com/api/chat/stream',
608606
expectedOrigin: {
609-
url: 'https://chatai.mixerbox.com',
610-
headers: { 'Accept': '*/*', 'Alt-Used': 'chatai.mixerbox.com', 'Sec-Fetch-Site': 'same-origin' }
611-
},
607+
url: 'https://chatai.mixerbox.com', headers: { 'Alt-Used': 'chatai.mixerbox.com', 'TE': 'trailers' }},
612608
method: 'POST', streamable: true, accumulatesText: false
613609
},
614610
'OpenAI': {
@@ -617,10 +613,7 @@
617613
completions: 'https://api.openai.com/v1/chat/completions',
618614
session: 'https://chatgpt.com/api/auth/session'
619615
},
620-
expectedOrigin: {
621-
url: 'https://chatgpt.com',
622-
headers: { 'Accept': '*/*', 'Priority': 'u=4', 'Sec-Fetch-Site': 'same-site' }
623-
},
616+
expectedOrigin: { url: 'https://chatgpt.com', headers: { 'Priority': 'u=4' }},
624617
method: 'POST', streamable: true
625618
}
626619
}
@@ -3049,12 +3042,11 @@
30493042
createHeaders(api) {
30503043
const ip = ipv4.generate({ verbose: false })
30513044
const headers = {
3052-
'Accept-Encoding': 'gzip, deflate, br, zstd',
3045+
'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, br, zstd',
30533046
'Connection': 'keep-alive', 'Content-Type': 'application/json', 'DNT': '1',
30543047
'Host': new URL(apis[api].endpoints?.completions || apis[api].endpoint).hostname,
3055-
'Origin': apis[api].expectedOrigin.url,
3056-
'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors',
3057-
'TE': 'trailers', 'X-Forwarded-For': ip, 'X-Real-IP': ip
3048+
'Origin': apis[api].expectedOrigin.url, 'Sec-Fetch-Site': 'same-origin',
3049+
'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors', 'X-Forwarded-For': ip, 'X-Real-IP': ip
30583050
}
30593051
headers.Referer = headers.Origin + '/'
30603052
if (api == 'OpenAI') headers.Authorization = 'Bearer ' + config.openAIkey

googlegpt/greasemonkey/googlegpt.user.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
150150
// @author KudoAI
151151
// @namespace https://kudoai.com
152-
// @version 2025.1.14
152+
// @version 2025.1.14.1
153153
// @license MIT
154154
// @icon https://assets.googlegpt.io/images/icons/googlegpt/black/icon48.png?v=59409b2
155155
// @icon64 https://assets.googlegpt.io/images/icons/googlegpt/black/icon64.png?v=59409b2
@@ -767,10 +767,7 @@
767767
endpoint: 'https://am.aifree.site/api/generate',
768768
expectedOrigin: {
769769
url: 'https://am.aifree.site',
770-
headers: {
771-
'Accept': '*/*', 'Alt-Used': 'am.aifree.site', 'Content-Type': 'text/plain;charset=UTF-8',
772-
'Priority': 'u=4', 'Sec-Fetch-Site': 'same-origin'
773-
}
770+
headers: { 'Alt-Used': 'am.aifree.site', 'Content-Type': 'text/plain;charset=UTF-8', 'Priority': 'u=4' }
774771
},
775772
method: 'POST', streamable: true
776773
},
@@ -779,7 +776,8 @@
779776
expectedOrigin: {
780777
url: 'https://ai28.gptforlove.com',
781778
headers: {
782-
'Accept': 'application/json, text/plain, */*', 'Priority': 'u=0', 'Sec-Fetch-Site': 'same-site'
779+
'Accept': 'application/json, text/plain, */*',
780+
'Priority': 'u=0', 'Sec-Fetch-Site': 'same-site', 'TE': 'trailers'
783781
}
784782
},
785783
method: 'POST', streamable: true, accumulatesText: true,
@@ -788,9 +786,7 @@
788786
'MixerBox AI': {
789787
endpoint: 'https://chatai.mixerbox.com/api/chat/stream',
790788
expectedOrigin: {
791-
url: 'https://chatai.mixerbox.com',
792-
headers: { 'Accept': '*/*', 'Alt-Used': 'chatai.mixerbox.com', 'Sec-Fetch-Site': 'same-origin' }
793-
},
789+
url: 'https://chatai.mixerbox.com', headers: { 'Alt-Used': 'chatai.mixerbox.com', 'TE': 'trailers' }},
794790
method: 'POST', streamable: true, accumulatesText: false
795791
},
796792
'OpenAI': {
@@ -799,10 +795,7 @@
799795
completions: 'https://api.openai.com/v1/chat/completions',
800796
session: 'https://chatgpt.com/api/auth/session'
801797
},
802-
expectedOrigin: {
803-
url: 'https://chatgpt.com',
804-
headers: { 'Accept': '*/*', 'Priority': 'u=4', 'Sec-Fetch-Site': 'same-site' }
805-
},
798+
expectedOrigin: { url: 'https://chatgpt.com', headers: { 'Priority': 'u=4' }},
806799
method: 'POST', streamable: true
807800
}
808801
}
@@ -3384,12 +3377,11 @@
33843377
createHeaders(api) {
33853378
const ip = ipv4.generate({ verbose: false })
33863379
const headers = {
3387-
'Accept-Encoding': 'gzip, deflate, br, zstd',
3380+
'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, br, zstd',
33883381
'Connection': 'keep-alive', 'Content-Type': 'application/json', 'DNT': '1',
33893382
'Host': new URL(apis[api].endpoints?.completions || apis[api].endpoint).hostname,
3390-
'Origin': apis[api].expectedOrigin.url,
3391-
'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors',
3392-
'TE': 'trailers', 'X-Forwarded-For': ip, 'X-Real-IP': ip
3383+
'Origin': apis[api].expectedOrigin.url, 'Sec-Fetch-Site': 'same-origin',
3384+
'Sec-Fetch-Dest': 'empty', 'Sec-Fetch-Mode': 'cors', 'X-Forwarded-For': ip, 'X-Real-IP': ip
33933385
}
33943386
headers.Referer = headers.Origin + '/'
33953387
if (api == 'OpenAI') headers.Authorization = 'Bearer ' + config.openAIkey

0 commit comments

Comments
 (0)