从URL列表下载视频(python3)

从URL列表下载视频(python3),python,video,web-scraping,beautifulsoup,web-crawler,Python,Video,Web Scraping,Beautifulsoup,Web Crawler,我有一个URL列表(示例URL),每个URL都包含一个视频: urls = ['https://...live.com/archive/player?live_id=9368953&artist_id=44176&type=1', 'https://...live.com/archive/player?live_id=9344610&artist_id=44176&type=1'] 每个url都有以下检查元素: <div class="row">

我有一个URL列表(示例URL),每个URL都包含一个视频:

urls = ['https://...live.com/archive/player?live_id=9368953&artist_id=44176&type=1', 'https://...live.com/archive/player?live_id=9344610&artist_id=44176&type=1']
每个url都有以下检查元素:

<div class="row">
  <div class="clearfix">
    <button type="button" class="btn btn-primary" onclick="location.href='https://...video.net/archive/flv/master/0009368953-44176.flv?Policy=a19_&Key-Pair-Id=PN2'"></button>
  </div>
</div>

对于每个url,我希望获得其位置的链接。href(在本例中为“”),并从这些链接下载视频

提前谢谢你

导入请求
从bs4导入BeautifulSoup
盖子=[9368953934610]
援助=[4417644176]
def主(url):
将requests.Session()作为请求:
对于拉链中的x、y(盖子、辅助装置):
r=req.get(url.format(x,y))
soup=BeautifulSoup(r.content'html.parser')
target=soup.select_one(“button.btn.btn primary”)['onclick'].split(“”)[1]
r=请求获取(目标)
以open(f“{aid}.flv”,“wb”)作为f:
f、 写作(r.content)
主要(”https://ope.live.com/archive/player?live_id={}&artist_id={}&type=1”)

@VNR请确保复制/粘贴代码的最新更新。@VNR好吧,我看到你只是在谈论你提到的主机之外的另一个主机,然后你谈论一个问题,然后是你要求的那个。无论如何,请使用
verify=False
@aԋᡭҽԃαцєιcαη您对新用户很有眼光;)@CONvid19:D我应该拿奥斯卡当病人,我想啊:P