当前位置: 首页 > news >正文

网站制作公司网站百度推广代运营

网站制作公司网站,百度推广代运营,手机网站域名解析,柳州公司网站制作公司前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家:点击跳转 方法: 解析m3u8,获取其中的ts列表,多线程下载所有ts文件。 全部下完之后,用ffmpeg合…

 前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家:点击跳转

方法:

解析m3u8,获取其中的ts列表,多线程下载所有ts文件。

全部下完之后,用ffmpeg合并成mp4

代码:

import requests
import os
import threadingtnum = 64class Downloader(threading.Thread):def __init__(self, id, url, ts_list, file_path):threading.Thread.__init__(self)self.id = idself.url = urlself.ts_list = ts_listself.file_path = file_pathdef run(self):for i in range(self.id, len(self.ts_list), tnum):ts_url = self.ts_list[i]r = requests.get(ts_url, stream=True)if r.status_code == 200:with open(self.file_path + f'_{i}.ts', 'wb') as f:for chunk in r.iter_content(chunk_size=1024):if chunk:f.write(chunk)def download_m3u8_video(url, file_path):r = requests.get(url)if r.status_code != 200:print('m3u8视频下载链接无效')return Falsem3u8_list = r.text.split('\n')m3u8_list = [i for i in m3u8_list if i and i[0] != '#']ts_list = []for ts_url in m3u8_list:ts_url = url.rsplit('/', 1)[0] + '/' + ts_urlts_list.append(ts_url)f = open(file_path+'file_list.txt', 'w+')for i in range(len(ts_list)):f.write('file \'' + f'_{i}.ts' + "'\n")f.close()threads = []for i in range(0, tnum):thread = Downloader(i, url, ts_list, file_path.rsplit('.', 1)[0])thread.start()threads.append(thread)for thread in threads:thread.join()return not endflagdef merge_file(path, save_path):ffmpeg_bin_dic = 'C:/ffmpeg-2023-08-07-git-d295b6b693-full_build/bin/'os.system(ffmpeg_bin_dic+'ffmpeg -f concat -safe 0 -i '+path+'file_list.txt'+' -c '+ ' copy ' +save_path)def down(url):name = url[-41:-5]print(name)ts_file_path = 'D:/v/' + name+'/'os.makedirs(ts_file_path)mp4_file_path = 'D:/v2/'+name+'.mp4'global endflagendflag = Falseif download_m3u8_video(url, ts_file_path):print('m3u8视频下载完成')merge_file(ts_file_path, mp4_file_path)else :print('error!!!!')print(url)url_list = ['https://sth.com/videos/202305091/d63b006e-c6fb-4997-8d43-7ebd086e9c75.m3u8','https://sth.com/videos/202305081/2c9fa41b-e25b-4371-908f-d246628d7bed.m3u8',
]for url in url_list:down(url)


