Update vidio.com
Updates vidio.com to use the JSON API instead of scraping HTML pages. Also adds several new channels. ```shell @leap0x7b ➜ /workspaces/epg (master) $ npm test --- vidio.com > test > cross-env TZ=Pacific/Nauru npx jest --runInBand vidio.com PASS sites/vidio.com/vidio.com.test.js ✓ can generate valid url (3 ms) ✓ can generate valid request headers (2 ms) ✓ can parse response (2 ms) ✓ can handle empty guide (1 ms) Test Suites: 1 passed, 1 total Tests: 4 passed, 4 total Snapshots: 0 total Time: 0.25 s, estimated 1 s Ran all test suites matching vidio.com. ``` ```shell @leap0x7b ➜ /workspaces/epg (master) $ npm run grab --- --site=vidio.com > grab > tsx scripts/commands/epg/grab.ts --site=vidio.com ◐ starting... 6:39:11 PM ℹ config: 6:39:11 PM output: guide.xml maxConnections: 1 gzip: false site: vidio.com ℹ loading channels... 6:39:11 PM ℹ found 57 channel(s) 6:39:11 PM ℹ run: 6:39:11 PM ℹ [1/114] vidio.com (id) - ABCAustralia.au - Jul 1, 2025 (33 programs) 6:39:12 PM ℹ [2/114] vidio.com (id) - ABCAustralia.au - Jul 2, 2025 (34 programs) 6:39:12 PM ℹ [3/114] vidio.com (id) - ZooMoo.sg - Jul 2, 2025 (87 programs) 6:39:12 PM ℹ [4/114] vidio.com (id) - ZooMoo.sg - Jul 1, 2025 (6 programs) 6:39:12 PM ℹ [5/114] vidio.com (id) - UChannel.id - Jul 2, 2025 (45 programs) 6:39:12 PM ℹ [6/114] vidio.com (id) - UChannel.id - Jul 1, 2025 (41 programs) 6:39:12 PM ℹ [7/114] vidio.com (id) - TVRINasional.id - Jul 2, 2025 (37 programs) 6:39:13 PM ℹ [8/114] vidio.com (id) - TVRINasional.id - Jul 1, 2025 (37 programs) 6:39:13 PM ℹ [9/114] vidio.com (id) - tvOne.id - Jul 2, 2025 (27 programs) 6:39:13 PM ℹ [10/114] vidio.com (id) - tvOne.id - Jul 1, 2025 (26 programs) 6:39:13 PM ℹ [11/114] vidio.com (id) - tvNAsia.hk - Jul 2, 2025 (20 programs) 6:39:13 PM ℹ [12/114] vidio.com (id) - tvNAsia.hk - Jul 1, 2025 (19 programs) 6:39:13 PM ℹ [13/114] vidio.com (id) - TV5MondeAsia.fr - Jul 2, 2025 (50 programs) 6:39:13 PM ℹ [14/114] vidio.com (id) - TV5MondeAsia.fr - Jul 1, 2025 (51 programs) 6:39:14 PM ℹ [15/114] vidio.com (id) - TransTV.id - Jul 2, 2025 (13 programs) 6:39:14 PM ℹ [16/114] vidio.com (id) - TransTV.id - Jul 1, 2025 (13 programs) 6:39:14 PM ℹ [17/114] vidio.com (id) - Trans7.id - Jul 2, 2025 (29 programs) 6:39:14 PM ℹ [18/114] vidio.com (id) - Trans7.id - Jul 1, 2025 (29 programs) 6:39:14 PM ℹ [19/114] vidio.com (id) - TawafTV.id - Jul 2, 2025 (7 programs) 6:39:14 PM ℹ [20/114] vidio.com (id) - TawafTV.id - Jul 1, 2025 (7 programs) 6:39:14 PM ℹ [21/114] vidio.com (id) - SPOTV.id - Jul 2, 2025 (10 programs) 6:39:14 PM ℹ [22/114] vidio.com (id) - SPOTV.id - Jul 1, 2025 (12 programs) 6:39:14 PM ℹ [23/114] vidio.com (id) - SPOTV2.id - Jul 2, 2025 (12 programs) 6:39:15 PM ℹ [24/114] vidio.com (id) - SPOTV2.id - Jul 1, 2025 (14 programs) 6:39:15 PM ℹ [25/114] vidio.com (id) - SCTV.id - Jul 2, 2025 (19 programs) 6:39:15 PM ℹ [26/114] vidio.com (id) - SCTV.id - Jul 1, 2025 (21 programs) 6:39:15 PM ℹ [27/114] vidio.com (id) - ROCKExtreme.sg - Jul 2, 2025 (15 programs) 6:39:15 PM ℹ [28/114] vidio.com (id) - ROCKExtreme.sg - Jul 1, 2025 (14 programs) 6:39:15 PM ℹ [29/114] vidio.com (id) - ROCKEntertainment.sg - Jul 2, 2025 (31 programs) 6:39:15 PM ℹ [30/114] vidio.com (id) - ROCKEntertainment.sg - Jul 1, 2025 (31 programs) 6:39:15 PM ℹ [31/114] vidio.com (id) - RajawaliTV.id - Jul 2, 2025 (28 programs) 6:39:16 PM ℹ [32/114] vidio.com (id) - RajawaliTV.id - Jul 1, 2025 (28 programs) 6:39:16 PM ℹ [33/114] vidio.com (id) - NusantaraTV.id - Jul 2, 2025 (25 programs) 6:39:16 PM ℹ [34/114] vidio.com (id) - NusantaraTV.id - Jul 1, 2025 (23 programs) 6:39:16 PM ℹ [35/114] vidio.com (id) - NHKWorldJapan.jp - Jul 2, 2025 (59 programs) 6:39:16 PM ℹ [36/114] vidio.com (id) - NHKWorldJapan.jp - Jul 1, 2025 (66 programs) 6:39:16 PM ℹ [37/114] vidio.com (id) - NBATV.us - Jul 2, 2025 (16 programs) 6:39:16 PM ℹ [38/114] vidio.com (id) - NBATV.us - Jul 1, 2025 (19 programs) 6:39:16 PM ℹ [39/114] vidio.com (id) - 7619 - Jul 2, 2025 (0 programs) 6:39:17 PM ℹ [40/114] vidio.com (id) - 7619 - Jul 1, 2025 (0 programs) 6:39:17 PM ℹ [41/114] vidio.com (id) - Moji.id - Jul 2, 2025 (17 programs) 6:39:17 PM ℹ [42/114] vidio.com (id) - Moji.id - Jul 1, 2025 (17 programs) 6:39:17 PM ℹ [43/114] vidio.com (id) - MetroTV.id - Jul 2, 2025 (49 programs) 6:39:17 PM ℹ [44/114] vidio.com (id) - MetroTV.id - Jul 1, 2025 (49 programs) 6:39:17 PM ℹ [45/114] vidio.com (id) - NET.id - Jul 2, 2025 (22 programs) 6:39:17 PM ℹ [46/114] vidio.com (id) - NET.id - Jul 1, 2025 (22 programs) 6:39:17 PM ℹ [47/114] vidio.com (id) - MakkahTV.sa - Jul 2, 2025 (0 programs) 6:39:17 PM ℹ [48/114] vidio.com (id) - MakkahTV.sa - Jul 1, 2025 (0 programs) 6:39:17 PM ℹ [49/114] vidio.com (id) - MagnaChannel.id - Jul 2, 2025 (0 programs) 6:39:17 PM ℹ [50/114] vidio.com (id) - MagnaChannel.id - Jul 1, 2025 (0 programs) 6:39:18 PM ℹ [51/114] vidio.com (id) - KompasTV.id - Jul 2, 2025 (24 programs) 6:39:18 PM ℹ [52/114] vidio.com (id) - KompasTV.id - Jul 1, 2025 (24 programs) 6:39:18 PM ℹ [53/114] vidio.com (id) - JTV.id - Jul 2, 2025 (42 programs) 6:39:18 PM ℹ [54/114] vidio.com (id) - JTV.id - Jul 1, 2025 (40 programs) 6:39:18 PM ℹ [55/114] vidio.com (id) - JPMTV.id - Jul 2, 2025 (33 programs) 6:39:18 PM ℹ [56/114] vidio.com (id) - JPMTV.id - Jul 1, 2025 (33 programs) 6:39:18 PM ℹ [57/114] vidio.com (id) - JakTV.id - Jul 2, 2025 (28 programs) 6:39:18 PM ℹ [58/114] vidio.com (id) - JakTV.id - Jul 1, 2025 (28 programs) 6:39:19 PM ℹ [59/114] vidio.com (id) - Indosiar.id - Jul 2, 2025 (16 programs) 6:39:19 PM ℹ [60/114] vidio.com (id) - Indosiar.id - Jul 1, 2025 (16 programs) 6:39:19 PM ℹ [61/114] vidio.com (id) - Horee.id - Jul 2, 2025 (61 programs) 6:39:19 PM ℹ [62/114] vidio.com (id) - Horee.id - Jul 1, 2025 (61 programs) 6:39:19 PM ℹ [63/114] vidio.com (id) - HipHipHoree.id - Jul 2, 2025 (61 programs) 6:39:19 PM ℹ [64/114] vidio.com (id) - HipHipHoree.id - Jul 1, 2025 (61 programs) 6:39:20 PM ℹ [65/114] vidio.com (id) - 18105 - Jul 2, 2025 (0 programs) 6:39:20 PM ℹ [66/114] vidio.com (id) - 18105 - Jul 1, 2025 (0 programs) 6:39:20 PM ℹ [67/114] vidio.com (id) - EuronewsEnglish.fr - Jul 2, 2025 (80 programs) 6:39:20 PM ℹ [68/114] vidio.com (id) - EuronewsEnglish.fr - Jul 1, 2025 (80 programs) 6:39:20 PM ℹ [69/114] vidio.com (id) - ElshintaTV.id - Jul 2, 2025 (34 programs) 6:39:20 PM ℹ [70/114] vidio.com (id) - ElshintaTV.id - Jul 1, 2025 (34 programs) 6:39:20 PM ℹ [71/114] vidio.com (id) - DW.de@English - Jul 2, 2025 (17 programs) 6:39:21 PM ℹ [72/114] vidio.com (id) - DW.de@English - Jul 1, 2025 (46 programs) 6:39:21 PM ℹ [73/114] vidio.com (id) - DaystarTV.us - Jul 2, 2025 (45 programs) 6:39:21 PM ℹ [74/114] vidio.com (id) - DaystarTV.us - Jul 1, 2025 (45 programs) 6:39:21 PM ℹ [75/114] vidio.com (id) - DAAITV.id - Jul 2, 2025 (35 programs) 6:39:21 PM ℹ [76/114] vidio.com (id) - DAAITV.id - Jul 1, 2025 (35 programs) 6:39:21 PM ℹ [77/114] vidio.com (id) - CNA.sg - Jul 2, 2025 (24 programs) 6:39:21 PM ℹ [78/114] vidio.com (id) - CNA.sg - Jul 1, 2025 (24 programs) 6:39:22 PM ℹ [79/114] vidio.com (id) - 18190 - Jul 2, 2025 (9 programs) 6:39:22 PM ℹ [80/114] vidio.com (id) - 18190 - Jul 1, 2025 (8 programs) 6:39:22 PM ℹ [81/114] vidio.com (id) - 18189 - Jul 2, 2025 (12 programs) 6:39:22 PM ℹ [82/114] vidio.com (id) - 18189 - Jul 1, 2025 (10 programs) 6:39:22 PM ℹ [83/114] vidio.com (id) - ChampionsTVEPL.id - Jul 2, 2025 (36 programs) 6:39:22 PM ℹ [84/114] vidio.com (id) - ChampionsTVEPL.id - Jul 1, 2025 (35 programs) 6:39:22 PM ℹ [85/114] vidio.com (id) - ChampionsTV6.id - Jul 2, 2025 (14 programs) 6:39:22 PM ℹ [86/114] vidio.com (id) - ChampionsTV6.id - Jul 1, 2025 (18 programs) 6:39:22 PM ℹ [87/114] vidio.com (id) - ChampionsTV5.id - Jul 2, 2025 (19 programs) 6:39:22 PM ℹ [88/114] vidio.com (id) - ChampionsTV5.id - Jul 1, 2025 (19 programs) 6:39:23 PM ℹ [89/114] vidio.com (id) - ChampionsTV3.id - Jul 2, 2025 (15 programs) 6:39:23 PM ℹ [90/114] vidio.com (id) - ChampionsTV3.id - Jul 1, 2025 (17 programs) 6:39:23 PM ℹ [91/114] vidio.com (id) - ChampionsTV2.id - Jul 2, 2025 (22 programs) 6:39:23 PM ℹ [92/114] vidio.com (id) - ChampionsTV2.id - Jul 1, 2025 (18 programs) 6:39:23 PM ℹ [93/114] vidio.com (id) - ChampionsTV1.id - Jul 2, 2025 (13 programs) 6:39:24 PM ℹ [94/114] vidio.com (id) - ChampionsTV1.id - Jul 1, 2025 (12 programs) 6:39:24 PM ℹ [95/114] vidio.com (id) - BTV.id - Jul 2, 2025 (30 programs) 6:39:24 PM ℹ [96/114] vidio.com (id) - BTV.id - Jul 1, 2025 (33 programs) 6:39:24 PM ℹ [97/114] vidio.com (id) - BeritaSatuEnglish.id - Jul 2, 2025 (28 programs) 6:39:24 PM ℹ [98/114] vidio.com (id) - BeritaSatuEnglish.id - Jul 1, 2025 (25 programs) 6:39:24 PM ℹ [99/114] vidio.com (id) - beINSports3.qa@Indonesia - Jul 2, 2025 (16 programs) 6:39:24 PM ℹ [100/114] vidio.com (id) - beINSports3.qa@Indonesia - Jul 1, 2025 (13 programs) 6:39:25 PM ℹ [101/114] vidio.com (id) - 17875 - Jul 2, 2025 (17 programs) 6:39:25 PM ℹ [102/114] vidio.com (id) - 17875 - Jul 1, 2025 (17 programs) 6:39:25 PM ℹ [103/114] vidio.com (id) - beINSports1.qa@Indonesia - Jul 2, 2025 (28 programs) 6:39:25 PM ℹ [104/114] vidio.com (id) - beINSports1.qa@Indonesia - Jul 1, 2025 (21 programs) 6:39:25 PM ℹ [105/114] vidio.com (id) - ArirangWorld.kr - Jul 2, 2025 (60 programs) 6:39:25 PM ℹ [106/114] vidio.com (id) - ArirangWorld.kr - Jul 1, 2025 (54 programs) 6:39:25 PM ℹ [107/114] vidio.com (id) - ANTV.id - Jul 2, 2025 (15 programs) 6:39:25 PM ℹ [108/114] vidio.com (id) - ANTV.id - Jul 1, 2025 (15 programs) 6:39:25 PM ℹ [109/114] vidio.com (id) - AlJazeera.qa@English - Jul 2, 2025 (41 programs) 6:39:26 PM ℹ [110/114] vidio.com (id) - AlJazeera.qa@English - Jul 1, 2025 (41 programs) 6:39:26 PM ℹ [111/114] vidio.com (id) - AjwaTV.id - Jul 2, 2025 (26 programs) 6:39:26 PM ℹ [112/114] vidio.com (id) - AjwaTV.id - Jul 1, 2025 (25 programs) 6:39:26 PM ℹ [113/114] vidio.com (id) - AfricanewsEnglish.fr - Jul 2, 2025 (148 programs) 6:39:26 PM ℹ [114/114] vidio.com (id) - AfricanewsEnglish.fr - Jul 1, 2025 (147 programs) 6:39:27 PM ℹ saving to "guide.xml"... 6:39:27 PM ✔ done in 00h 00m 15s 6:39:27 PM ```
This commit is contained in:
1 parent
a74baa3350
commit
e245d56e28
6 files changed
+121
-117
No files matched your search
@@ -0,0 +1 @@
|
||||
{"api_key":"eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InR5cGUiOiJhcGlrZXkifSwiZXhwIjoxNzUxNDc4MDQ2fQ.kxcPR76NBdQYIrsUnmBpqzcSmPD-H7b_-I_SjFi1zY4","api_key_expires_at":"2025-07-03T00:40:46+07:00"}
|
||||
@@ -0,0 +1 @@
|
||||
{"data":[{"id":"4389878","type":"schedule","attributes":{"title":"Ftv PrimeTime : Cinta Dodol Inilah Yang Membuatku Lengket Padamu","start_time":"2025-06-30T22:57:00+07:00","end_time":"2025-07-01T00:29:00+07:00","state":"replayable","description":"Film televisi yang mengangkat kisah romantisme kehidupan dengan konflik yang menarik. tayang setiap hari","image_landscape_url":"https://thumbor.prod.vidiocdn.com/X1Jifsdsbcup7OiK9hkskCy_pbs=/287x162/filters:strip_icc():quality(70)/vidio-web-prod-livestreaming/uploads/livestreaming/image/204/sctv-f23abc.jpg"},"relationships":{"video":{"data":{"id":"8796735","type":"video"}}}},{"id":"4391225","type":"schedule","attributes":{"title":"FTV UTAMA \"REMBULAN DI KANDANG SAPI\"","start_time":"2025-07-01T00:30:00+07:00","end_time":"2025-07-01T01:30:00+07:00","state":"replayable","description":"Film televisi yang mengangkat kisah romantisme kehidupan dengan konflik yang menarik.","image_landscape_url":"https://thumbor.prod.vidiocdn.com/X1Jifsdsbcup7OiK9hkskCy_pbs=/287x162/filters:strip_icc():quality(70)/vidio-web-prod-livestreaming/uploads/livestreaming/image/204/sctv-f23abc.jpg"},"relationships":{"video":{"data":{"id":"8796793","type":"video"}}}},{"id":"4391226","type":"schedule","attributes":{"title":"Solusi","start_time":"2025-07-01T01:30:00+07:00","end_time":"2025-07-01T02:00:00+07:00","state":"replayable","description":"-","image_landscape_url":"https://thumbor.prod.vidiocdn.com/X1Jifsdsbcup7OiK9hkskCy_pbs=/287x162/filters:strip_icc():quality(70)/vidio-web-prod-livestreaming/uploads/livestreaming/image/204/sctv-f23abc.jpg"},"relationships":{"video":{"data":{"id":"8796823","type":"video"}}}},{"id":"4391227","type":"schedule","attributes":{"title":"Buser","start_time":"2025-07-01T02:00:00+07:00","end_time":"2025-07-01T02:30:00+07:00","state":"replayable","description":"-","image_landscape_url":"https://thumbor.prod.vidiocdn.com/X1Jifsdsbcup7OiK9hkskCy_pbs=/287x162/filters:strip_icc():quality(70)/vidio-web-prod-livestreaming/uploads/livestreaming/image/204/sctv-f23abc.jpg"},"relationships":{"video":{"data":{"id":"8796853","type":"video"}}}},{"id":"4391228","type":"schedule","attributes":{"title":"Sinema Dini Hari Babysitter Macho","start_time":"2025-07-01T02:30:00+07:00","end_time":"2025-07-01T03:00:00+07:00","state":"replayable","description":"Film televisi yang mengangkat kisah romantisme kehidupan dengan konflik yang menarik.","image_landscape_url":"https://thumbor.prod.vidiocdn.com/X1Jifsdsbcup7OiK9hkskCy_pbs=/287x162/filters:strip_icc():quality(70)/vidio-web-prod-livestreaming/uploads/livestreaming/image/204/sctv-f23abc.jpg"},"relationships":{"video":{"data":{"id":"8796878","type":"video"}}}},{"id":"4391324","type":"schedule","attributes":{"title":"Sinetron Dini Hari: Cinta Karena Cinta","start_time":"2025-07-01T03:30:00+07:00","end_time":"2025-07-01T04:00:00+07:00","state":"replayable","description":"Jenar sebelumnya mengira bahwa Mila, kakaknya, tewas dalam sebuah insiden kebakaran 15 tahun lalu. Namun, takdir berkata lain. Gadis tersebut ternyata masih hidup dan diadopsi oleh Ayu. Ia kemudian bertekad untuk pergi mencarinya.","image_landscape_url":"https://thumbor.prod.vidiocdn.com/X1Jifsdsbcup7OiK9hkskCy_pbs=/287x162/filters:strip_icc():quality(70)/vidio-web-prod-livestreaming/uploads/livestreaming/image/204/sctv-f23abc.jpg"},"relationships":{"video":{"data":{"id":"8796943","type":"video"}}}},{"id":"4391229","type":"schedule","attributes":{"title":"Barakallah","start_time":"2025-07-01T04:00:00+07:00","end_time":"2025-07-01T04:23:00+07:00","state":"replayable","description":"Ceramah islami penuh makna. Tayang setiap Selasa-Minggu pukul 04.00 WIB","image_landscape_url":"https://thumbor.prod.vidiocdn.com/X1Jifsdsbcup7OiK9hkskCy_pbs=/287x162/filters:strip_icc():quality(70)/vidio-web-prod-livestreaming/uploads/livestreaming/image/204/sctv-f23abc.jpg"},"relationships":{"video":{"data":{"id":"8796957","type":"video"}}}},{"id":"4391230","type":"schedule","attributes":{"title":"Liputan 6 Pagi - Live","start_time":"2025-07-01T04:30:00+07:00","end_time":"2025-07-01T06:00:00+07:00","state":"replayable","description":"Mengulas berita terkini yang aktual dan terpercaya. Tayang setiap hari pukul 04.24 WIB","image_landscape_url":"https://thumbor.prod.vidiocdn.com/TU0JVjSw8srrF_L7wqEtyaKj63A=/287x162/filters:strip_icc():quality(70)/vidio-media-production/uploads/tv_program/thumbnail/382358/3bec7e.jpg"},"relationships":{"video":{"data":{"id":"8797080","type":"video"}}}},{"id":"4391231","type":"schedule","attributes":{"title":"Hot Shot","start_time":"2025-07-01T06:00:00+07:00","end_time":"2025-07-01T07:00:00+07:00","state":"replayable","description":"-","image_landscape_url":"https://thumbor.prod.vidiocdn.com/X1Jifsdsbcup7OiK9hkskCy_pbs=/287x162/filters:strip_icc():quality(70)/vidio-web-prod-livestreaming/uploads/livestreaming/image/204/sctv-f23abc.jpg"},"relationships":{"video":{"data":{"id":"8797147","type":"video"}}}},{"id":"4391232","type":"schedule","attributes":{"title":"GasLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"errors":[{"detail":"Livestreaming not found"}]}
|
||||
@@ -2,12 +2,14 @@
|
||||
<channels>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="ABCAustralia.au" site_id="7150">ABC Australia</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="AfricanewsEnglish.fr" site_id="12784">AFRICANEWS TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="AjwaTV.id" site_id="7464">Ajwa TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="AlJazeera.qa@English" site_id="6410">Aljazeera</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="ANTV.id" site_id="782">ANTV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="ArirangWorld.kr" site_id="6784">Arirang</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="beINSports1.qa@Indonesia" site_id="6299">Bein 1</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="" site_id="17875">Bein 2</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="beINSports3.qa@Indonesia" site_id="6317">Bein 3</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="BeritaSatuEnglish.id" site_id="18280">BeritaSatu</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="BTV.id" site_id="6165">BTV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="ChampionsTV1.id" site_id="6685">CTV 1</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="ChampionsTV2.id" site_id="6686">CTV 2</channel>
|
||||
@@ -15,36 +17,44 @@
|
||||
<channel site="vidio.com" lang="id" xmltv_id="ChampionsTV5.id" site_id="9182">CTV 5</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="ChampionsTV6.id" site_id="9183">CTV 6</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="ChampionsTVEPL.id" site_id="9353">Premier League TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="" site_id="18189">Champions Golf 1</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="" site_id="18190">Champions Golf 2</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="CNA.sg" site_id="6411">News Asia</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="DAAITV.id" site_id="6482">DAAI TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="DaystarTV.us" site_id="18622">Daystar TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="DW.de@English" site_id="5075">DW English</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="ElshintaTV.id" site_id="10975">Elshinta TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="EuronewsEnglish.fr" site_id="6412">Euro News</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="" site_id="18105">GGS TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="HipHipHoree.id" site_id="7052">Hip Hip Horee!</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="Horee.id" site_id="6397">Horee</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="Indosiar.id" site_id="205">Indosiar</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="JakTV.id" site_id="5415">Jaktv</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="JPMTV.id" site_id="9714">jawaposTV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="JTV.id" site_id="9713">JTV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="KompasTV.id" site_id="874">Kompas TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="MagnaChannel.id" site_id="7230">Magna TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="MetroGlobeNetwork.id" site_id="8815">Metro Globe Network</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="MakkahTV.sa" site_id="6852">Makkah TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="NET.id" site_id="875">MDTV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="MetroTV.id" site_id="777">Metro TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="Moji.id" site_id="206">Moji</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="" site_id="7619">MUSICA</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="NBATV.us" site_id="6717">NBA TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="NET.id" site_id="875">NET TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="NHKWorldJapan.jp" site_id="7968">NHK World Japan</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="NusantaraTV.id" site_id="7432">Nusantara TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="RajawaliTV.id" site_id="1561">RTV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="RANSEntertainment.id" site_id="8241">RANS Channel</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="ROCKEntertainment.sg" site_id="8120">ROCK Entertainment</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="ROCKExtreme.sg" site_id="8121">Rock Action</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="SCTV.id" site_id="204">SCTV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="SEAToday.id" site_id="7687">SEA TODAY</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="SPOTV2.id" site_id="17140">SPOTV 2</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="SPOTV.id" site_id="17139">SPOTV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="TawafTV.id" site_id="12607">Tawaf TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="Trans7.id" site_id="734">Trans7</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="TransTV.id" site_id="733">TRANS TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="TV5MondeAsia.fr" site_id="17278">TV5Monde</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="tvNAsia.hk" site_id="6362">TVN</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="tvOne.id" site_id="783">TVOne</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="TVRINasional.id" site_id="6441">TVRI</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="TVRI.id" site_id="6441">TVRI</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="UChannel.id" site_id="6898">U-Channel TV</channel>
|
||||
<channel site="vidio.com" lang="id" xmltv_id="ZooMoo.sg" site_id="6533">Zoomoo</channel>
|
||||
</channels>
|
||||
@@ -1,112 +1,89 @@
|
||||
const cheerio = require('cheerio')
|
||||
const axios = require('axios')
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
const timezone = require('dayjs/plugin/timezone')
|
||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
const crypto = require('crypto')
|
||||
|
||||
dayjs.extend(utc)
|
||||
dayjs.extend(timezone)
|
||||
dayjs.extend(customParseFormat)
|
||||
|
||||
const tz = 'Asia/Jakarta'
|
||||
const WEB_CLIENT_SECRET = Buffer.from('dPr0QImQ7bc5o9LMntNba2DOsSbZcjUh')
|
||||
const WEB_CLIENT_IV = Buffer.from('C8RWsrtFsoeyCyPt')
|
||||
|
||||
module.exports = {
|
||||
site: 'vidio.com',
|
||||
days: 2,
|
||||
url({ channel }) {
|
||||
return `https://www.vidio.com/live/${channel.site_id}/schedules`
|
||||
url({ date, channel }) {
|
||||
return `https://api.vidio.com/livestreamings/${channel.site_id}/schedules?filter[date]=${date.format('YYYY-MM-DD')}`
|
||||
},
|
||||
parser({ content, date }) {
|
||||
request: {
|
||||
async headers() {
|
||||
const session = await loadSessionDetails()
|
||||
if (!session || !session.api_key) return null
|
||||
|
||||
var cipher = crypto.createCipheriv('aes-256-cbc', WEB_CLIENT_SECRET, WEB_CLIENT_IV)
|
||||
return {
|
||||
'X-API-Key': cipher.update(session.api_key, 'utf8', 'base64') + cipher.final('base64'),
|
||||
'X-Secure-Level': 2
|
||||
}
|
||||
}
|
||||
},
|
||||
parser({ content }) {
|
||||
const programs = []
|
||||
const items = parseItems(content, date)
|
||||
items.forEach(item => {
|
||||
const prev = programs[programs.length - 1]
|
||||
const $item = cheerio.load(item)
|
||||
let start = parseStart($item, date)
|
||||
if (prev && start < prev.start) {
|
||||
start = start.add(1, 'd')
|
||||
date = date.add(1, 'd')
|
||||
const json = JSON.parse(content)
|
||||
if (Array.isArray(json?.data)) {
|
||||
for (const program of json.data) {
|
||||
programs.push({
|
||||
title: program.attributes.title,
|
||||
description: program.attributes.description,
|
||||
start: dayjs(program.attributes.start_time),
|
||||
stop: dayjs(program.attributes.end_time),
|
||||
image: program.attributes.image_landscape_url
|
||||
})
|
||||
}
|
||||
let stop = parseStop($item, date)
|
||||
if (stop < start) {
|
||||
stop = stop.add(1, 'd')
|
||||
date = date.add(1, 'd')
|
||||
}
|
||||
programs.push({
|
||||
title: parseTitle($item),
|
||||
start,
|
||||
stop
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
return programs
|
||||
},
|
||||
async channels() {
|
||||
const axios = require('axios')
|
||||
const cheerio = require('cheerio')
|
||||
const result = await axios
|
||||
.get('https://www.vidio.com/categories/daftar-channel-tv-radio-live-sports')
|
||||
const channels = []
|
||||
const json = await axios
|
||||
.get(
|
||||
'https://api.vidio.com/livestreamings?stream_type=tv_stream',
|
||||
{
|
||||
headers: await this.request.headers()
|
||||
}
|
||||
)
|
||||
.then(response => response.data)
|
||||
.catch(console.error)
|
||||
|
||||
const $ = cheerio.load(result)
|
||||
const itemGroups = $('div[data-variation="circle_horizontal"] ul').toArray()
|
||||
const channels = []
|
||||
|
||||
itemGroups.forEach(group => {
|
||||
const $group = $(group)
|
||||
let skip = false
|
||||
const sites = []
|
||||
const items = $group.find('a[data-testid="circle-card"]').toArray()
|
||||
items.forEach(item => {
|
||||
const name = $(item).find('span[data-testid="circle-title"]').text()
|
||||
// skip radio channels
|
||||
if (name.toLowerCase().indexOf('fm') >= 0 || name.toLowerCase().indexOf('radio') >= 0) {
|
||||
skip = true
|
||||
return true
|
||||
}
|
||||
let url = $(item).attr('href')
|
||||
url = url.substr(url.lastIndexOf('/') + 1)
|
||||
const matches = url.match(/(\d+)/)
|
||||
sites.push({
|
||||
if (Array.isArray(json?.data)) {
|
||||
for (const channel of json.data) {
|
||||
channels.push({
|
||||
lang: 'id',
|
||||
site_id: matches[0],
|
||||
name: name
|
||||
site_id: channel.id,
|
||||
name: channel.attributes.title
|
||||
})
|
||||
})
|
||||
if (!skip && sites.length) {
|
||||
channels.push(...sites)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return channels
|
||||
}
|
||||
}
|
||||
|
||||
function parseStart($item, date) {
|
||||
const timeString = $item('div.b-livestreaming-daily-schedule__item-content-caption').text()
|
||||
const [, start] = timeString.match(/(\d{2}:\d{2}) -/) || [null, null]
|
||||
|
||||
return dayjs.tz(`${date.format('YYYY-MM-DD')} ${start}`, 'YYYY-MM-DD HH:mm', tz)
|
||||
}
|
||||
|
||||
function parseStop($item, date) {
|
||||
const timeString = $item('div.b-livestreaming-daily-schedule__item-content-caption').text()
|
||||
const [, stop] = timeString.match(/- (\d{2}:\d{2}) WIB/) || [null, null]
|
||||
|
||||
return dayjs.tz(`${date.format('YYYY-MM-DD')} ${stop}`, 'YYYY-MM-DD HH:mm', tz)
|
||||
}
|
||||
|
||||
function parseTitle($item) {
|
||||
return $item('div.b-livestreaming-daily-schedule__item-content-title').text()
|
||||
}
|
||||
|
||||
function parseItems(content, date) {
|
||||
const $ = cheerio.load(content)
|
||||
|
||||
return $(
|
||||
`#schedule-content-${date.format(
|
||||
'YYYYMMDD'
|
||||
)} > .b-livestreaming-daily-schedule__scroll-container .b-livestreaming-daily-schedule__item`
|
||||
).toArray()
|
||||
}
|
||||
function loadSessionDetails() {
|
||||
return axios
|
||||
.post(
|
||||
'https://www.vidio.com/auth',
|
||||
{},
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}
|
||||
)
|
||||
.then(r => r.data)
|
||||
.catch(console.log)
|
||||
}
|
||||
@@ -1,53 +1,67 @@
|
||||
const { parser, url } = require('./vidio.com.config.js')
|
||||
const { parser, url, request } = require('./vidio.com.config.js')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const axios = require('axios')
|
||||
const dayjs = require('dayjs')
|
||||
const utc = require('dayjs/plugin/utc')
|
||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
|
||||
dayjs.extend(customParseFormat)
|
||||
dayjs.extend(utc)
|
||||
|
||||
const date = dayjs.utc('2021-11-24', 'YYYY-MM-DD').startOf('d')
|
||||
jest.mock('axios')
|
||||
|
||||
const date = dayjs.utc('2025-07-01', 'YYYY-MM-DD').startOf('d')
|
||||
const channel = {
|
||||
site_id: '7464',
|
||||
xmltv_id: 'AjwaTV.id'
|
||||
site_id: '204',
|
||||
xmltv_id: 'SCTV.id'
|
||||
}
|
||||
|
||||
it('can generate valid url', () => {
|
||||
expect(url({ channel })).toBe('https://www.vidio.com/live/7464/schedules')
|
||||
expect(url({ channel, date })).toBe(
|
||||
'https://api.vidio.com/livestreamings/204/schedules?filter[date]=2025-07-01'
|
||||
)
|
||||
})
|
||||
|
||||
it('can generate valid request headers', async () => {
|
||||
axios.post.mockImplementation(url => {
|
||||
if (url === 'https://www.vidio.com/auth') {
|
||||
return Promise.resolve({
|
||||
data: JSON.parse(fs.readFileSync(path.resolve(__dirname, '__data__/auth.json')))
|
||||
})
|
||||
} else {
|
||||
return Promise.resolve({ data: '' })
|
||||
}
|
||||
})
|
||||
|
||||
const result = await request.headers()
|
||||
expect(result).toMatchObject({
|
||||
'X-API-Key':
|
||||
'CH1ZFsN4N/MIfAds1DL9mP151CNqIpWHqZGRr+LkvUyiq3FRPuP1Kt6aK+pG3nEC1FXt0ZAAJ5FKP8QU8CZ5/jQdSYLVeFwl9NoIkegVpR6b7W2ZwbaF00OPr6ON1/FpLQ3RiUzTPpAqe7f+fwhOr0KrKy8PpCa54OHogaEjI3w=',
|
||||
'X-Secure-Level': 2,
|
||||
})
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
const content =
|
||||
'<div class="b-livestreaming-daily-schedule__section b-livestreaming-daily-schedule__contents"> <div class="b-livestreaming-daily-schedule__content" id="schedule-content-20211124"> <div class="js-ahoy b-livestreaming-schedule__ahoy-impression" data-ahoy-component="Ahoy::Builder" data-ahoy-impression="true" data-ahoy-title="LIVESTREAMING" data-use-bounding-client-rect="true" ></div><div class="b-livestreaming-daily-schedule__scroll-container"> <a class="" href="/watch/2361692-30-hari-30-juz-24-november-2021" ><div class="b-livestreaming-daily-schedule__item js-ahoy" data-ahoy-click="true" data-ahoy-component="Ahoy::Builder" data-ahoy-props=\'{"section":"schedule","stream_type":"TvStream","livestreaming_id":7464,"schedule_day":-1,"schedule_id":1471806,"schedule_title":"30 Hari 30 Juz","action":"click"}\' data-ahoy-title="LIVESTREAMING" id="schedule-item-1471806" > <div class="b-livestreaming-daily-schedule__item-icon"> <div class="b-livestreaming-daily-schedule__item-icon-play"></div></div><div class="b-livestreaming-daily-schedule__item-content"> <div class="b-livestreaming-daily-schedule__item-content-caption"> 00:30 - 01:30 WIB </div><div class="b-livestreaming-daily-schedule__item-content-title">30 Hari 30 Juz</div></div></div></a ><a class="" href="/watch/2361785-makkah-live-24-november-2021" ><div class="b-livestreaming-daily-schedule__item js-ahoy" data-ahoy-click="true" data-ahoy-component="Ahoy::Builder" data-ahoy-props=\'{"section":"schedule","stream_type":"TvStream","livestreaming_id":7464,"schedule_day":-1,"schedule_id":1471807,"schedule_title":"Makkah Live","action":"click"}\' data-ahoy-title="LIVESTREAMING" id="schedule-item-1471807" > <div class="b-livestreaming-daily-schedule__item-icon"> <div class="b-livestreaming-daily-schedule__item-icon-play"></div></div><div class="b-livestreaming-daily-schedule__item-content"> <div class="b-livestreaming-daily-schedule__item-content-caption"> 01:30 - 04:00 WIB </div><div class="b-livestreaming-daily-schedule__item-content-title">Makkah Live</div></div></div></a ><a class="" href="/watch/2362889-ftv-islami-24-november-2021" ><div class="b-livestreaming-daily-schedule__item js-ahoy" data-ahoy-click="true" data-ahoy-component="Ahoy::Builder" data-ahoy-props=\'{"section":"schedule","stream_type":"TvStream","livestreaming_id":7464,"schedule_day":-1,"schedule_id":1473829,"schedule_title":"FTV Islami","action":"click"}\' data-ahoy-title="LIVESTREAMING" id="schedule-item-1473829" > <div class="b-livestreaming-daily-schedule__item-icon"> <div class="b-livestreaming-daily-schedule__item-icon-play"></div></div><div class="b-livestreaming-daily-schedule__item-content"> <div class="b-livestreaming-daily-schedule__item-content-caption"> 22:30 - 00:30 WIB </div><div class="b-livestreaming-daily-schedule__item-content-title">FTV Islami</div></div></div></a > </div></div><div class="b-livestreaming-daily-schedule__content tab-active" id="schedule-content-20211125"> <div class="js-ahoy b-livestreaming-schedule__ahoy-impression" data-ahoy-component="Ahoy::Builder" data-ahoy-impression="true" data-ahoy-title="LIVESTREAMING" data-use-bounding-client-rect="true" ></div><div class="b-livestreaming-daily-schedule__scroll-container"> <a class="" href="/watch/2362921-30-hari-30-juz-25-november-2021" ><div class="b-livestreaming-daily-schedule__item js-ahoy" data-ahoy-click="true" data-ahoy-component="Ahoy::Builder" data-ahoy-props=\'{"section":"schedule","stream_type":"TvStream","livestreaming_id":7464,"schedule_day":0,"schedule_id":1473830,"schedule_title":"30 Hari 30 Juz","action":"click"}\' data-ahoy-title="LIVESTREAMING" id="schedule-item-1473830" > <div class="b-livestreaming-daily-schedule__item-icon"> <div class="b-livestreaming-daily-schedule__item-icon-play"></div></div><div class="b-livestreaming-daily-schedule__item-content"> <div class="b-livestreaming-daily-schedule__item-content-caption"> 00:30 - 01:30 WIB </div><div class="b-livestreaming-daily-schedule__item-content-title">30 Hari 30 Juz</div></div></div></a > </div></div></div>'
|
||||
const result = parser({ content, date }).map(p => {
|
||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
|
||||
const results = parser({ content, channel, date }).map(p => {
|
||||
p.start = p.start.toJSON()
|
||||
p.stop = p.stop.toJSON()
|
||||
return p
|
||||
})
|
||||
|
||||
expect(result).toMatchObject([
|
||||
{
|
||||
start: '2021-11-23T17:30:00.000Z',
|
||||
stop: '2021-11-23T18:30:00.000Z',
|
||||
title: '30 Hari 30 Juz'
|
||||
},
|
||||
{
|
||||
start: '2021-11-23T18:30:00.000Z',
|
||||
stop: '2021-11-23T21:00:00.000Z',
|
||||
title: 'Makkah Live'
|
||||
},
|
||||
{
|
||||
start: '2021-11-24T15:30:00.000Z',
|
||||
stop: '2021-11-24T17:30:00.000Z',
|
||||
title: 'FTV Islami'
|
||||
}
|
||||
])
|
||||
expect(results.length).toBe(21)
|
||||
expect(results[0]).toMatchObject({
|
||||
start: '2025-06-30T15:57:00.000Z',
|
||||
stop: '2025-06-30T17:29:00.000Z',
|
||||
title: 'Ftv PrimeTime : Cinta Dodol Inilah Yang Membuatku Lengket Padamu',
|
||||
description: 'Film televisi yang mengangkat kisah romantisme kehidupan dengan konflik yang menarik. tayang setiap hari'
|
||||
})
|
||||
})
|
||||
|
||||
it('can handle empty guide', () => {
|
||||
const result = parser({
|
||||
date,
|
||||
channel,
|
||||
content: '<!DOCTYPE html><html><head></head><body></body></html>'
|
||||
})
|
||||
expect(result).toMatchObject([])
|
||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json'))
|
||||
const results = parser({ content, channel })
|
||||
|
||||
expect(results).toMatchObject([])
|
||||
})
|
||||
Reference in new issue
Block a user