M3UKit is an easy way of parsing of extended M3U playlists.
Directive | Description | Example |
---|---|---|
#EXTM3U | file header, must be the first line of the file | #EXTM3U |
#EXTINF: | track information: runtime in seconds and display title of the following resource / additional properties as key-value pairs | #EXTINF:123,Artist Name – Track Titleartist - title.mp3 |
#EXTGRP: | begin named grouping | #EXTGRP:Foreign Channels |
To add a package dependency to your Xcode
project, select File > Swift Packages > Add Package Dependency and enter M3UKit
repository URL:
https://github.com/SwiftExtensions/M3UKit.git
You can also navigate to your target’s General pane, and in the Frameworks, Libraries, and Embedded Content
section, click the +
button, select Add Other
, and choose Add Package Dependency
.
For more information, see Adding Package Dependencies to Your App
.
CocoaPods
is a dependency manager for Swift
and Objective-C
Cocoa projects. To integrate M3UKit
into your Xcode
project using CocoaPods
, specify it in your Podfile
:
pod 'M3UKit', git: 'https://github.com/SwiftExtensions/M3UKit.git'
import M3UKit
let parser = M3UParser()
let playlist = parser.parse(string: PLAYLIST)
import M3UKit
let loader = M3ULoader()
try? loader.load(with: URL_TO_PLAYLIST) { response in
switch response {
case let .success(playlist):
print(playlist)
case let .failure(error):
print(error)
}
}
link |
Stars: 1 |
Last commit: 1 year ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics