-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
140 lines (119 loc) · 4.51 KB
/
index.html
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Terabox Player - by Tech Shade</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
background-color: #f0f0f0;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
text-align: center;
}
input[type="text"] {
width: 80%;
padding: 10px;
margin: 10px 0;
font-size: 1em;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
padding: 10px 20px;
font-size: 1em;
cursor: pointer;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 4px;
margin-top: 10px;
}
button:hover {
background-color: #0056b3;
}
.video-js {
width: 100%;
margin-top: 20px;
}
.details {
margin-top: 20px;
}
.details img {
margin-top: 10px;
max-width: 100%;
border-radius: 8px;
}
.details a {
display: block;
margin-top: 10px;
color: #007bff;
text-decoration: none;
}
.details a:hover {
text-decoration: underline;
}
</style>
<link href="https://unpkg.com/video.js@7/dist/video-js.min.css" rel="stylesheet" />
<!-- forest -->
<link href="https://unpkg.com/@videojs/themes@1/dist/forest/index.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<h1>Terabox Player</h1>
<input type="text" id="urlInput" placeholder="Enter Terabox URL">
<button onclick="fetchVideoData()">Fetch Video</button>
<div id="videoDetails" style="display: none;">
<h2 id="videoTitle"></h2>
<div class="video">
<video id="my-video" class="video-js vjs-theme-forest" controls preload="auto" width="640" height="264"
data-setup="{}">
<source src="" type="video/mp4" />
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a
web browser that
<a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
</p>
</video>
</div>
<div class="details">
<a rel="noreferrer noopener" id="fastDownload" href="#" target="_blank">Fast Download</a>
<a rel="noreferrer noopener" id="hdDownload" href="#" target="_blank">HD Video</a>
<img id="videoThumbnail" src="" alt="Thumbnail">
</div>
</div>
</div>
<script src="https://vjs.zencdn.net/8.16.1/video.min.js"></script>
<script>
async function fetchVideoData() {
const urlInput = document.getElementById('urlInput').value;
const videoDetails = document.getElementById('videoDetails');
const videoTitle = document.getElementById('videoTitle');
const videoThumbnail = document.getElementById('videoThumbnail');
const videoPlayer = videojs('my-video');
const fastDownload = document.getElementById('fastDownload');
const hdDownload = document.getElementById('hdDownload');
const id = urlInput.split("/").pop();
let response = await fetch(`https://wholly-api.skinnyrunner.com/get/website-data.php?get_html=https://www.terabox.tech/api/yttera?id=${id}`);
response = await response.text();
const data = JSON.parse(response);
const videoData = data.response[0];
videoTitle.innerText = videoData.title;
videoThumbnail.src = videoData.thumbnail;
fastDownload.href = videoData.resolutions["Fast Download"];
hdDownload.href = videoData.resolutions["HD Video"];
videoPlayer.src({ type: 'video/mp4', src: "https://apis.forn.fun/tera/data.php?id=" + id });
videoPlayer.poster(videoData.thumbnail);
videoDetails.style.display = "block";
}
</script>
</body>
</html>