Skip to content

Commit c4c1c79

Browse files
eve2ptpEvilmass
authored andcommitted
fix jable
Unexpected string concatenation of literals.
1 parent dfe8723 commit c4c1c79

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/routes/jable/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,14 @@ const GOT_HEADERS = {
5555
async function handler(ctx) {
5656
const { query } = ctx.req.param();
5757
const encodedQuery = encodeURIComponent(query);
58-
59-
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`;
58+
const params = new URLSearchParams({
59+
mode: 'async',
60+
function: 'get_block',
61+
block_id: 'list_videos_videos_list_search_result',
62+
q: encodedQuery,
63+
sort_by: 'post_date',
64+
});
65+
const apiUrl = `https://jable.tv/search/${encodedQuery}/?${params.toString()}`;
6066

6167
const response = await got(apiUrl, { headers: GOT_HEADERS });
6268
const $ = load(response.data);

0 commit comments

Comments
 (0)