Public
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { fetch as proxyFetch } from "https://esm.town/v/std/fetch";
const Fetch = fetch;
interface ShowBox {
code: number;
msg: string;
server_runtime: number;
server_name: string;
data: {
link: string;
};
}
export default async function(req: Request): Promise<Response> {
const showbox = await Fetch("https://www.showbox.media/index/share_link?id=55137&type=1", {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Alt-Used": "www.showbox.media",
},
});
const showboxResponse: ShowBox = await showbox.json();
const febboxId = showboxResponse.data.link.split("/")[4];
const febboxUrl = `https://www.febbox.com/share/${febboxId}`;
console.log(febboxId);
const febboxItemRequest = await fetch(`https://www.febbox.com/file/file_share_list?share_key=${febboxId}`, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Alt-Used": "www.showbox.media",
},
});
const febboxItemJson = await febboxItemRequest.text();
return new Response(febboxItemJson);
}
tempguy-plumowl.web.val.run
July 7, 2024