赞
踩
from urllib import request
# 为请求添加请求头
opener = request.build_opener()
opener.addheaders = [
('Referer','https://www.bilibili.com/bangumi/play/ep199612?from=search&seid=17094093942596385132'),
('User-Agent','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.16 Safari/537.36')
]
request.install_opener(opener)
url_1 = 'https://upos-sz-mirrorhw.bilivideo.com/upgcxcode/85/81/34568185/34568185_da1-1-30032.m4s?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1589612693&gen=playurl&os=hwbv&oi=1874926467&trid=2d9c32f869154a9d825cab4234c3d7e1p&platform=pc&upsig=f7a1a0b3ec001c0e0c211e82b01813f7&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,platform&mid=314286954&logo=80000000'
url_2 = 'https://upos-sz-mirrorhw.bilivideo.com/upgcxcode/85/81/34568185/34568185_da1-1-30216.m4s?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1589612693&gen=playurl&os=hwbv&oi=1874926467&trid=2d9c32f869154a9d825cab4234c3d7e1p&platform=pc&upsig=cd1d603424ef110f565ec9f4809b98a0&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,platform&mid=314286954&logo=80000000'
request.urlretrieve(url=url_1,filename='1.mp4')
request.urlretrieve(url=url_2,filename='2.mp3')
import subprocess
subprocess.call('D:/xmind_about_python/复习/ffmpeg-20200515-b18fd2b-win64-static/bin/ffmpeg.exe -i 1.mp4 -i 2.mp3 -strict -2 -f mp4 4.mp4', shell=True)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。