当前位置:   article > 正文

python下载ts视频文件_python ts 下载 mp4

python ts 下载 mp4
  1. import requests
  2. from multiprocessing import Pool
  3. def mission(url,n):
  4. headers = {"User-Agent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"}
  5. print('*****')
  6. response=requests.get(url,headers=headers)
  7. print('-----')
  8. f=open("./1/%03d.ts"%n,"wb")
  9. f.write(response.content)
  10. f.close()
  11. print("%03d.ts OK..."%n)
  12. if __name__ == "__main__":
  13. pool=Pool(20)
  14. for n in range(1,38):
  15. url = "https://f1.media.brightcove.com/1/1362235890001/5796758914001/1362235890001_5796758914001_s-{}.ts?pubId=1362235890001&videoId=1655020599001".format(n)
  16. pool.apply_async(mission,(url,n))
  17. pool.close()
  18. pool.join()

在windows系统下面,直接可以使用:copy/b *.ts video.mp4  把所有ts文件合成一个mp4格式文件

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/154556
推荐阅读
相关标签
  

闽ICP备14008679号