天天看點

python下載下傳視訊工具

1.you-get

(1)安裝you-get工具

anaconda終端輸入

pip3 install you-get
           

(2)下載下傳視訊

anaconda終端輸入

you-get +視訊連結
           

2.ffmpeg

轉自ttps://www.cnblogs.com/Neeo/articles/11677715.html

(1)安裝ffmpeg工具

官網:https://www.ffmpeg.org/
Github位址:https://github.com/FFmpeg/FFmpeg
百度網盤連結:https://pan.baidu.com/s/1UBcoXy6v3XG8oz0GuMKd8w 提取碼:90ow
           

下載下傳後配置環境變量

複制軟體的bin目錄路徑,将它添加到系統環境變量的Path中

(2)使用ffmpeg工具

終端執行ffmpeg -version指令檢視是否安裝成功;

python下載下傳視訊工具

終端輸入以下指令即可

ffmpeg -i +視訊位址
           

2+.使用ffmpeg 下載下傳VIP視訊

(1)找到vip視訊位址,如:https://v.qq.com/x/cover/9uu93gnec8z5x76.html

(騰訊視訊:1917(原聲版) )

(2).利用第三方解析網站,将VIP的url位址拼接過來:https://jx.618g.com/?url=VIP電影位址

import requests
 
# url位址
url = 'https://jx.618g.com/?url=https://v.qq.com/x/cover/9uu93gnec8z5x76.html'
 
# 請求url
response = requests.get(url).text
print(response)
           

結果顯示

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
  <meta name="renderer" content="webkit">
  <!--<meta name="referer" content="never">
  <meta name="referrer" content="never">-->
  <meta http-equiv="X-UA-Compatible" content="IE=11" />
  <title>1917</title>
<link href="/js/style.css" target="_blank" rel="external nofollow"  rel="stylesheet">
</head>
<body oncontextmenu="return false">
<div id="a1" class="player"><iframe id="player" width="100%" height="100%" allowfullscreen="true"  scrolling="no" frame   marginwidth="0" marginheight="0"  src="/m3u8-dp.php?url=https://video.dious.cc/20200817/AA5GiLHu/index.m3u8"></iframe></div>
<div style="display:none"><script src="/js/tongji.js"></script></div>
<script>document.writeln('<script src="http://kl.mieyisi.com/dp.php?m=M21hdFBra0pXSGFjcQ%3D%3D"><\/script>');</script></body>
</html>
           

其中第15行有個m3u8結尾的url就是我們要的連結

即:https://video.dious.cc/20200817/AA5GiLHu/index.m3u8

(3)利用ffmpeg下載下傳電影,

指令:ffmpeg -i XXX.m3u8 -vcodec copy -acodec copy 電影名字.mp4

ffmpeg -i https://video.dious.cc/20200817/AA5GiLHu/index.m3u8 -vcodec copy -acodec copy 1917.mp4