Hint: ******443
Use the following endpoints to interact with your videos database programmatically. All requests require the `Authorization` header set to your admin password.
Base URL: https://your-worker-domain.dev/api/videos
Fetches the entire list of videos ordered by newest first.
fetch('/api/videos', {
method: 'GET',
headers: {
'Authorization': 'YOUR_PASSWORD'
}
})
.then(res => res.json())
.then(data => console.log(data));
You can add a single url using `{ "url": "..." }` or multiple urls at once using `{ "urls": ["...", "..."] }`. Duplicates will automatically be ignored.
fetch('/api/videos', {
method: 'POST',
headers: {
'Authorization': 'YOUR_PASSWORD',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"urls": [
"https://example.com/video1.mp4",
"https://example.com/video2.mp4"
]
})
});
Modify an existing video's URL by its integer ID.
fetch('/api/videos', {
method: 'PUT',
headers: {
'Authorization': 'YOUR_PASSWORD',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"id": 142,
"url": "https://example.com/newlink.mp4"
})
});
Remove a video from the database by its integer ID.
fetch('/api/videos', {
method: 'DELETE',
headers: {
'Authorization': 'YOUR_PASSWORD',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"id": 142
})
});