From cf1f841d5bb9c014617bddfe5ed60e14ffe1df98 Mon Sep 17 00:00:00 2001 From: "._______166" Date: Wed, 22 Apr 2026 16:16:53 +0100 Subject: [PATCH] Freeview: Pull all channels from every region this change builds one massive freeview TV guide for the entire uk, as it merges the guide for every region/transmitter group into one single guide, i have tried my best to remove duplicate channels from the guide, but, specifically with the bbc shifting some of their IDs for some regions, and 'that's tv' owning nearly all the local tv licences in the UK, it is impossible to remove all duplicates --- .../freeview.co.uk.channels.xml | 210 +++++++++++++++++- sites/freeview.co.uk/freeview.co.uk.config.js | 29 ++- 2 files changed, 216 insertions(+), 23 deletions(-) diff --git a/sites/freeview.co.uk/freeview.co.uk.channels.xml b/sites/freeview.co.uk/freeview.co.uk.channels.xml index eee24034c..290c3dcd9 100644 --- a/sites/freeview.co.uk/freeview.co.uk.channels.xml +++ b/sites/freeview.co.uk/freeview.co.uk.channels.xml @@ -21,13 +21,13 @@ Sonlife On Demand 365 Channelbox - That's Oldies CNA Originals GIGS - EuroNews Trailblazer Odyssey TV Ketchup Too + Music & Memories + Outdoor Channel ROK Global Arabic + Amazing Facts @@ -35,7 +35,6 @@ Nosey Shop On TV Purpose Media - LEGEND XTRA RNIB Connect Heart Capital @@ -44,24 +43,117 @@ That's TV 2 SonLife Must Have Ideas - That's 80s + That's 70s Smooth Radio Hobbycraft TV Rewind TV Together TV IP - That's Melody + That's 60s Premier Radio Great! Player Great! Romance Mix - India Today MBC Group - wedotv movies + wedotv Big Stories It Is Written TV OUTflix Proud High Street TV Cartoon Classics wedotv Movies UK Nolly Africa + BBC Solent + BBC Solent Dorset + BBC Sussex + BBC Wiltshire + BBC Kent + KMTV + That's TV + That's TV + Latest TV + That's TV + That's TV + BBC Oxford + BBC Gloucestershire + That's TV + BBC Norfolk + BBC Northampton + BBC Cambridge + BBC Suffolk + That's TV + That's TV + BBC Bristol + BBC Somerset + Bristol TV + BBC Cornwall + BBC Devon + BBC Guernsey + BBC Jersey + BBC WM + BBC Stoke + BBC Derby + BBC H&W + BBC Shropshire + BBC CWR + Birmingham TV + BBC Nottingham + BBC Lincolnshire + BBC Leicester + BBC Sheffield + BBC Humberside + That's TV + That's TV + BBC Leeds + BBC York + That's TV + Leeds TV + That's TV + BBC Newcastle + BBC Cumbria + BBC Tees + Tyne & Wear TV + Teesside TV + BBC Manchester + BBC Lancashire + BBC Merseyside + That's TV (UK) MCR + TV Warehouse + That's 60s MCR + That's Oldies MCR + That's TV 2 MCR + TV Warehouse+1 + That's TV 3 MCR + That's Classics MCR + That's TV + Liverpool TV + That's TV + That's TV + BBC R5L + BBC 5SX + BBC 6 Music + BBC Radio 4 Ex + BBC R1X + BBC Asian Net. + BBC World Sv. + BBC R Scotland + BBC R n Gaidheal + BBC Radio 1 + BBC Radio 2 + BBC Radio 3 + BBC Radio 4 + That's TV + That's TV + That's TV + That's TV + That's TV + BBC Radio Wales + BBC Radio Cymru + BBC Radio Cymru 2 + Cardiff TV + That's TV + North Wales TV + BBC Radio Ulster + BBC Radio Foyle + RTÉ RnaG + That's TV 4seven 5ACTION 5SELECT @@ -72,20 +164,63 @@ Al Jazeera Arabic Al Jazeera English ASHARQ NEWS + BBC ALBA BBC FOUR HD BBC FOUR BBC NEWS + BBC ONE CI + BBC ONE CI HD + BBC ONE East + BBC ONE East + BBC ONE EastHD + BBC ONE EastHD + BBC ONE E Mid + BBC ONE EMidHD BBC ONE Lon BBC ONE Lon HD + BBC ONE NE&C + BBC ONE NE&CHD + BBC ONE NI + BBC ONE NI HD + BBC ONE N West + BBC ONE NWstHD + BBC ONE Scot + BBC 1 Scot HD + BBC ONE South + BBC ONE South + BBC ONE S East + BBC ONE SE HD + BBC ONE Sth HD + BBC ONE Sth HD + BBC ONE S West + BBC ONE SW HD + BBC ONE Wales + BBC 1 Wales HD + BBC ONE West + BBC ONE WestHD + BBC ONE W Mid + BBC ONE WMidHD + BBC ONE Yorks + BBC ONE Yks HD + BBC ONE Yk&Li + BBC ONE Yk&LHD BBC Parliament BBC RB 1 + BBC Scotland HD + BBC Scotland BBC THREE HD BBC THREE BBC TWO BBC TWO HD + BBC TWO NI + BBC TWO NI HD + BBC TWO Wales + BBC 2 Wales HD Blaze+1 Blaze CBBC HD + CBBC HD + CBBC HD CBBC CBeebies HD CBeebies @@ -98,26 +233,61 @@ 5 DMAX E4+1 + E4+1 E4 E4 Extra + EuroNews Film4+1 Film4 Food Network FRANCE 24 GB News Gemporia - God TV Great! Action Great! Mystery Great! Movies Great! Romance Great! TV - HGTV HobbyMaker + LEGEND XTRA Ideal World + ITV1 + ITV1 + ITV1+1 + ITV1 Border England + ITV1+1 + ITV1 Border Scotland + ITV1 HD + ITV1 + ITV1 + ITV1 HD + ITV1+1 + ITV1 + ITV1 + ITV1 HD + ITV1+1 ITV1 HD ITV1 + ITV1 + ITV1 + ITV1 + ITV1 HD + ITV1+1 ITV1+1 + ITV1 + ITV1+1 + ITV1 Wales + ITV1 Wales HD + ITV1+1 + ITV1 + ITV1 + ITV1 HD + ITV1+1 + ITV1+1 + ITV1 + ITV1 + ITV1 HD + ITV1+1 ITV2+1 ITV2 ITV3+1 @@ -137,33 +307,49 @@ POP POP UP QUEST+1 + QUEST+1 QUEST Quest Red QVC2 QVC Really Revelation TV + RTÉ Two + RTÉ One + S4C HD + S4C Sky Arts Sky Mix Sky News + STV HD + STV+1 + STV + STV+1 + STV TalkingPictures TV talkSPORT Talk TBN UK + TG4 That's TV (UK) + That's TV Tiny Pop TJC + TLC+1 + TLC Together TV+1 Together TV TRUE CRIME TRUE CRIME XTRA U&Dave - U&DaveJaVu + U&DaveJaVu U&Drama+1 U&Drama U&Eden - U&W + UTV HD + UTV+1 + UTV + U&W U&Yesterday WildEarth - YAAAS! diff --git a/sites/freeview.co.uk/freeview.co.uk.config.js b/sites/freeview.co.uk/freeview.co.uk.config.js index e98f8302e..3a0f03d46 100644 --- a/sites/freeview.co.uk/freeview.co.uk.config.js +++ b/sites/freeview.co.uk/freeview.co.uk.config.js @@ -36,18 +36,25 @@ module.exports = { return programs }, async channels() { - const networkId = '64257' // Great London const startTimestamp = dayjs.utc().startOf('d').unix() - const data = await axios - .get(`https://www.freeview.co.uk/api/tv-guide?nid=${networkId}&start=${startTimestamp}`) - .then(r => r.data) - .catch(console.log) + let channels = [] + for (let networkId = 64257; networkId <= 64425; networkId++) { // loop through all valid networkIds starting from 64257 (Greater London) to 64425 (Belfast) to ensure we can get all the channels available on freeview + console.log(networkId) + const data = await axios + .get(`https://www.freeview.co.uk/api/tv-guide?nid=${networkId}&start=${startTimestamp}`) + .then(r => r.data) + .catch(console.log) - return data.data.programs.map(item => ({ - lang: 'en', - site_id: `${networkId}#${item.service_id}`, - name: item.title - })) + channels = channels.concat(data.data.programs.map(item => ({ + lang: 'en', + site_id: `${networkId}#${item.service_id}`, + name: item.title + }))) + } + const uniqueServiceIds = Array.from(new Set(channels.map(c => c.site_id.split('#')[1]))) + return uniqueServiceIds.map(serviceId => { + return channels.find(c => c.site_id.split('#')[1] === serviceId) + }) } } @@ -85,4 +92,4 @@ async function loadProgramDetails(item) { }) .catch(console.log) return data || {} -} \ No newline at end of file +}