最有用的福利,轻松下载pornhub的工具,P站视频文件下载一键搞定
P站P站的视频,可以在网页端下载。这里提供另一种方法。
Youtube-dl是一个十分强大的视频下载工具。支持下载上百个视频网站,包括国内的B站,youku等。
这里介绍一下用youtube-dl下载P站的视频方法。
现在网页视频很多以m3u8的视频片段提供,下载就是把所有视频片段下载后组合在一起。
youtube-dl的安装,具体就不展开了,可以在各种系统,也可以远程搭建vps在云端下载,vultr,linode,搬瓦工vps。
複製代碼
pip3 install youtube-dl
以在window10的wsl(win子系统)下为例。
首先,国内网络的话需要让运行环境的网络添加代理。
複製代碼
export http_proxy=http://127.0.0.1:1080 && export https_proxy=http://127.0.0.1:1080
添加代理后,才可以正常访问P站。
1. 下载单个视频
Quote:
youtube-dl 视频网址
2. 下载视频列表
通常列表中有很多视频,如果需要批量下载。
Quote:
youtube-dl 列表地址
而长时间下载,由于网络环境不佳,容易出错,导致下载中断,使用下面的shell脚本自动恢复下载。
当下载出错后,5秒后自动恢复下载。
Quote:
!/bin/sh
while [ 0 -eq 0 ]
do
echo "----------------------job begin--------------------"youtube-dl 列表/视频地址
if [$? -eq 0];then
echo "---------------------job complete------------------"
break;
else
echo "--------------------error occur,restart------------"
sleep 5
fi
done
3. 列表视频选择
想下载部分列表中的视频,也可以指定列表的起始或者终止视频。
Quote:
Video Selection:
--playlist-start NUMBER Playlist video to start at (default is 1)
--playlist-end NUMBER Playlist video to end at (default is last)
--playlist-items ITEM_SPEC Playlist video items to download. Specify
indices of the videos in the playlist
separated by commas like: "--playlist-items
1,2,5,8" if you want to download videos
indexed 1, 2, 5, 8 in the playlist. You can
specify range: "--playlist-items
1-3,7,10-13", it will download the videos
at index 1, 2, 3, 7, 10, 11, 12 and 13.
下载展示