From 4c184e9cbe886cc18f4863121ca8660c59f0bc9d Mon Sep 17 00:00:00 2001
From: freearhey <7253922+freearhey@users.noreply.github.com>
Date: Thu, 30 Nov 2023 22:19:43 +0300
Subject: [PATCH] Update tv.trueid.net
---
sites/tv.trueid.net/readme.md | 21 ++
.../tv.trueid.net/tv.trueid.net.channels.xml | 228 +++++++++++-------
sites/tv.trueid.net/tv.trueid.net.config.js | 29 +++
sites/tv.trueid.net/tv.trueid.net.test.js | 2 -
4 files changed, 185 insertions(+), 95 deletions(-)
create mode 100644 sites/tv.trueid.net/readme.md
diff --git a/sites/tv.trueid.net/readme.md b/sites/tv.trueid.net/readme.md
new file mode 100644
index 00000000..e9361dc8
--- /dev/null
+++ b/sites/tv.trueid.net/readme.md
@@ -0,0 +1,21 @@
+# tv.trueid.net
+
+https://tv.trueid.net/
+
+### Download the guide
+
+```sh
+npm run grab -- --site=tv.trueid.net
+```
+
+### Update channel list
+
+```sh
+npm run channels:parse -- --config=./sites/tv.trueid.net/tv.trueid.net.config.js --output=./sites/tv.trueid.net/tv.trueid.net.channels.xml
+```
+
+### Test
+
+```sh
+npm test -- tv.trueid.net
+```
diff --git a/sites/tv.trueid.net/tv.trueid.net.channels.xml b/sites/tv.trueid.net/tv.trueid.net.channels.xml
index c929a3c6..4e80760c 100644
--- a/sites/tv.trueid.net/tv.trueid.net.channels.xml
+++ b/sites/tv.trueid.net/tv.trueid.net.channels.xml
@@ -1,93 +1,135 @@
-
-
- Amarin 34 HD
- Animal Planet HD
- Asian Food Network
- AXN HD
- BBC Earth HD
- BBC Lifestyle
- BBC World News HD
- BBTV Channel 7
- BeIn Sports 1 HD
- BeIn Sports 2 HD
- Cartoon Network
- CCTV
- Channel 3 HD
- Thai Channel 8
- CNBC
- CNN HD
- Crime + Investigation
- Discovery Asia
- Discovery Channel
- DreamWorks TV HD
- FashionTV
- Food Network HD
- Gem
- GMM 25
- History HD
- JKN 18
- KBS World
- KMTV HD
- Lifetime
- Love Nature
- MCOT HD
- Mono 29
- Motorvision TV
- Nation TV
- NBA TV
- NBT 2
- NHK World
- Nickelodeon
- Nick Jr HD
- One 31
- Outdoor Channel
- Paramount Network HD
- Phoenix InfoNews Channel
- PPTV HD 36
- Rama Channel
- Rock Entertainment
- Rock Extreme
- SpoTV 2
- Thai PBS 3
- Thairath TV 32
- Thai TV 5 HD1
- TLC HD
- TNN 16
- TNN 2
- True 4U
- True Asian More
- True Chinese More
- True Explore Life
- True Explore Sci
- True Explore Wild
- True Film HD
- True Film HD 2
- True Film Asia
- True Korean More
- True Movie Hits
- True Plookpanya
- True Premier Football 1
- True Premier Football 2
- True Premier Football 3
- True Premier Football 4
- True Premier Football 5
- True Select
- True Series
- True Shopping
- True Spark Jump
- True Spark Play
- TrueSport HD
- TrueSport HD 2
- TrueSport HD 3
- TrueSport HD 4
- TrueSport 5
- TrueSport 7
- True Tennis HD
- True Thai Film
- True X-Zyte
- TV5Monde Asie
- TVB Xing He
- TVN
- Warner TV HD
- Workpoint 23
-
+
+
+
+ Amarin TV
+ beIN SPORTS 1
+ beIN SPORTS 2
+ Channel 3
+ Channel 7HD
+ Channel 8
+ Crime + Investigation
+ GMM 25
+ JKN 18
+ 9 MCOT
+ MONO 29
+ Nation TV
+ NBT
+ One31
+ PPTV
+ SPOTV 2
+ Thai PBS
+ Thairath TV
+ TNN 2
+ True4U
+ True Explore Life
+ True Explore Sci
+ True Film 1
+ True Film 2
+ True Film Asia
+ True Movie Hits
+ True Premier Football 1
+ True Premier Football 2
+ True Premier Football 3
+ True Premier Football 4
+ True Premier Football 5
+ True Series
+ True Sports 2
+ True Sports 5
+ True Sports 7
+ True Thai Film
+ True X-Zyte
+ TV5 HD
+ WorkPoint TV
+
diff --git a/sites/tv.trueid.net/tv.trueid.net.config.js b/sites/tv.trueid.net/tv.trueid.net.config.js
index a8adb28f..5607dc18 100644
--- a/sites/tv.trueid.net/tv.trueid.net.config.js
+++ b/sites/tv.trueid.net/tv.trueid.net.config.js
@@ -27,6 +27,35 @@ module.exports = {
})
return programs
+ },
+ async channels({ token }) {
+ const axios = require('axios')
+
+ const ACCESS_TOKEN =
+ 'MTM4MDY0NGUwZjFmYjZiMTRjODI4OTRhMGM2ODJkMTQ3ZTAxNWM5ZDoxZmI2YjE0YzgyODk0YTBjNjgyZDE0N2UwMTVjOWQ='
+
+ const data = await axios
+ .get(`https://tv.trueid.net/api/channel/getChannelListByAllCate`, {
+ params: {
+ lang: 'en',
+ country: 'th'
+ },
+ headers: {
+ authorization: `Basic ${ACCESS_TOKEN}`
+ }
+ })
+ .then(r => r.data)
+ .catch(console.log)
+
+ return data.data.channelsList
+ .find(i => i.catSlug === 'TrueID : All')
+ .channels.map(item => {
+ return {
+ lang: 'th',
+ site_id: item.slug,
+ name: item.title
+ }
+ })
}
}
diff --git a/sites/tv.trueid.net/tv.trueid.net.test.js b/sites/tv.trueid.net/tv.trueid.net.test.js
index ebed99d7..f6834d01 100644
--- a/sites/tv.trueid.net/tv.trueid.net.test.js
+++ b/sites/tv.trueid.net/tv.trueid.net.test.js
@@ -1,5 +1,3 @@
-// NODE_OPTIONS=--insecure-http-parser npx epg-grabber --config=sites/tv.trueid.net/tv.trueid.net.config.js --channels=sites/tv.trueid.net/tv.trueid.net.channels.xml --output=guide.xml --timeout=30000 --days=2
-
const { parser, url } = require('./tv.trueid.net.config.js')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')