mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 19:06:58 -05:00
Merge pull request #2881 from iptv-org/freearhey-patch-4
Update README.md
This commit is contained in:
476
README.md
476
README.md
@@ -1,238 +1,238 @@
|
|||||||
# EPG [](https://github.com/iptv-org/epg/actions/workflows/update.yml)
|
# EPG [](https://github.com/iptv-org/epg/actions/workflows/update.yml)
|
||||||
|
|
||||||
Tools for downloading the EPG (Electronic Program Guide) for thousands of TV channels from hundreds of sources.
|
Tools for downloading the EPG (Electronic Program Guide) for thousands of TV channels from hundreds of sources.
|
||||||
|
|
||||||
## Table of contents
|
## Table of contents
|
||||||
|
|
||||||
- ✨ [Installation](#installation)
|
- ✨ [Installation](#installation)
|
||||||
- 🚀 [Usage](#usage)
|
- 🚀 [Usage](#usage)
|
||||||
- 💫 [Update](#update)
|
- 💫 [Update](#update)
|
||||||
- 🐋 [Docker](#docker)
|
- 🐋 [Docker](#docker)
|
||||||
- 📺 [Playlists](#playlists)
|
- 📺 [Playlists](#playlists)
|
||||||
- 🗄 [Database](#database)
|
- 🗄 [Database](#database)
|
||||||
- 👨💻 [API](#api)
|
- 👨💻 [API](#api)
|
||||||
- 📚 [Resources](#resources)
|
- 📚 [Resources](#resources)
|
||||||
- 💬 [Discussions](#discussions)
|
- 💬 [Discussions](#discussions)
|
||||||
- 🛠 [Contribution](#contribution)
|
- 🛠 [Contribution](#contribution)
|
||||||
- 📄 [License](#license)
|
- 📄 [License](#license)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
First, you need to install [Node.js](https://nodejs.org/en) on your computer. You will also need to install [Git](https://git-scm.com/downloads) to follow these instructions.
|
First, you need to install [Node.js](https://nodejs.org/en) on your computer. You will also need to install [Git](https://git-scm.com/downloads) to follow these instructions.
|
||||||
|
|
||||||
After that open the [Console](https://en.wikipedia.org/wiki/Windows_Console) (or [Terminal](<https://en.wikipedia.org/wiki/Terminal_(macOS)>) if you have macOS) and type the following command:
|
After that open the [Console](https://en.wikipedia.org/wiki/Windows_Console) (or [Terminal](<https://en.wikipedia.org/wiki/Terminal_(macOS)>) if you have macOS) and type the following command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone --depth 1 -b master https://github.com/iptv-org/epg.git
|
git clone --depth 1 -b master https://github.com/iptv-org/epg.git
|
||||||
```
|
```
|
||||||
|
|
||||||
Then navigate to the downloaded `epg` folder:
|
Then navigate to the downloaded `epg` folder:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd epg
|
cd epg
|
||||||
```
|
```
|
||||||
|
|
||||||
And install all the dependencies:
|
And install all the dependencies:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
To start the download of the guide, select one of the supported sites from [SITES.md](SITES.md) file and paste its name into the command below:
|
To start the download of the guide, select one of the supported sites from [SITES.md](SITES.md) file and paste its name into the command below:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm run grab --- --site=example.com
|
npm run grab --- --site=example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
Then run it and wait for the guide to finish downloading. When finished, a new `guide.xml` file will appear in the current directory.
|
Then run it and wait for the guide to finish downloading. When finished, a new `guide.xml` file will appear in the current directory.
|
||||||
|
|
||||||
You can also customize the behavior of the script using this options:
|
You can also customize the behavior of the script using this options:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
Usage: npm run grab --- [options]
|
Usage: npm run grab --- [options]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-s, --site <name> Name of the site to parse
|
-s, --site <name> Name of the site to parse
|
||||||
-c, --channels <path> Path to *.channels.xml file (required if the "--site" attribute is
|
-c, --channels <path> Path to *.channels.xml file (required if the "--site" attribute is
|
||||||
not specified)
|
not specified)
|
||||||
-o, --output <path> Path to output file (default: "guide.xml")
|
-o, --output <path> Path to output file (default: "guide.xml")
|
||||||
-l, --lang <codes> Allows you to restrict downloading to channels in specified languages only (example: "en,id")
|
-l, --lang <codes> Allows you to restrict downloading to channels in specified languages only (example: "en,id")
|
||||||
-t, --timeout <milliseconds> Timeout for each request in milliseconds (default: 0)
|
-t, --timeout <milliseconds> Timeout for each request in milliseconds (default: 0)
|
||||||
-d, --delay <milliseconds> Delay between request in milliseconds (default: 0)
|
-d, --delay <milliseconds> Delay between request in milliseconds (default: 0)
|
||||||
-x, --proxy <url> Use the specified proxy (example: "socks5://username:password@127.0.0.1:1234")
|
-x, --proxy <url> Use the specified proxy (example: "socks5://username:password@127.0.0.1:1234")
|
||||||
--days <days> Number of days for which the program will be loaded (defaults to the value from the site config)
|
--days <days> Number of days for which the program will be loaded (defaults to the value from the site config)
|
||||||
--maxConnections <number> Number of concurrent requests (default: 1)
|
--maxConnections <number> Number of concurrent requests (default: 1)
|
||||||
--gzip Specifies whether or not to create a compressed version of the guide (default: false)
|
--gzip Specifies whether or not to create a compressed version of the guide (default: false)
|
||||||
--curl Display each request as CURL (default: false)
|
--curl Display each request as CURL (default: false)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Parallel downloading
|
### Parallel downloading
|
||||||
|
|
||||||
By default, the guide for each channel is downloaded one by one, but you can change this behavior by increasing the number of simultaneous requests using the `--maxConnections` attribute:
|
By default, the guide for each channel is downloaded one by one, but you can change this behavior by increasing the number of simultaneous requests using the `--maxConnections` attribute:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm run grab --- --site=example.com --maxConnections=10
|
npm run grab --- --site=example.com --maxConnections=10
|
||||||
```
|
```
|
||||||
|
|
||||||
But be aware that under heavy load, some sites may start return an error or completely block your access.
|
But be aware that under heavy load, some sites may start return an error or completely block your access.
|
||||||
|
|
||||||
### Use custom channel list
|
### Use custom channel list
|
||||||
|
|
||||||
Create an XML file and copy the descriptions of all the channels you need from the [/sites](sites) into it:
|
Create an XML file and copy the descriptions of all the channels you need from the [/sites](sites) into it:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<channels>
|
<channels>
|
||||||
<channel site="arirang.com" lang="en" xmltv_id="ArirangTV.kr" site_id="CH_K">Arirang TV</channel>
|
<channel site="arirang.com" lang="en" xmltv_id="ArirangTV.kr" site_id="CH_K">Arirang TV</channel>
|
||||||
...
|
...
|
||||||
</channels>
|
</channels>
|
||||||
```
|
```
|
||||||
|
|
||||||
And then specify the path to that file via the `--channels` attribute:
|
And then specify the path to that file via the `--channels` attribute:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm run grab --- --channels=path/to/custom.channels.xml
|
npm run grab --- --channels=path/to/custom.channels.xml
|
||||||
```
|
```
|
||||||
|
|
||||||
### Run on schedule
|
### Run on schedule
|
||||||
|
|
||||||
If you want to download guides on a schedule, you can use [cron](https://en.wikipedia.org/wiki/Cron) or any other task scheduler. Currently, we use a tool called `chronos` for this purpose.
|
If you want to download guides on a schedule, you can use [cron](https://en.wikipedia.org/wiki/Cron) or any other task scheduler. Currently, we use a tool called `chronos` for this purpose.
|
||||||
|
|
||||||
To start it, you only need to specify the necessary `grab` command and [cron expression](https://crontab.guru/):
|
To start it, you only need to specify the necessary `grab` command and [cron expression](https://crontab.guru/):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npx chronos --execute="npm run grab --- --site=example.com" --pattern="0 0,12 * * *" --log
|
npx chronos --execute="npm run grab --- --site=example.com" --pattern="0 0,12 * * *" --log
|
||||||
```
|
```
|
||||||
|
|
||||||
For more info go to [chronos](https://github.com/freearhey/chronos) documentation.
|
For more info go to [chronos](https://github.com/freearhey/chronos) documentation.
|
||||||
|
|
||||||
### Access the guide by URL
|
### Access the guide by URL
|
||||||
|
|
||||||
You can make the guide available via URL by running your own server. The easiest way to do this is to run this command:
|
You can make the guide available via URL by running your own server. The easiest way to do this is to run this command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npx serve
|
npx serve
|
||||||
```
|
```
|
||||||
|
|
||||||
After that, the guide will be available at the link:
|
After that, the guide will be available at the link:
|
||||||
|
|
||||||
```
|
```
|
||||||
http://localhost:3000/guide.xml
|
http://localhost:3000/guide.xml
|
||||||
```
|
```
|
||||||
|
|
||||||
In addition it will be available to other devices on the same local network at the address:
|
In addition it will be available to other devices on the same local network at the address:
|
||||||
|
|
||||||
```
|
```
|
||||||
http://<your_local_ip_address>:3000/guide.xml
|
http://<your_local_ip_address>:3000/guide.xml
|
||||||
```
|
```
|
||||||
|
|
||||||
For more info go to [serve](https://github.com/vercel/serve) documentation.
|
For more info go to [serve](https://github.com/vercel/serve) documentation.
|
||||||
|
|
||||||
## Update
|
## Update
|
||||||
|
|
||||||
If you have downloaded the repository code according to the instructions above, then to update it will be enough to run the command:
|
If you have downloaded the repository code according to the instructions above, then to update it will be enough to run the command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git pull
|
git pull
|
||||||
```
|
```
|
||||||
|
|
||||||
And then update all the dependencies:
|
And then update all the dependencies:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
||||||
### Build an image
|
### Pull an image
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker build -t iptv-org/epg --no-cache .
|
docker pull ghcr.io/iptv-org/epg:master
|
||||||
```
|
```
|
||||||
|
|
||||||
### Create and run container
|
### Create and run container
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run -p 3000:3000 -v /path/to/channels.xml:/epg/channels.xml iptv-org/epg
|
docker run -p 3000:3000 -v /path/to/channels.xml:/epg/channels.xml ghcr.io/iptv-org/epg:master
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, the guide will be downloaded every day at 00:00 UTC and saved to the `/epg/public/guide.xml` file inside the container.
|
By default, the guide will be downloaded every day at 00:00 UTC and saved to the `/epg/public/guide.xml` file inside the container.
|
||||||
|
|
||||||
From the outside, it will be available at this link:
|
From the outside, it will be available at this link:
|
||||||
|
|
||||||
```
|
```
|
||||||
http://localhost:3000/guide.xml
|
http://localhost:3000/guide.xml
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
|
|
||||||
```
|
```
|
||||||
http://<your_local_ip_address>:3000/guide.xml
|
http://<your_local_ip_address>:3000/guide.xml
|
||||||
```
|
```
|
||||||
|
|
||||||
### Environment Variables
|
### Environment Variables
|
||||||
|
|
||||||
To fine-tune the execution, you can pass environment variables to the container as follows:
|
To fine-tune the execution, you can pass environment variables to the container as follows:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run \
|
docker run \
|
||||||
-p 5000:3000 \
|
-p 5000:3000 \
|
||||||
-v /path/to/channels.xml:/epg/channels.xml \
|
-v /path/to/channels.xml:/epg/channels.xml \
|
||||||
-e CRON_SCHEDULE="0 0,12 * * *" \
|
-e CRON_SCHEDULE="0 0,12 * * *" \
|
||||||
-e MAX_CONNECTIONS=10 \
|
-e MAX_CONNECTIONS=10 \
|
||||||
-e GZIP=true \
|
-e GZIP=true \
|
||||||
-e CURL=true \
|
-e CURL=true \
|
||||||
-e PROXY="socks5://127.0.0.1:1234" \
|
-e PROXY="socks5://127.0.0.1:1234" \
|
||||||
-e DAYS=14 \
|
-e DAYS=14 \
|
||||||
-e TIMEOUT=5 \
|
-e TIMEOUT=5 \
|
||||||
-e DELAY=2 \
|
-e DELAY=2 \
|
||||||
iptv-org/epg
|
iptv-org/epg
|
||||||
```
|
```
|
||||||
|
|
||||||
| Variable | Description |
|
| Variable | Description |
|
||||||
| --------------- | ------------------------------------------------------------------------------------------------------------------ |
|
| --------------- | ------------------------------------------------------------------------------------------------------------------ |
|
||||||
| CRON_SCHEDULE | A [cron expression](https://crontab.guru/) describing the schedule of the guide loadings (default: "0 0 \* \* \*") |
|
| CRON_SCHEDULE | A [cron expression](https://crontab.guru/) describing the schedule of the guide loadings (default: "0 0 \* \* \*") |
|
||||||
| MAX_CONNECTIONS | Limit on the number of concurrent requests (default: 1) |
|
| MAX_CONNECTIONS | Limit on the number of concurrent requests (default: 1) |
|
||||||
| GZIP | Boolean value indicating whether to create a compressed version of the guide (default: false) |
|
| GZIP | Boolean value indicating whether to create a compressed version of the guide (default: false) |
|
||||||
| CURL | Display each request as CURL (default: false) |
|
| CURL | Display each request as CURL (default: false) |
|
||||||
| PROXY | Use the specified proxy |
|
| PROXY | Use the specified proxy |
|
||||||
| DAYS | Number of days for which the guide will be loaded (defaults to the value from the site config) |
|
| DAYS | Number of days for which the guide will be loaded (defaults to the value from the site config) |
|
||||||
| TIMEOUT | Timeout for each request in milliseconds (default: 0) |
|
| TIMEOUT | Timeout for each request in milliseconds (default: 0) |
|
||||||
| DELAY | Delay between request in milliseconds (default: 0) |
|
| DELAY | Delay between request in milliseconds (default: 0) |
|
||||||
| RUN_AT_STARTUP | Run grab on container startup (default: true) |
|
| RUN_AT_STARTUP | Run grab on container startup (default: true) |
|
||||||
|
|
||||||
## Database
|
## Database
|
||||||
|
|
||||||
All channel data is taken from the [iptv-org/database](https://github.com/iptv-org/database) repository. If you find any errors please open a new [issue](https://github.com/iptv-org/database/issues) there.
|
All channel data is taken from the [iptv-org/database](https://github.com/iptv-org/database) repository. If you find any errors please open a new [issue](https://github.com/iptv-org/database/issues) there.
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
The API documentation can be found in the [iptv-org/api](https://github.com/iptv-org/api) repository.
|
The API documentation can be found in the [iptv-org/api](https://github.com/iptv-org/api) repository.
|
||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
Links to other useful IPTV-related resources can be found in the [iptv-org/awesome-iptv](https://github.com/iptv-org/awesome-iptv) repository.
|
Links to other useful IPTV-related resources can be found in the [iptv-org/awesome-iptv](https://github.com/iptv-org/awesome-iptv) repository.
|
||||||
|
|
||||||
## Discussions
|
## Discussions
|
||||||
|
|
||||||
If you have a question or an idea, you can post it in the [Discussions](https://github.com/orgs/iptv-org/discussions) tab.
|
If you have a question or an idea, you can post it in the [Discussions](https://github.com/orgs/iptv-org/discussions) tab.
|
||||||
|
|
||||||
## Contribution
|
## Contribution
|
||||||
|
|
||||||
Please make sure to read the [Contributing Guide](https://github.com/iptv-org/epg/blob/master/CONTRIBUTING.md) before sending [issue](https://github.com/iptv-org/epg/issues) or a [pull request](https://github.com/iptv-org/epg/pulls).
|
Please make sure to read the [Contributing Guide](https://github.com/iptv-org/epg/blob/master/CONTRIBUTING.md) before sending [issue](https://github.com/iptv-org/epg/issues) or a [pull request](https://github.com/iptv-org/epg/pulls).
|
||||||
|
|
||||||
And thank you to everyone who has already contributed!
|
And thank you to everyone who has already contributed!
|
||||||
|
|
||||||
### Backers
|
### Backers
|
||||||
|
|
||||||
<a href="https://opencollective.com/iptv-org"><img src="https://opencollective.com/iptv-org/backers.svg?width=890" /></a>
|
<a href="https://opencollective.com/iptv-org"><img src="https://opencollective.com/iptv-org/backers.svg?width=890" /></a>
|
||||||
|
|
||||||
### Contributors
|
### Contributors
|
||||||
|
|
||||||
<a href="https://github.com/iptv-org/epg/graphs/contributors"><img src="https://opencollective.com/iptv-org/contributors.svg?width=890" /></a>
|
<a href="https://github.com/iptv-org/epg/graphs/contributors"><img src="https://opencollective.com/iptv-org/contributors.svg?width=890" /></a>
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
|
|||||||
Reference in New Issue
Block a user