From a13a45bc28229288445e3d42e90d0c5ae6736acf Mon Sep 17 00:00:00 2001
From: freearhey <7253922+freearhey@users.noreply.github.com>
Date: Tue, 28 Nov 2023 15:12:00 +0300
Subject: [PATCH] Rename telkku.com to iltalehti.fi
---
.../__data__/content.json | 0
.../__data__/no-content.json | 0
sites/iltalehti.fi/iltalehti.fi.channels.xml | 145 ++++++++++++++++++
.../iltalehti.fi.config.js} | 9 +-
.../iltalehti.fi.test.js} | 5 +-
sites/telkku.com/telkku.com.channels.xml | 99 ------------
6 files changed, 153 insertions(+), 105 deletions(-)
rename sites/{telkku.com => iltalehti.fi}/__data__/content.json (100%)
rename sites/{telkku.com => iltalehti.fi}/__data__/no-content.json (100%)
create mode 100644 sites/iltalehti.fi/iltalehti.fi.channels.xml
rename sites/{telkku.com/telkku.com.config.js => iltalehti.fi/iltalehti.fi.config.js} (81%)
rename sites/{telkku.com/telkku.com.test.js => iltalehti.fi/iltalehti.fi.test.js} (86%)
delete mode 100644 sites/telkku.com/telkku.com.channels.xml
diff --git a/sites/telkku.com/__data__/content.json b/sites/iltalehti.fi/__data__/content.json
similarity index 100%
rename from sites/telkku.com/__data__/content.json
rename to sites/iltalehti.fi/__data__/content.json
diff --git a/sites/telkku.com/__data__/no-content.json b/sites/iltalehti.fi/__data__/no-content.json
similarity index 100%
rename from sites/telkku.com/__data__/no-content.json
rename to sites/iltalehti.fi/__data__/no-content.json
diff --git a/sites/iltalehti.fi/iltalehti.fi.channels.xml b/sites/iltalehti.fi/iltalehti.fi.channels.xml
new file mode 100644
index 00000000..dfa8da60
--- /dev/null
+++ b/sites/iltalehti.fi/iltalehti.fi.channels.xml
@@ -0,0 +1,145 @@
+
+
+ Viron ETV
+
+ Animal Planet
+ MTV Ava
+ Cartoon Network
+ MTV Aitio
+ MTV juniori
+ MTV Max
+ MTV Viihde
+ MTV Urheilu 1
+ MTV Urheilu 2
+ Discovery Channel
+ Extreme Sports
+ Star
+ Frii
+ Hero
+ Himlen TV7
+ Jim
+ Kanal5
+ Kutonen
+ Liv
+ MTV3
+ National Geographic
+ Nelonen
+ SF-kanalen
+ MTV Sub
+ SVT 1
+ SVT 2
+ SVT24
+ TV7
+ TLC
+ TV3
+ TV4
+ TV5
+ TV6
+ V film ACTION
+ V film FAMILY
+ V film HITS
+ V film PREMIERE
+ Viasat Explore
+ Viasat History
+ H2
+ V sport FOOTBALL
+ V sport GOLF
+ V sport PREMIUM
+ V sport ULTRA HD
+ V sport vinter
+ Yle Teema Fem
+ Yle TV1
+ Yle TV2
+
diff --git a/sites/telkku.com/telkku.com.config.js b/sites/iltalehti.fi/iltalehti.fi.config.js
similarity index 81%
rename from sites/telkku.com/telkku.com.config.js
rename to sites/iltalehti.fi/iltalehti.fi.config.js
index 3ce3ac6b..a131ce76 100644
--- a/sites/telkku.com/telkku.com.config.js
+++ b/sites/iltalehti.fi/iltalehti.fi.config.js
@@ -2,12 +2,17 @@ const axios = require('axios')
const dayjs = require('dayjs')
module.exports = {
- site: 'telkku.com',
+ site: 'iltalehti.fi',
days: 2,
+ request: {
+ cache: {
+ ttl: 60 * 60 * 1000 // 1 hour
+ }
+ },
url: function ({ channel, date }) {
const [group] = channel.site_id.split('#')
- return `https://telkku.com/api/channel-groups/${group}/offering?startTime=00%3A00%3A00.000&duration=PT24H&inclusionPolicy=IncludeOngoingAlso&limit=1000&tvDate=${date.format(
+ return `https://telkku.com/api/channel-groups/default_builtin_channelgroup${group}/offering?startTime=00%3A00%3A00.000&duration=PT24H&inclusionPolicy=IncludeOngoingAlso&limit=1000&tvDate=${date.format(
'YYYY-MM-DD'
)}&view=PublicationDetails`
},
diff --git a/sites/telkku.com/telkku.com.test.js b/sites/iltalehti.fi/iltalehti.fi.test.js
similarity index 86%
rename from sites/telkku.com/telkku.com.test.js
rename to sites/iltalehti.fi/iltalehti.fi.test.js
index d03dca75..2a0a5031 100644
--- a/sites/telkku.com/telkku.com.test.js
+++ b/sites/iltalehti.fi/iltalehti.fi.test.js
@@ -1,7 +1,4 @@
-// npm run channels:parse -- --config=./sites/telkku.com/telkku.com.config.js --output=./sites/telkku.com/telkku.com.channels.xml
-// npm run grab -- --site=telkku.com
-
-const { parser, url } = require('./telkku.com.config.js')
+const { parser, url } = require('./iltalehti.fi.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
diff --git a/sites/telkku.com/telkku.com.channels.xml b/sites/telkku.com/telkku.com.channels.xml
deleted file mode 100644
index 7050a3d3..00000000
--- a/sites/telkku.com/telkku.com.channels.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- AlfaTV
- Animal Planet
- Ava
- Cartoon Network
- C More First
- C More Hits
- C More Juniori
- C More Max
- C More Series
- C More Sport 1
- C More Sport 2
- C More Stars
- Discovery Channel
- Extreme Sports
- Fox
- Frii
- H2
- Hero
- Himlen TV7
- Jim
- Kanal5
- Kutonen
- Liv
- MTV3
- National Geographic
- Nelonen
- SF-kanalen
- Sub
- SVT 1
- SVT 2
- SVT24
- TLC
- TV3
- TV4
- TV5
- TV6
- V film ACTION
- V film FAMILY
- V film HITS
- V film PREMIERE
- Viasat Explore
- Viasat History
- V sport FOOTBALL
- V sport GOLF
- V sport PREMIUM
- V sport ULTRA HD
- V sport vinter
- Yle Teema Fem
- Yle TV1
- Yle TV2
-Viron ETV
-TV7
-