Code Monkey home page Code Monkey logo

Comments (3)

horizon86 avatar horizon86 commented on May 22, 2024

显然,你的文件中包含了不同比特率视频的m3u8文件的位置。选择一个合适的替换原链接中的playlist.m3u8即可,比如:
https://bitdash-a.akamaihd.net/content/sintel/hls/video/250kbit.m3u8

from m3u8-downloader.

Momo707577045 avatar Momo707577045 commented on May 22, 2024

多谢反馈,多谢帮忙解答

from m3u8-downloader.

JinJiangHuang avatar JinJiangHuang commented on May 22, 2024

这段代码改成这样就能下载了
this.tsUrlList = []
this.finishList = []
var rtn=false;
var start=false;
// 提取 ts 视频片段地址
m3u8Str.split('\n').some((item) => {
if (item.toLowerCase().indexOf('.ts') > -1) {
this.tsUrlList.push(this.applyURL(item, this.url))
this.finishList.push({
title: item,
status: ''
})
}else if(item.toUpperCase().indexOf('#EXT-X-STREAM-INF') > -1){//找到真实地址开始的标识
start=true;
}else if(start&&item.toLowerCase().indexOf('.m3u8') > -1){//找到真实地址
var keyUrl=item;
if(keyUrl.startsWith('http')){
this.url=keyUrl;
}else{
if(keyUrl.startsWith('/')){
keyUrl=keyUrl.substring(1);
}
keyUrl=this.url.substring(0,this.url.lastIndexOf("/")+1)+keyUrl;
this.url=keyUrl;
}
console.log("keyUrl:"+keyUrl);
rtn=true;
this.getM3U8();
return true;
}
})
if(rtn){
return;
}

from m3u8-downloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.