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存儲庫。
如果您有問題或想法,則可以在“討論”選項卡中發布。
在發送問題或拉請請求之前,請確保閱讀貢獻指南。
感謝所有已經做出貢獻的人!