-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
140 additions
and
89 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Video Download Form</title> | ||
<style> | ||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
margin-top: 50px; | ||
} | ||
|
||
label { | ||
margin-top: 10px; | ||
} | ||
|
||
input { | ||
margin-bottom: 10px; | ||
} | ||
|
||
.loading { | ||
display: none; | ||
margin-top: 20px; | ||
} | ||
|
||
.loading.show { | ||
display: block; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<form id="videoForm"> | ||
<label for="videoLink">Video Link:</label> | ||
<input type="url" id="videoLink" name="videoLink" required> | ||
<label for="saturation">Saturation:</label> | ||
<input type="number" id="saturation" name="saturation" step="0.01" required> | ||
<button type="submit">Submit</button> | ||
</form> | ||
<div id="loading" class="loading" hidden>Loading...</div> | ||
<div id="result" hidden> | ||
<a id="downloadButton" href="#" download>Download Video</a> | ||
</div> | ||
</div> | ||
<script> | ||
document.getElementById('videoForm').addEventListener('submit', async function (e) { | ||
e.preventDefault(); | ||
|
||
const videoLink = encodeURIComponent(document.getElementById('videoLink').value); | ||
const saturation = encodeURIComponent(document.getElementById('saturation').value); | ||
const loadingIndicator = document.getElementById('loading'); | ||
const resultContainer = document.getElementById('result'); | ||
const downloadButton = document.getElementById('downloadButton'); | ||
|
||
loadingIndicator.classList.add('show'); | ||
resultContainer.hidden = true; | ||
|
||
try { | ||
const response = await fetch(`https://souqzone.xyz/download-video/?video_url=${videoLink}&saturation=${saturation}`); | ||
|
||
if (!response.ok) { | ||
throw new Error('Network response was not ok'); | ||
} | ||
|
||
const data = await response.json(); | ||
const downloadUrl = data.url; // Adjust this based on the actual JSON response structure | ||
|
||
downloadButton.setAttribute('href', downloadUrl); | ||
|
||
loadingIndicator.classList.remove('show'); | ||
resultContainer.hidden = false; | ||
} catch (error) { | ||
console.error('Error:', error); | ||
loadingIndicator.classList.remove('show'); | ||
} | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ requests | |
wget | ||
ffmpeg-python | ||
moviepy | ||
starlette |