@@ -3,8 +3,8 @@ import { baseUrl, gqlFeatures, bearerToken, gqlMap, thirdPartySupportedAPI } fro
33import { config } from '@/config' ;
44import queryString from 'query-string' ;
55import { Cookie , CookieJar } from 'tough-cookie' ;
6- import { CookieAgent , CookieClient } from 'http-cookie-agent/undici' ;
7- import { ProxyAgent } from 'undici' ;
6+ import { CookieAgent , cookie as HttpCookieAgentCookie } from 'http-cookie-agent/undici' ;
7+ import { ProxyAgent , Client } from 'undici' ;
88import cache from '@/utils/cache' ;
99import logger from '@/utils/logger' ;
1010import ofetch from '@/utils/ofetch' ;
@@ -23,7 +23,7 @@ const token2Cookie = async (token) => {
2323 try {
2424 const agent = proxy . proxyUri
2525 ? new ProxyAgent ( {
26- factory : ( origin , opts ) => new CookieClient ( origin as string , { ... opts , cookies : { jar } } ) ,
26+ factory : ( origin , opts ) => new Client ( origin as string , opts ) . compose ( HttpCookieAgentCookie ( { jar } ) ) ,
2727 uri : proxy . proxyUri ,
2828 } )
2929 : new CookieAgent ( { cookies : { jar } } ) ;
@@ -110,7 +110,7 @@ export const twitterGot = async (
110110 const jar = CookieJar . deserializeSync ( cookie as any ) ;
111111 const agent = proxy . proxyUri
112112 ? new ProxyAgent ( {
113- factory : ( origin , opts ) => new CookieClient ( origin as string , { ... opts , cookies : { jar } } ) ,
113+ factory : ( origin , opts ) => new Client ( origin as string , opts ) . compose ( HttpCookieAgentCookie ( { jar } ) ) ,
114114 uri : proxy . proxyUri ,
115115 } )
116116 : new CookieAgent ( { cookies : { jar } } ) ;
0 commit comments