Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
echoniuniu opened this issue Feb 10, 2024 · 0 comments
Open

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

echoniuniu opened this issue Feb 10, 2024 · 0 comments

Comments

@echoniuniu
Copy link

很感谢作者大大的整理,

第三方 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等

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant