hipposan / lemondeer Goto Github PK
View Code? Open in Web Editor NEWMake m3u8 parse and video download as white magic.
License: MIT License
Make m3u8 parse and video download as white magic.
License: MIT License
I haven't even done anything when I tapped download button except declare m3u8URL and call parse() and I every time got this error:
Task <38E7D5FF-9F4C-4A1E-94F9-7F0E3A0329D1>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSErrorFailingURLStringKey=segment1.ts, NSErrorFailingURLKey=segment1.ts, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDownloadTask <38E7D5FF-9F4C-4A1E-94F9-7F0E3A0329D1>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <38E7D5FF-9F4C-4A1E-94F9-7F0E3A0329D1>.<1>, NSUnderlyingError=0x6000019e0510 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}} [-1002]
I even don't understand where it comes from, cause I've commented everything!
On code used string - "Downloads", better use property of class
i have m3u8 file, and parsed it all good, but on download it's error, because ts file names - local.
I know how resolve this error, but it'll be great if lemondeer can detect this case.
example:
#EXTM3U\n#EXT-X-TARGETDURATION:16\n#EXT-X-ALLOW-CACHE:YES\n#EXT-X-PLAYLIST-TYPE:VOD\n#EXT-X-VERSION:3\n#EXT-X-MEDIA-SEQUENCE:1\n#EXTINF:3.000,\n143.240p.1.ts?s=tmaRGviiU5bYDojIpV6VWA&e=1530909205\n#EXTINF:13.000,\n143.240p.2.ts?s=tmaRGviiU5bYDojIpV6VWA&e=1530909205\n#EXTINF:16.000,\n143.240p.3.ts?s=tmaRGviiU5bYDojIpV6VWA&e=1530909205\n#EXTINF:16.000,\n143.240p.4.ts?s=tmaRGviiU5bYDojIpV6VWA&e=1530909205\n
In new m3u8 file better don't set global path for ts files, because often ts files has same path as m3u8 file, and video player use this. If download several m3u8 in different dirs, you can start one web server on base path and play files like:
start webserver: http://127.0.0.1:8080/ on dir DOWNLOADS
play file: http://127.0.0.1:8080/1/1.m3u8
play file: http://127.0.0.1:8080/2/2.m3u8
play file: http://127.0.0.1:8080/3/3.m3u8
ps. Sorry for my bad english
for i in 0 ..< tsPlaylist.tsSegmentArray.count {
let segmentModel = tsPlaylist.tsSegmentArray[i]
let length = "#EXTINF:\(segmentModel.duration),\n"
let fileName = "http://127.0.0.1:8080/\(segmentModel.index).ts\n"
content += (length + fileName)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.