Site mytelly.co.uk now requires user agent.

Signed-off-by: Toha <tohenk@yahoo.com>
This commit is contained in:
Toha 2025-03-28 21:11:08 +07:00
parent 30dc0517be
commit 3fd6e47d4f
No known key found for this signature in database
GPG key ID: 2D7AA6389D44DCAB
2 changed files with 11 additions and 6 deletions

View file

@ -18,6 +18,12 @@ const tz = 'Europe/London'
module.exports = { module.exports = {
site: 'mytelly.co.uk', site: 'mytelly.co.uk',
days: 2, days: 2,
request: {
headers: {
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 OPR/117.0.0.0'
}
},
url({ date, channel }) { url({ date, channel }) {
return `https://www.mytelly.co.uk/tv-guide/listings/channel/${ return `https://www.mytelly.co.uk/tv-guide/listings/channel/${
channel.site_id channel.site_id
@ -36,7 +42,7 @@ module.exports = {
const td = $(el).find('td:eq(1)') const td = $(el).find('td:eq(1)')
const title = td.find('h5 a') const title = td.find('h5 a')
if (detailedGuide) { if (detailedGuide) {
queues.push(title.attr('href')) queues.push({ url: title.attr('href'), params: module.exports.request })
} else { } else {
const subtitle = td.find('h6') const subtitle = td.find('h6')
const time = $(el).find('td:eq(0)') const time = $(el).find('td:eq(0)')
@ -115,7 +121,7 @@ module.exports = {
}, },
async channels() { async channels() {
const channels = {} const channels = {}
const queues = [{ t: 'p', method: 'post', url: 'https://www.mytelly.co.uk/getform' }] const queues = [{ t: 'p', url: 'https://www.mytelly.co.uk/getform', params: this.request }]
await doFetch(queues, (queue, res) => { await doFetch(queues, (queue, res) => {
// process form -> provider // process form -> provider
if (queue.t === 'p') { if (queue.t === 'p') {
@ -127,9 +133,8 @@ module.exports = {
const provider = opt.attr('value') const provider = opt.attr('value')
queues.push({ queues.push({
t: 'r', t: 'r',
method: 'post',
url: 'https://www.mytelly.co.uk/getregions', url: 'https://www.mytelly.co.uk/getregions',
params: { provider } params: { ...this.request, provider }
}) })
}) })
} }
@ -150,7 +155,7 @@ module.exports = {
t: 's', t: 's',
method: 'post', method: 'post',
url: 'https://www.mytelly.co.uk/tv-guide/schedule', url: 'https://www.mytelly.co.uk/tv-guide/schedule',
params params: { ...this.request, data: params }
}) })
} }
} }

View file

@ -1,6 +1,6 @@
# mytelly.co.uk # mytelly.co.uk
https://www.mytelly.co.uk/tv-guide/listings/tv-tonight.html https://www.mytelly.co.uk/tv-guide/
### Download the guide ### Download the guide