https://github.com/hmlendea/stream-to-m3u
Get M3U playlist links for liverstreams from various platforms
https://github.com/hmlendea/stream-to-m3u
iptv m3u m3u8
Last synced: 5 months ago
JSON representation
Get M3U playlist links for liverstreams from various platforms
- Host: GitHub
- URL: https://github.com/hmlendea/stream-to-m3u
- Owner: hmlendea
- License: gpl-3.0
- Created: 2019-05-01T23:07:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-06-23T14:00:08.000Z (about 1 year ago)
- Last Synced: 2026-02-08T20:34:53.657Z (6 months ago)
- Topics: iptv, m3u, m3u8
- Language: C#
- Homepage:
- Size: 184 KB
- Stars: 16
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://hmlendea.go.ro/fund.html) [](https://github.com/hmlendea/stream-to-m3u/actions/workflows/dotnet.yml)
# About
Tool for retrieving the M3U playlist URL for a given live stream
# Usage
The tool is used as just another console application.
Open a terminal and run the `SteamToM3U` executable, making sure that all the desired arguments are supplied.
# Configuration
The settings are supplied via CLI arguments
The following arguments are used to indicate the source of the stream
| Argument | Description |
|--------------------------------------------------------------|---------------------------------|
| --tvsporthd
--tvsport
--tvshd
--tvs | Sets the source to TV Sport HD |
| --antena-play
--antenaplay
--antena
--aplay
--ap | Sets the source to Antena Play |
| --streamlink
--sl | Sets the source to Streamlink |
If no source argument is provided, a generic solution will be attempted
Each source will require a different set of arugments to indicate the desired live stream, as follows
## TV Sport HD
| Argument | Description | Optional |
|-----------------|------------------------------|-----------|
| --channel
-c | The host channel ID | Mandatory |
## Streamlink
| Argument | Description | Optional |
|-------------|---------------------------------------------------|-----------|
| --url
-u | The URL of the page that contains the live stream | Mandatory |
## Antena Play
| Argument | Description | Optional |
|-----------------|------------------------------|-----------|
| --channel
-c | The host channel ID | Mandatory |
## Website
| Argument | Description | Optional |
|-------------|---------------------------------------------------|-----------|
| --url
-u | The URL of the page that contains the live stream | Mandatory |
## Running in background as a service
**Note:** The following instructions only apply for *Linux* distributions using *systemd*.
Create the following service file: /usr/lib/systemd/system/stream-to-m3u@.service
```
[Unit]
Description=Stream to M3U (%i channels)
[Service]
WorkingDirectory=[ABSOLUTE_PATH_TO_SERVICE_DIRECTORY]
ExecStart=[ABSOLUTE_PATH_TO_SERVICE_DIRECTORY]/StreamToM3U -i [ABSOLUTE_PATH_TO_SERVICE_DIRECTORY]/Data/input-%i.xml -O /srv/http/iptv/livestreams/%i -u http://mydomain.com/iptv
MemoryAccounting=yes
MemoryMax=256M
[Install]
WantedBy=multi-user.target
```
Create the following timer file: /lib/systemd/system/stream-to-m3u.timer
```
[Unit]
Description=Periodically creates an M3U playlist out of livestreams (%i channels)
[Timer]
OnBootSec=3min
OnUnitActiveSec=40min
[Install]
WantedBy=timers.target
```
Values that you might want to change:
- *OnBootSec*: the delay before the service is started after the OS is booted
- *OnUnitActiveSec*: how often the service will be triggered
- *MemoryMax*: RAM usage limit
In the above example, the service will start 3 minutes after boot, and then again once every 40 minutes, being allocated 256M RAM per instance