https://github.com/rubenfer/xmltv
Use EPG (XMLTV) files in your project
https://github.com/rubenfer/xmltv
epg swift xmltv xmltv-epg-data
Last synced: 6 months ago
JSON representation
Use EPG (XMLTV) files in your project
- Host: GitHub
- URL: https://github.com/rubenfer/xmltv
- Owner: Rubenfer
- License: gpl-3.0
- Created: 2020-01-21T13:45:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-08T09:36:15.000Z (over 5 years ago)
- Last Synced: 2025-03-26T09:44:51.389Z (6 months ago)
- Topics: epg, swift, xmltv, xmltv-epg-data
- Language: Swift
- Homepage:
- Size: 21.5 KB
- Stars: 12
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XMLTV
XMLTV is a Swift package which allows you to parse XML files using the EPG XMLTV structure.
## Usage
Add XMLTV to your project using Swift Package Manager.XMLTV provides two structs representing channels and programs.
```swift
public struct TVChannel {
public let id: String
public let name: String?
public let url: String?
public let icon: String?
}public struct TVProgram {
public let start: Date?
public let stop: Date?
public let channel: TVChannel
public let title: String?
public let description: String?
public let credits: [String:String]
public let date: String?
public let categories: [String]
public let country: String?
public let episode: String?
public let icon: String?
public let rating: String?
}
```To parse files, you need to create an XMLTV object using the file data. Then you can use `getChannels() -> [TVChannel]` and `getPrograms(channel:) -> [TVProgram]` to get the information.