File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,14 @@ const GOT_HEADERS = {
4949async function handler ( ctx ) {
5050 const { query } = ctx . req . param ( ) ;
5151 const encodedQuery = encodeURIComponent ( query ) ;
52-
53- const apiUrl = `https://jable.tv/search/${ encodedQuery } /` + `?mode=async&function=get_block&block_id=list_videos_videos_list_search_result` + `&q=${ encodedQuery } &sort_by=post_date` ;
52+ const params = new URLSearchParams ( {
53+ mode : 'async' ,
54+ function : 'get_block' ,
55+ block_id : 'list_videos_videos_list_search_result' ,
56+ q : encodedQuery ,
57+ sort_by : 'post_date' ,
58+ } ) ;
59+ const apiUrl = `https://jable.tv/search/${ encodedQuery } /?${ params . toString ( ) } ` ;
5460
5561 const response = await got ( apiUrl , { headers : GOT_HEADERS } ) ;
5662 const $ = load ( response . data ) ;
You can’t perform that action at this time.
0 commit comments