epg
2023.12.1
从数百个来源下载数千个电视频道的EPG(电子程序指南)的工具。
首先,您需要在计算机上安装node.js。您还需要安装git才能遵循这些说明。
在此之后,打开控制台(或终端(如果您有MacOS))并键入以下命令:
git clone --depth 1 -b master https://github.com/iptv-org/epg.git
然后导航到下载的epg
文件夹:
cd epg
并安装所有依赖项:
npm install
要启动指南的下载,请选择一个受支持的站点之一,然后将其名称粘贴到下面的命令中:
npm run grab -- --site=example.com
并且一旦下载完成,将将指南保存到guide.xml
文件中。
Usage: npm run grab -- [options]
Options:
-s, --site < name > Name of the site to parse
-c, --channels < path > Path to * .channels.xml file (required if the " --site " attribute is
not specified)
-o, --output < path > Path to output file (default: " guide.xml " )
-l, --lang < code > Filter channels by language (ISO 639-2 code)
-t, --timeout < milliseconds > Override the default timeout for each request
-d, --delay < milliseconds > Override the default delay between request
--days < days > Override the number of days for which the program will be loaded
(defaults to the value from the site config)
--maxConnections < number > Limit on the number of concurrent requests (default: 1)
--cron < expression > Schedule a script run (example: " 0 0 * * * " )
--gzip Create a compressed version of the guide as well (default: false)
您可以通过运行自己的服务器通过URL提供指南:
npm run serve
之后,该指南将在链接上可用:
http://localhost:3000/guide.xml
此外,它将在地址的同一本地网络上的其他设备上使用:
http://<your_local_ip_address>:3000/guide.xml
默认情况下,每个频道的指南将被一个一个下载,但是您可以使用--maxConnections
属性增加同时请求的数量来更改此行为:
npm run grab -- --site=example.com --maxConnections=10
但是请注意,在重负载下,某些站点可能会开始返回错误或完全阻止您的访问。
创建一个XML文件,并将所需的所有渠道的描述从 /站点中复制到其中:
<? xml version = " 1.0 " encoding = " UTF-8 " ?>
< channels >
< channel site = " arirang.com " lang = " en " xmltv_id = " ArirangTV.kr " site_id = " CH_K " >Arirang TV</ channel >
...
</ channels >
然后通过--channels
属性指定该文件的路径:
npm run grab -- --channels=path/to/custom.channels.xml
如果您想按计划自动下载指南,则需要使用--cron
属性将有效的cron表达式传递给脚本:
npm run grab -- --site=example.com --cron= " 0 0 * * * "
如果您根据上面的说明下载了存储库代码,那么要更新它就足以运行命令:
git pull
然后更新所有依赖性:
npm install
具有已链接指南的播放列表可以在IPTV-ORG/IPTV存储库中找到。
所有频道数据均取自IPTV-ORG/数据库存储库。如果发现任何错误,请在那里打开新问题。
可以在IPTV-ORG/API存储库中找到API文档。
链接到其他有用的IPTV相关资源,请参见IPTV-ORG/Awesome-IPTV存储库。
如果您有问题或想法,则可以在“讨论”选项卡中发布。
在发送问题或拉请请求之前,请确保阅读贡献指南。
感谢所有已经做出贡献的人!