-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hope this helps with bot sending video #12
Comments
Question: why would a user send video to a chat bot? This ain't telegeam with unlimited storage. |
this for ai on your ro do list |
Allow bot send video |
Not planning to add such thing in distant future. This is a chatbot, at max I'll add sending photo (only from ai, not from user) to keep power usage and complexity low |
you could let it send some videos like youtube videos or twitch clips |
Yes will do that, but Instead of downloading, will allow embedded code with video playback. |
Planning to add YouTube video player API Also have "plyr" in mind. Issue on using anything YouTube : on Android playback will stop when user leaves screen (uncontrollable) |
try newpipes method |
Interesting app, sadly its an app. Can you find any web alternative with api |
invidius |
CORS issue on Hotlinking to player |
Noted, will add in future updates |
You can use various video processing libraries like FFmpeg or GStreamer to manipulate the video files and streaming protocols like HLS or MPEG-DASH to serve them over the internet. You can also use third-party APIs like Cloudinary or Amazon S3 to store and retrieve the video files. However, it's important to note that enabling a chat AI to send videos on a self-hosted website could potentially create legal or ethical issues, especially if the videos are not moderated or monitored for inappropriate content. It's important to carefully consider the implications of such a feature before implementing it.
Sure, here's an example of how you could allow a chat AI to send videos on a self-hosted website using HTML and JavaScript:
python
javascript
function uploadVideo() {
var file = document.querySelector('input[type="file"]').files[0];
var xhr = new XMLHttpRequest();
xhr.open('POST', 'upload.php', true);
xhr.upload.onprogress = function(e) {
if (e.lengthComputable) {
var percentComplete = (e.loaded / e.total) * 100;
console.log(percentComplete + '% uploaded');
}
};
xhr.onload = function() {
if (this.status === 200) {
console.log('Video uploaded!');
} else {
console.error('Error uploading video');
}
};
var formData = new FormData();
formData.append('video', file);
xhr.send(formData);
}
php
Note that this code is just an example and would need to be customized to fit your specific website and use case.
Here's an alternative implementation of the same functionality using Node.js and the Express framework:
npm install express multer
javascript
const express = require('express');
const multer = require('multer');
const app = express();
const upload = multer({ dest: 'uploads/' });
app.post('/upload', upload.single('video'), (req, res) => {
if (!req.file) {
return res.status(400).send('No video uploaded');
}
res.send('Video uploaded successfully');
});
app.listen(3000, () => {
console.log('Server listening on port 3000');
});
php
<script> const form = document.querySelector('form'); form.addEventListener('submit', (e) => { e.preventDefault(); const xhr = new XMLHttpRequest(); xhr.open('POST', '/upload'); xhr.onload = () => { console.log(xhr.responseText); }; const formData = new FormData(form); xhr.send(formData); }); </script>Again, note that this code is just an example and would need to be customized to fit your specific website and
The text was updated successfully, but these errors were encountered: