import requests
number = 0
while True:
    f_number = '{:05d}'.format(number)
    print(f_number)
    url = f'https://tx-safety-video.acfun.cn/mediacloud/acfun/acfun_video/c767b469f665d619-8ec610ccb1c6f61a2c99ac2503425ee8-hls_720p_hevc_1.{f_number}.ts?pkey=ABAoPNLWlLmComyNl9hAa_BrUEWr8RkeUkRoZVPD4d-yqu1qKMS8YRXZ2Si3tkr76nv9zUkw9Q39rXcrcCGbZ5mI1ZI2z8VUqAawNDUKxXUZbwQ7DZpwvjWvNCenP7tzqrI7NQZCk5SDLVJC1hWqQIaDQvES45l4rONdTIkgqAe_DF_WZRvCMPhWW8hJHlK3NI9xg3pJJWjD9BswmnBCY18aTwbOsoBVXEdCGj4QeTEB6CL-_VsCcapjk9Re-2rHTCQ&safety_id=AAKQvD37s69-v-AuIArhgo-O'
    headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.121 Safari/537.36'

    }
    res = requests.get(url,headers=headers)
    if res.status_code==404:
        break
    open(f"ts视频集/{f_number}.ts","wb").write(res.content)
    number += 1

from moviepy.editor import *
num=0
video_list = []
for num in range(number):
    f_num = '{:05d}'.format(num)
    video= VideoFileClip(f"ts视频集/{f_num}.ts")
    video_list.append(video)
final=concatenate_videoclips(video_list)
final.write_videofile("最终视频.mp4")

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部