How to automatically saved after the streaming/watched video ends locally on the Computer? E.g. Local Disk C:/
So, I have a streaming video on my website. Here it is:
I use iframe for that and it is connected on youtube.
<iframe class="container-fluid mb-4" height="500" src="https://www.youtube.com/embed/D-EcyYkv-mU"></iframe>
How to save the video on the computer after the livestream ends? Thanks!
Take a looks at https://github.com/rg3/youtube-dl/ project. It can download videos from youtube.
Two options I can think of
- You can call external command from PHP code and save the output.
- Or you can writ a simple bat(windows)/shell script(linux) and call from withing your code. You may even choose to write a corn job for your task.
Not sharing any code since OP has not included any minimal code to help. I am not a PHP guy but trying to help the OP
you may check this [issue on github] which asks a similar question2
<?php $cmd = 'youtube-dl -o "/home/ftp8/public_html/temp/%(id)s.%(ext)s" --max-quality flv https://www.youtube.com/watch?v=GMuZdN84PJg'; shell_exec($cmd); ?>
Above is a very simple code sample to execute youtube-dl from php. please note you will have to tweak the youtube-dl arguments according to your liking.