dongleiqiao4906 2019-07-23 21:35
浏览 414

用php下载youtube-dl / ffmpeg下载youtube视频

I have been using youtube-dl for a long time, and I now want to install it on my dedicated server to make it easier for me to download content.

I created a php script that allows me to download the video of my choice to the server, then I download it to my computer, pretty cool!

I am now trying to improve this script in order to redirect only the feed to avoid uploading the video to the server.

Example with this site: https://mpgun.com It seems to redirect the stream without downloading the video to the server. If you try to download a video that lasts 3 hours, the site will offer you the download immediately!

I think ffmpeg allows you to do that, only I don't know where to start in the code.

Do you have any idea how to set this up in php?

Thank you

  • 写回答

1条回答 默认 最新

  • douxing8939 2019-07-23 22:26
    关注

    What you are looking for is the --get-url switch for youtube DL.

    For example, execute the command:

    youtube-dl -f best --get-url "https://www.youtube.com/watch?v=fPXqHOpVV80"
    

    This will output the direct download link the the video.

    评论

报告相同问题?

悬赏问题

  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了