下载视频并自动保存在文件夹中

时间:2016-10-19 15:25:10

标签: php video youtube

使用php,如何从youtube下载视频,当我点击保存时,视频会直接转到我已创建的文件夹中?

我有这段代码:

 <label class="col-md-4" for="nome">Nome</label>//name that a give to the video//
 <label class="col-md-4" for="tipo">Tipo</label>//extension (.wmv, .mp4)//
 <div class="col-md-4">
            <input type="nome" class="form-control" name="nome"/>//ABC example of a name
 </div>
 <div class="col-md-4">
            <select class="form-control" name="tipo"> //extensions
            <option>wmv</option>
            <option>mp4</option>
            </select>
 </div>
 <label class="col-md-4" for="url">URL</label>
 <label class="col-md-4" for="caminho">Caminho</label>
 <input type="url" class="form-control" name="url" value="<?php "" 
               ?>"/> //example of a Url https://www.youtube.com/embed/LsG-rvQoErk
<input type="text" class="form-control" name="caminho" value="videos2/ABC.mp4">

这最后一行“输入类型=”文本“class =”form-control“name =”caminho“value =”videos2 / ABC.mp4“”不存在,但是当我点击保存时我希望视频是保存在名为“videos2”的文件夹中,当我去看视频时,我想看到它保存在文件夹中。

我该怎么做?谢谢

1 个答案:

答案 0 :(得分:0)

You can get youtube video downloading url using below url

http://www.youtube.com/get_video_info?&video_id='+{VIDEO_ID}+'&asv=3&el=detailpage&hl=en_US

and from github you can get youtube video downloading script in php at

https://github.com/jeckman/YouTube-Downloader