Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Utilities for downloading the EPG (Electronic Program Guide) for thousands of TV channels from hundreds of sources.

License

NotificationsYou must be signed in to change notification settings

iptv-org/epg

Repository files navigation

Tools for downloading the EPG (Electronic Program Guide) for thousands of TV channels from hundreds of sources.

Table of contents

Installation

First, you need to installNode.js on your computer. You will also need to installGit to follow these instructions.

After that open theConsole (orTerminal if you have macOS) and type the following command:

git clone --depth 1 -b master https://github.com/iptv-org/epg.git

Then navigate to the downloadedepg folder:

cd epg

And install all the dependencies:

npm install

Usage

To start the download of the guide, select one of the supported sites fromSITES.md file and paste its name into the command below:

npm run grab --- --site=example.com

Then run it and wait for the guide to finish downloading. When finished, a newguide.xml file will appear in the current directory.

You can also customize the behavior of the script using this options:

Usage: npm run grab --- [options]Options:  -s, --site<name>             Name of the site to parse  -c, --channels<path>         Path to*.channels.xml file (requiredif the"--site" attribute is                                not specified)  -o, --output<path>           Path to output file (default:"guide.xml")  -l, --lang<codes>            Allows you to restrict downloading to channelsin specified languages only (example:"en,id")  -t, --timeout<milliseconds>  Timeoutforeach requestin milliseconds (default: 0)  -d, --delay<milliseconds>    Delay between requestin milliseconds (default: 0)  -x, --proxy<url>             Use the specified proxy (example:"socks5://username:password@127.0.0.1:1234")  --days<days>                 Number of daysfor which the program will be loaded (defaults to the value from the site config)  --maxConnections<number>     Number of concurrent requests (default: 1)  --gzip                        Specifies whether or not to create a compressed version of the guide (default: false)

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:

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.

Use custom channel list

Create an XML file and copy the descriptions of all the channels you need from the/sites into it:

<?xml version="1.0" encoding="UTF-8"?><channels>  <channelsite="arirang.com"lang="en"xmltv_id="ArirangTV.kr"site_id="CH_K">Arirang TV</channel>  ...</channels>

And then specify the path to that file via the--channels attribute:

npm run grab --- --channels=path/to/custom.channels.xml

Run on schedule

To download the guide on a schedule, you can use the included process manager. Just run it with desirecron expression and thegrab options:

npx pm2 start npm --no-autorestart --cron-restart="0 0,12 * * *" -- run grab --- --site=example.com

To track the process, you can use the command:

npx pm2 logs

For more info go topm2 documentation.

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:

npx serve

After that, the guide will be available at the link:

http://localhost:3000/guide.xml

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

For more info go toserve documentation.

Update

If you have downloaded the repository code according to the instructions above, then to update it will be enough to run the command:

git pull

And then update all the dependencies:

npm install

Docker

Build an image

docker build -t iptv-org/epg --no-cache.

Create and run container

docker run -p 3000:3000 -v /path/to/channels.xml:/epg/channels.xml iptv-org/epg

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:

http://localhost:3000/guide.xml

or

http://<your_local_ip_address>:3000/guide.xml

Environment Variables

To fine-tune the execution, you can pass environment variables to the container as follows:

docker run \-p 5000:3000 \-v /path/to/channels.xml:/epg/channels.xml \-e CRON_SCHEDULE="0 0,12 * * *" \-e MAX_CONNECTIONS=10 \-e GZIP=true \-e PROXY="socks5://127.0.0.1:1234" \-e DAYS=14 \-e TIMEOUT=5 \-e DELAY=2 \iptv-org/epg
VariableDescription
CRON_SCHEDULEAcron expression describing the schedule of the guide loadings (default: "0 0 * * *")
MAX_CONNECTIONSLimit on the number of concurrent requests (default: 1)
GZIPBoolean value indicating whether to create a compressed version of the guide (default: false)
PROXYUse the specified proxy
DAYSNumber of days for which the guide will be loaded (defaults to the value from the site config)
TIMEOUTTimeout for each request in milliseconds (default: 0)
DELAYDelay between request in milliseconds (default: 0)

Database

All channel data is taken from theiptv-org/database repository. If you find any errors please open a newissue there.

API

The API documentation can be found in theiptv-org/api repository.

Resources

Links to other useful IPTV-related resources can be found in theiptv-org/awesome-iptv repository.

Discussions

If you have a question or an idea, you can post it in theDiscussions tab.

Contribution

Please make sure to read theContributing Guide before sendingissue or apull request.

And thank you to everyone who has already contributed!

Backers

Contributors

License

CC0

About

Utilities for downloading the EPG (Electronic Program Guide) for thousands of TV channels from hundreds of sources.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

    Languages


    [8]ページ先頭

    ©2009-2025 Movatter.jp