{"id":13549277,"url":"https://github.com/iptv-org/epg","last_synced_at":"2025-05-14T02:09:47.245Z","repository":{"id":142416400,"uuid":"347434932","full_name":"iptv-org/epg","owner":"iptv-org","description":"Utilities for downloading the EPG (Electronic Program Guide) for thousands of TV channels from hundreds of sources.","archived":false,"fork":false,"pushed_at":"2025-04-27T02:13:04.000Z","size":55533,"stargazers_count":2137,"open_issues_count":32,"forks_count":275,"subscribers_count":73,"default_branch":"master","last_synced_at":"2025-05-06T23:03:21.939Z","etag":null,"topics":["epg","guide","iptv","tv","xml"],"latest_commit_sha":null,"homepage":"https://iptv-org.github.io/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iptv-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":"iptv-org","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-03-13T17:30:07.000Z","updated_at":"2025-05-06T19:00:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"adf0312e-3e9c-43e5-8dd6-c92988832c79","html_url":"https://github.com/iptv-org/epg","commit_stats":{"total_commits":5981,"total_committers":102,"mean_commits":58.63725490196079,"dds":0.5057682661762247,"last_synced_commit":"d16a81e5a1a238f2098123d42e73d77439c70273"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iptv-org%2Fepg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iptv-org%2Fepg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iptv-org%2Fepg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iptv-org%2Fepg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iptv-org","download_url":"https://codeload.github.com/iptv-org/epg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253701907,"owners_count":21949895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["epg","guide","iptv","tv","xml"],"created_at":"2024-08-01T12:01:20.159Z","updated_at":"2025-05-14T02:09:47.227Z","avatar_url":"https://github.com/iptv-org.png","language":"HTML","readme":"# EPG [![update](https://github.com/iptv-org/epg/actions/workflows/update.yml/badge.svg)](https://github.com/iptv-org/epg/actions/workflows/update.yml)\r\n\r\nTools for downloading the EPG (Electronic Program Guide) for thousands of TV channels from hundreds of sources.\r\n\r\n## Table of contents\r\n\r\n- ✨ [Installation](#installation)\r\n- 🚀 [Usage](#usage)\r\n- 💫 [Update](#update)\r\n- 🐋 [Docker](#docker)\r\n- 📺 [Playlists](#playlists)\r\n- 🗄 [Database](#database)\r\n- 👨‍💻 [API](#api)\r\n- 📚 [Resources](#resources)\r\n- 💬 [Discussions](#discussions)\r\n- 🛠 [Contribution](#contribution)\r\n- 📄 [License](#license)\r\n\r\n## Installation\r\n\r\nFirst, 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.\r\n\r\nAfter that open the [Console](https://en.wikipedia.org/wiki/Windows_Console) (or [Terminal](\u003chttps://en.wikipedia.org/wiki/Terminal_(macOS)\u003e) if you have macOS) and type the following command:\r\n\r\n```sh\r\ngit clone --depth 1 -b master https://github.com/iptv-org/epg.git\r\n```\r\n\r\nThen navigate to the downloaded `epg` folder:\r\n\r\n```sh\r\ncd epg\r\n```\r\n\r\nAnd install all the dependencies:\r\n\r\n```sh\r\nnpm install\r\n```\r\n\r\n## Usage\r\n\r\nTo 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:\r\n\r\n```sh\r\nnpm run grab --- --site=example.com\r\n```\r\n\r\nThen run it and wait for the guide to finish downloading. When finished, a new `guide.xml` file will appear in the current directory.\r\n\r\nYou can also customize the behavior of the script using this options:\r\n\r\n```sh\r\nUsage: npm run grab --- [options]\r\n\r\nOptions:\r\n  -s, --site \u003cname\u003e             Name of the site to parse\r\n  -c, --channels \u003cpath\u003e         Path to *.channels.xml file (required if the \"--site\" attribute is\r\n                                not specified)\r\n  -o, --output \u003cpath\u003e           Path to output file (default: \"guide.xml\")\r\n  -l, --lang \u003ccodes\u003e            Allows you to restrict downloading to channels in specified languages only (example: \"en,id\")\r\n  -t, --timeout \u003cmilliseconds\u003e  Timeout for each request in milliseconds (default: 0)\r\n  -d, --delay \u003cmilliseconds\u003e    Delay between request in milliseconds (default: 0)\r\n  -x, --proxy \u003curl\u003e             Use the specified proxy (example: \"socks5://username:password@127.0.0.1:1234\")\r\n  --days \u003cdays\u003e                 Number of days for which the program will be loaded (defaults to the value from the site config)\r\n  --maxConnections \u003cnumber\u003e     Number of concurrent requests (default: 1)\r\n  --gzip                        Specifies whether or not to create a compressed version of the guide (default: false)\r\n```\r\n\r\n### Parallel downloading\r\n\r\nBy 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:\r\n\r\n```sh\r\nnpm run grab --- --site=example.com --maxConnections=10\r\n```\r\n\r\nBut be aware that under heavy load, some sites may start return an error or completely block your access.\r\n\r\n### Use custom channel list\r\n\r\nCreate an XML file and copy the descriptions of all the channels you need from the [/sites](sites) into it:\r\n\r\n```xml\r\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\r\n\u003cchannels\u003e\r\n  \u003cchannel site=\"arirang.com\" lang=\"en\" xmltv_id=\"ArirangTV.kr\" site_id=\"CH_K\"\u003eArirang TV\u003c/channel\u003e\r\n  ...\r\n\u003c/channels\u003e\r\n```\r\n\r\nAnd then specify the path to that file via the `--channels` attribute:\r\n\r\n```sh\r\nnpm run grab --- --channels=path/to/custom.channels.xml\r\n```\r\n\r\n### Run on schedule\r\n\r\nTo download the guide on a schedule, you can use the included process manager. Just run it with desire [cron expression](https://crontab.guru/) and the `grab` options:\r\n\r\n```sh\r\nnpx pm2 start npm --no-autorestart --cron-restart=\"0 0,12 * * *\" -- run grab --- --site=example.com\r\n```\r\n\r\nTo track the process, you can use the command:\r\n\r\n```sh\r\nnpx pm2 logs\r\n```\r\n\r\nFor more info go to [pm2](https://pm2.keymetrics.io/docs/usage/quick-start/) documentation.\r\n\r\n### Access the guide by URL\r\n\r\nYou can make the guide available via URL by running your own server. The easiest way to do this is to run this command:\r\n\r\n```sh\r\nnpx serve\r\n```\r\n\r\nAfter that, the guide will be available at the link:\r\n\r\n```\r\nhttp://localhost:3000/guide.xml\r\n```\r\n\r\nIn addition it will be available to other devices on the same local network at the address:\r\n\r\n```\r\nhttp://\u003cyour_local_ip_address\u003e:3000/guide.xml\r\n```\r\n\r\nFor more info go to [serve](https://github.com/vercel/serve) documentation.\r\n\r\n## Update\r\n\r\nIf you have downloaded the repository code according to the instructions above, then to update it will be enough to run the command:\r\n\r\n```sh\r\ngit pull\r\n```\r\n\r\nAnd then update all the dependencies:\r\n\r\n```sh\r\nnpm install\r\n```\r\n\r\n## Docker\r\n\r\n### Build an image\r\n\r\n```sh\r\ndocker build -t iptv-org/epg --no-cache .\r\n```\r\n\r\n### Create and run container\r\n\r\n```sh\r\ndocker run -p 3000:3000 -v /path/to/channels.xml:/epg/channels.xml iptv-org/epg\r\n```\r\n\r\nBy default, the guide will be downloaded every day at 00:00 UTC and saved to the `/epg/public/guide.xml` file inside the container.\r\n\r\nFrom the outside, it will be available at this link:\r\n\r\n```\r\nhttp://localhost:3000/guide.xml\r\n```\r\n\r\nor\r\n\r\n```\r\nhttp://\u003cyour_local_ip_address\u003e:3000/guide.xml\r\n```\r\n\r\n### Environment Variables\r\n\r\nTo fine-tune the execution, you can pass environment variables to the container as follows:\r\n\r\n```sh\r\ndocker run \\\r\n-p 5000:3000 \\\r\n-v /path/to/channels.xml:/epg/channels.xml \\\r\n-e CRON_SCHEDULE=\"0 0,12 * * *\" \\\r\n-e MAX_CONNECTIONS=10 \\\r\n-e GZIP=true \\\r\n-e PROXY=\"socks5://127.0.0.1:1234\" \\\r\n-e DAYS=14 \\\r\n-e TIMEOUT=5 \\\r\n-e DELAY=2 \\\r\niptv-org/epg\r\n```\r\n\r\n| Variable        | Description                                                                                                        |\r\n| --------------- | ------------------------------------------------------------------------------------------------------------------ |\r\n| CRON_SCHEDULE   | A [cron expression](https://crontab.guru/) describing the schedule of the guide loadings (default: \"0 0 \\* \\* \\*\") |\r\n| MAX_CONNECTIONS | Limit on the number of concurrent requests (default: 1)                                                            |\r\n| GZIP            | Boolean value indicating whether to create a compressed version of the guide (default: false)                      |\r\n| PROXY           | Use the specified proxy                                                                                            |\r\n| DAYS            | Number of days for which the guide will be loaded (defaults to the value from the site config)                     |\r\n| TIMEOUT         | Timeout for each request in milliseconds (default: 0)                                                              |\r\n| DELAY           | Delay between request in milliseconds (default: 0)                                                                 |\r\n\r\n## Database\r\n\r\nAll 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.\r\n\r\n## API\r\n\r\nThe API documentation can be found in the [iptv-org/api](https://github.com/iptv-org/api) repository.\r\n\r\n## Resources\r\n\r\nLinks to other useful IPTV-related resources can be found in the [iptv-org/awesome-iptv](https://github.com/iptv-org/awesome-iptv) repository.\r\n\r\n## Discussions\r\n\r\nIf you have a question or an idea, you can post it in the [Discussions](https://github.com/orgs/iptv-org/discussions) tab.\r\n\r\n## Contribution\r\n\r\nPlease 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).\r\n\r\nAnd thank you to everyone who has already contributed!\r\n\r\n### Backers\r\n\r\n\u003ca href=\"https://opencollective.com/iptv-org\"\u003e\u003cimg src=\"https://opencollective.com/iptv-org/backers.svg?width=890\" /\u003e\u003c/a\u003e\r\n\r\n### Contributors\r\n\r\n\u003ca href=\"https://github.com/iptv-org/epg/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/iptv-org/contributors.svg?width=890\" /\u003e\u003c/a\u003e\r\n\r\n## License\r\n\r\n[![CC0](http://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg)](LICENSE)\r\n","funding_links":["https://opencollective.com/iptv-org"],"categories":["HTML","xml"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiptv-org%2Fepg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiptv-org%2Fepg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiptv-org%2Fepg/lists"}