Skip to content

Commit 694529f

Browse files
eve2ptpEvilmass
authored andcommitted
fix jable
Unexpected string concatenation of literals.
1 parent 706e252 commit 694529f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/routes/jable/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@ const GOT_HEADERS = {
4949
async 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);

0 commit comments

Comments
 (0)