Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add orangetv.es provider #2485

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

davidclaeysquinones
Copy link
Contributor

I made the code based on a proposal from @fraudiay79 in this thread.
I've made some improvements and made sure the code performs at a basic level.

Currently this PR is NOT ready to be merged. I've made it in order to get valuable feedback and maybe get some help with it.
I've made some tests but these are not ready for prime time, some API mocking needs to be implemented for that.

Furthermore the channels list needs to be cleaned up, since some channels appear as available but don't have any programs available.
Also the possibility exists that there is still some glaring issue in the code I've looked over.

@BellezaEmporium @PopeyeTheSai10r Would you be willing to have a look at it in order to provide some feedback?

@BellezaEmporium
Copy link
Contributor

Seems like you've got inspired from the telenet.tv website. A few quacks on my side that i'm solving.

@davidclaeysquinones
Copy link
Contributor Author

'

yeah I took some inspiration from that and the pick.be provider.

@BellezaEmporium
Copy link
Contributor

BellezaEmporium commented Dec 19, 2024

Managed to get the programs. The tests aren't working yet xd

image

@davidclaeysquinones
Copy link
Contributor Author

Managed to get the programs. The tests aren't working yet xd

image

Was the program retrieval broken ?

@davidclaeysquinones
Copy link
Contributor Author

Btw thanks for helping out with the tests.

@BellezaEmporium
Copy link
Contributor

Managed to get the programs. The tests aren't working yet xd
image

Was the program retrieval broken ?

I had an error message about dayjs.utc. It was because you didn't import it on the code.

const utc = require('dayjs/plugin/utc')

dayjs.extend(utc)

was necessary in order for the code to work.

@davidclaeysquinones
Copy link
Contributor Author

That's weird since I have it working. I might have made a copy paste error.
Anyway I've seen you've made some nice improvements.

@davidclaeysquinones
Copy link
Contributor Author

However I'm afraid there might be some duplicate ítems in the program array. Tbh the way it's made is quite inefficient.

A first requests is send to an URL, and aftherwards 3 more requests are send.
That first request is Made because the framework expects an URL to retrieve the content from.
But actually only the 3 requests are really usefull.

@BellezaEmporium
Copy link
Contributor

Well, on my side, the code works quite well. The EPG looks good on my side, though there's one single test failing. I've managed to fix one, though one test is failing.

@BellezaEmporium
Copy link
Contributor

BellezaEmporium commented Dec 19, 2024

Works fine on my watch now, both programs and tests.

Example piece of data :

<programme start="20241219160000 +0000" stop="20241219163000 +0000" channel="24Horas.es"><title lang="es">La tarde en 24H - T2024, E514: 19 de Diciembre de 2024</title><desc lang="es">Informativo en directo de noticias entrevistas y reportajes con dedicación especial a la economía, internacional, cultura y deporte.</desc><category lang="es">Programa</category><category lang="es">Informativo</category><episode-num system="xmltv_ns">2023.513.0/1</episode-num><episode-num system="onscreen">S2024E514</episode-num><icon src="https://pc.orangetv.orange.es/pc/api/rtv/v1/images/epg/COVER/COVER_466409.jpg"/></programme>

Program grabbing :

@BellezaEmporium ➜ /workspaces/epg (belleza-maintenance) $ npm run grab -- --site=orangetv.es

> grab
> npx tsx scripts/commands/epg/grab.ts --site=orangetv.es

starting...
config:
  output: guide.xml
  maxConnections: 1
  gzip: false
  site: orangetv.es
loading channels...
  found 169 channel(s)
run #1:
  [1/338] orangetv.es (es) - La1.es - Dec 19, 2024 (21 programs)
  [2/338] orangetv.es (es) - La1.es - Dec 20, 2024 (19 programs)
  [3/338] orangetv.es (es) - La2.es - Dec 20, 2024 (37 programs)
  [4/338] orangetv.es (es) - Teledeporte.es - Dec 20, 2024 (19 programs)
  [5/338] orangetv.es (es) - Telecinco.es - Dec 20, 2024 (23 programs)
  [6/338] orangetv.es (es) - AXN.es - Dec 20, 2024 (26 programs)
  [7/338] orangetv.es (es) - CanalHollywood.es - Dec 20, 2024 (18 programs)
  [8/338] orangetv.es (es) - CanalHollywood.es - Dec 19, 2024 (17 programs)
  [9/338] orangetv.es (es) - AXN.es - Dec 19, 2024 (28 programs)
  [10/338] orangetv.es (es) - Nova.es - Dec 20, 2024 (18 programs)
  [11/338] orangetv.es (es) - Nova.es - Dec 19, 2024 (23 programs)
  [12/338] orangetv.es (es) - Telecinco.es - Dec 19, 2024 (24 programs)
  [13/338] orangetv.es (es) - WarnerTV.es - Dec 20, 2024 (34 programs)
  [14/338] orangetv.es (es) - Divinity.es - Dec 20, 2024 (32 programs)
  [15/338] orangetv.es (es) - Divinity.es - Dec 19, 2024 (31 programs)

Tests :

> Test run "watch-tests:0" started at 12/19/2024, 10:05:02 PM <

 PASS  sites/orangetv.es/orangetv.es.test.js
  ✓ can generate valid url (4 ms)
  ✓ can parse response (276 ms)
  ✓ can handle empty guide (1 ms)


> Test run "watch-tests:0" finished at 12/19/2024, 10:05:06 PM <

Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        3.72 s, estimated 4 s
Ran all test suites related to changed files.

@BellezaEmporium
Copy link
Contributor

BellezaEmporium commented Dec 20, 2024

I'll let everyone test the current code as-is, and if it is positive for everyone, @davidclaeysquinones you'll be free to make it R2R.

@BellezaEmporium
Copy link
Contributor

BellezaEmporium commented Dec 20, 2024

By the way, I see that #TODO in readme contains this :

### Todo

Some channels of this provider are not added to the channel database :

- RuntimeSeries.es
- RuntimeCineSeries.es
- RuntimeCineTerror.es
- RuntimeAccion.es
- RuntimeComedia.es
- RuntimeCrimen.es
- RuntimeRomance.es
- RunTimeClasico.es
- CinesVerdiTV.es
- CineFeelGood.es
- Gametoon.es

The Runtime channels are FAST channels. They can be categorised the same as the Pluto.tv ones.
A few local channels aren't in the database as well, like "Castello TV (Televisio Castello ?)" and "Navarra TV 2".
I suggest to add those local ones, as they can be added later on if we stumble upon them in streams.

Gametoon is actually registered : http://www.gametoon.com/ / Gametoon.nl

https://www.navarratelevision.es/AppParrilla.aspx?canal=Canal2
https://kick.com/televisiocastello

@davidclaeysquinones
Copy link
Contributor Author

I forgot about that issue but there were quite some channels where I didn't know what I should do with them.

The Gametoon one seemed weird because I doubted they were going to transmit a dutch channel in Spain.
And I had no idea about the Runtine/Fast channels being the same as the Pluto channels.

The channel grabber spit outs also a bunch of other channels, but there is not programs to be found for them.
So I opted to leaving them out.

I suspect depending on the region they put the local channels in a dedicated feed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants