这是 feixiang 大佬的 TG 免费图床最初版本,稍显繁琐
想着既然能白 piao,就绝对不出一分钱的中心思想。
反代 https://telegra.ph/ 5M 以内都可以传。
我们要提前准备 2 个东西:
1、免费的域名 1 个(当然收费域名也可以)
2、cloudflare
账户 1 枚
Future 大佬简化版:https://hostloc.com/thread-1092595-1-1.html
1、下载源码包
下载地址:https://mega.nz/file/KU1yUIwa#9HgeZNzT017rCGhxopGBvcv-jwtkdNQiVyb_7VwtSyA
2、上传之前,你可以修改包里面 index.html
和 _next/b46e75617207ae5013d0.js
这个里面的一些文字改成你的,但是记得改了之后要打包成 zip
。
3、登录 cloudflare
,找到 pages
,点创建项目,然后选择直接上传。再录入一个项目名称,然后选择 zip
压缩包,然后等待上传完成。

4、在 pages 的自定义域里面,绑定 cloudflare 中存在的域名,在 cloudflae 托管的域名,自动会修改 dns 记录。

5、打开 worker,创建 2 个服务,主要是为了反代 img.nipao.com
的壁纸接口和 telegra.ph
反代 img.nipao.com
的代码:
addEventListener('fetch', event => {
const request = event.request;
const url = new URL(request.url);
const response = fetch('https://img.nipao.com/api/bing/wallpaper/index' + url.pathname + url.search, {
method: request.method,
headers: request.headers,
body: request.body,
});
event.respondWith(response);
});
反代 telegra.ph
的代码:
addEventListener('fetch', event => {
const request = event.request;
const url = new URL(request.url);
const response = fetch('https://telegra.ph/' + url.pathname + url.search, {
method: request.method,
headers: request.headers,
body: request.body,
});
event.respondWith(response);
});
新建后,自己对 worker
服务命名,比如我这个命名为

6、在域名的 workers
路由页面,添加 3 条规则。

7、在域名的规则 --- 页面规则里面添加一条缓存规则。

8、最后检查下 域名里面 Scrape Shield
页面 的 Hotlink
保护是否关闭。
