File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
definitions/vite-supadata-runner/worker Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 11import { Hono } from "hono" ;
2- import {
3- getCookie ,
4- } from 'hono/cookie'
52import {
63 Crawl ,
74 CrawlJob ,
@@ -15,14 +12,13 @@ import {
1512 YoutubePlaylist ,
1613 YoutubeVideo ,
1714} from '@supadata/js' ;
18- import { API_RESPONSES } from './config' ;
1915
20- async function getUserAPIKey ( request : any ) {
16+ async function getUserAPIKey ( c : any ) {
2117 const res = await fetch ( `https://dash.supadata.ai/api/get-api-key` , {
2218 headers : {
2319 'Content-Type' : 'application/json' ,
2420 // If this API is called in the Cloudflare Worker, Cookie need to be passed.
25- 'Cookie' : getCookie ( request )
21+ 'Cookie' : c . req . header ( 'Cookie' )
2622 }
2723 } )
2824
@@ -40,7 +36,7 @@ export function userRoutes(app: Hono<{ Bindings: any }>) {
4036 app . post ( '/api/supadata/transcript' , async ( c ) => {
4137 let apiKey = ''
4238 let e = { } as any
43- const cookie = getCookie ( c )
39+ const cookie = c . req . header ( 'Cookie' )
4440 try {
4541 // GET API KEY BY THIS METHOD. DO NOT GET API KEY FROM ENV.
4642 apiKey = await getUserAPIKey ( c ) ;
You can’t perform that action at this time.
0 commit comments