|
148 | 148 | // @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
|
149 | 149 | // @author KudoAI
|
150 | 150 | // @namespace https://kudoai.com
|
151 |
| -// @version 2025.1.14 |
| 151 | +// @version 2025.1.14.1 |
152 | 152 | // @license MIT
|
153 | 153 | // @icon https://assets.bravegpt.com/images/icons/bravegpt/icon48.png?v=df624b0
|
154 | 154 | // @icon64 https://assets.bravegpt.com/images/icons/bravegpt/icon64.png?v=df624b0
|
|
577 | 577 | endpoint: 'https://am.aifree.site/api/generate',
|
578 | 578 | expectedOrigin: {
|
579 | 579 | 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' } |
584 | 581 | },
|
585 | 582 | method: 'POST', streamable: true
|
586 | 583 | },
|
|
589 | 586 | expectedOrigin: {
|
590 | 587 | url: 'https://ai28.gptforlove.com',
|
591 | 588 | 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' |
593 | 591 | }
|
594 | 592 | },
|
595 | 593 | method: 'POST', streamable: true, accumulatesText: true,
|
|
598 | 596 | 'MixerBox AI': {
|
599 | 597 | endpoint: 'https://chatai.mixerbox.com/api/chat/stream',
|
600 | 598 | 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' }}, |
604 | 600 | method: 'POST', streamable: true, accumulatesText: false
|
605 | 601 | },
|
606 | 602 | 'OpenAI': {
|
|
609 | 605 | completions: 'https://api.openai.com/v1/chat/completions',
|
610 | 606 | session: 'https://chatgpt.com/api/auth/session'
|
611 | 607 | },
|
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' }}, |
616 | 609 | method: 'POST', streamable: true
|
617 | 610 | }
|
618 | 611 | }
|
|
3151 | 3144 | } catch (err) { return false }
|
3152 | 3145 | }
|
3153 | 3146 | }
|
| 3147 | + |
3154 | 3148 | // Define API functions
|
3155 | 3149 |
|
3156 | 3150 | const api = {
|
|
3163 | 3157 | createHeaders(api) {
|
3164 | 3158 | const ip = ipv4.generate({ verbose: false })
|
3165 | 3159 | const headers = {
|
3166 |
| - 'Accept-Encoding': 'gzip, deflate, br, zstd', |
| 3160 | + 'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, br, zstd', |
3167 | 3161 | 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'DNT': '1',
|
3168 | 3162 | '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 |
3172 | 3165 | }
|
3173 | 3166 | headers.Referer = headers.Origin + '/'
|
3174 | 3167 | if (api == 'OpenAI') headers.Authorization = 'Bearer ' + config.openAIkey
|
|
0 commit comments