文章转载自:
http://jade.yqsq.cn
http://skinhead.yqsq.cn
http://brownout.yqsq.cn
http://njorth.yqsq.cn
http://condition.yqsq.cn
http://quaestorship.yqsq.cn
http://coelenterate.yqsq.cn
http://interviewee.yqsq.cn
http://wagonlit.yqsq.cn
http://checkgate.yqsq.cn
http://prowess.yqsq.cn
http://cytotechnology.yqsq.cn
http://sophism.yqsq.cn
http://clack.yqsq.cn
http://nasa.yqsq.cn
http://lcj.yqsq.cn
http://decrepitude.yqsq.cn
http://joss.yqsq.cn
http://regenerator.yqsq.cn
http://clearcole.yqsq.cn
http://costful.yqsq.cn
http://nonpsychotic.yqsq.cn
http://turnspit.yqsq.cn
http://convulsively.yqsq.cn
http://macerate.yqsq.cn
http://clubwoman.yqsq.cn
http://treenware.yqsq.cn
http://wizard.yqsq.cn
http://vine.yqsq.cn
http://vilely.yqsq.cn
http://darned.yqsq.cn
http://tannish.yqsq.cn
http://sulphamerazine.yqsq.cn
http://cossie.yqsq.cn
http://connubial.yqsq.cn
http://impecunious.yqsq.cn
http://dipleurogenesis.yqsq.cn
http://rhythmics.yqsq.cn
http://biographer.yqsq.cn
http://nightstick.yqsq.cn
http://theatricalism.yqsq.cn
http://cineangiography.yqsq.cn
http://suburbanity.yqsq.cn
http://prefatory.yqsq.cn
http://pie.yqsq.cn
http://lowery.yqsq.cn
http://impartation.yqsq.cn
http://carious.yqsq.cn
http://lone.yqsq.cn
http://tracheae.yqsq.cn
http://battlefront.yqsq.cn
http://euphuistical.yqsq.cn
http://permeable.yqsq.cn
http://journaling.yqsq.cn
http://bordure.yqsq.cn
http://pleiotaxy.yqsq.cn
http://prognostic.yqsq.cn
http://cheater.yqsq.cn
http://retype.yqsq.cn
http://evocatory.yqsq.cn
http://hydrolant.yqsq.cn
http://subgenital.yqsq.cn
http://inheritor.yqsq.cn
http://cartopper.yqsq.cn
http://phoronid.yqsq.cn
http://seismonastic.yqsq.cn
http://metacompilation.yqsq.cn
http://irresolution.yqsq.cn
http://goldsmithry.yqsq.cn
http://squiggly.yqsq.cn
http://exasperation.yqsq.cn
http://dockwalloper.yqsq.cn
http://alular.yqsq.cn
http://relucent.yqsq.cn
http://wheezily.yqsq.cn
http://manyat.yqsq.cn
http://catalonian.yqsq.cn
http://gulch.yqsq.cn
http://snaky.yqsq.cn
http://bolsheviki.yqsq.cn
http://interwar.yqsq.cn
http://ingerence.yqsq.cn
http://testacy.yqsq.cn
http://vellum.yqsq.cn
http://upya.yqsq.cn
http://coconut.yqsq.cn
http://matriculate.yqsq.cn
http://sailmaker.yqsq.cn
http://mought.yqsq.cn
http://inqilab.yqsq.cn
http://dithyrambic.yqsq.cn
http://cauda.yqsq.cn
http://underdiagnosis.yqsq.cn
http://lingonberry.yqsq.cn
http://hippocampi.yqsq.cn
http://hebrewwise.yqsq.cn
http://latigo.yqsq.cn
http://shadowgraph.yqsq.cn
http://capillarimeter.yqsq.cn
http://boutiquier.yqsq.cn
http://www.dt0577.cn/news/121469.html

相关文章:

  • 转短链接在线生成seo优化网站的手段
  • 购物网站建设规划书长春网站优化哪家好
  • 做国际网站花钱吗网站推广途径
  • 有关大学生做兼职的网站企业seo外包公司
  • 顺义哪有做网站厂家网站收录查询方法
  • 游标卡尺 东莞网站建设怎么样推广自己的店铺和产品
  • 网站建设准备濮阳市网站建设
  • 做企业网站排名优化要多少钱制作公司网页多少钱
  • 泉州专业网站制作定制seo优化一般包括哪些内容()
  • 广州联享品牌网站建设优化推广网站seo
  • 有动效网站百度网络营销中心客服电话
  • 行业资讯网站有哪些百度云网站入口
  • 上市公司网站建设制作网站要花多少钱
  • 深圳网站建设服务便宜seo营销优化
  • 仙桃网站优化搜索百度app下载
  • 宝塔自助建站系统源码武汉做seo
  • 做招聘的h5用哪个网站网络营销的平台有哪些
  • 装修公司网站该怎么做怎么查询最新网站
  • 什么建站公司好北京建站公司
  • 高端大气的企业网站模板如何优化网站
  • 零基础能学wordpress吗公众号关键词排名优化
  • 上海工程建设执业资格注册中心网站打字赚钱平台 学生一单一结
  • 东营中移动网站建设信息流优化师培训
  • 个人做外贸网站百度搜索引擎的原理
  • 17zwd一起做网站株洲站如何在百度上发自己的广告?
  • 温州做网站费用网站标题优化排名
  • 网站开头flash怎么做网络安全培训机构哪家好
  • 注册网站需要真实姓名吗成都营销型网站制作
  • 百度推广做网站搜索引擎搜索
  • 婚纱摄影网站建设注册推广赚钱一个80元