Skip to content

Commit 2521dab

Browse files
fixed with new server.js
1 parent 744d61f commit 2521dab

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

script.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ function downloadVideo() {
1111

1212
messageEl.textContent = "Downloading...";
1313

14-
fetch('https://144.126.140.60:3000/download?url=' + encodeURIComponent(url))
15-
.then (response => response.text())
16-
.then (data => {
14+
fetch('http://s1.phntmhosting.xyz:6909/download?url=' + encodeURIComponent(url))
15+
.then(response => {
16+
if (!response.ok) {
17+
throw new Error('Network response was not ok: ' + response.statusText);
18+
}
19+
return response.text();
20+
})
21+
.then(data => {
1722
messageEl.textContent = data;
23+
})
24+
.catch(error => {
25+
messageEl.textContent = "Error: " + error.message;
1826
});
1927
}
20-
21-
22-

0 commit comments

Comments
 (0)