TVBox icon indicating copy to clipboard operation
TVBox copied to clipboard

第三方 https://raw.fgit.cf/ 加速站失效了

Open echoniuniu opened this issue 1 year ago • 0 comments

很感谢作者大大的整理,

第三方 https://raw.fgit.cf/ 加速站失效了

可以通过下面的方式替换

GITHUB_PROXY = 'https://mirror.ghproxy.com/'; // 代理地址


async function fetchTVBox() {
	const url = `${GITHUB_PROXY}https://github.com/2hacc/TVBox/raw/main/tvbox.json`;
	const response = await fetch(url);
	const data = await response.json();
	const dataString = JSON.stringify(data);
	const replacedDataString = dataString.replaceAll(
		'https://raw.fgit.cf/2hacc/TVBox/main',
		`${GITHUB_PROXY}https://github.com/2hacc/TVBox/raw/main`
	);
	const replacedData = JSON.parse(replacedDataString);
	return new Response(JSON.stringify(replacedData), {
		headers: { 'Content-Type': 'application/json' }
	});
}

希望未来能够尽可能以不信任第三方链接的形式发布,如提供使用github直链,或类似于Cloudfalre R2 CDN等

echoniuniu avatar Feb 10 '24 11:02 echoniuniu