mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
fix: update search URLs to use m3u8 proxy for improved access
This commit is contained in:
@@ -76,14 +76,14 @@ async function posts(
|
||||
): Promise<Post[]> {
|
||||
try {
|
||||
const { axios, cheerio } = providerContext;
|
||||
const urlRes = await axios.get(url, {
|
||||
const urlRes = await fetch(url, {
|
||||
headers: {
|
||||
...headers,
|
||||
Referer: url,
|
||||
},
|
||||
signal,
|
||||
});
|
||||
const $ = cheerio.load(urlRes.data);
|
||||
const $ = cheerio.load(await urlRes.text());
|
||||
const posts: Post[] = [];
|
||||
$(".blog-items")
|
||||
?.children("article")
|
||||
|
||||
@@ -60,7 +60,7 @@ export const getSearchPosts = async ({
|
||||
const baseUrl = await getBaseUrl("Vega");
|
||||
|
||||
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
|
||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
const url = `https://c.8man.workers.dev/?url=${baseUrl}/page/${page}/?s=${searchQuery}`;
|
||||
console.log("vegaGetPosts url:", url);
|
||||
|
||||
return posts(baseUrl, url, signal, commonHeaders, axios, cheerio);
|
||||
|
||||
Reference in New Issue
Block a user