Paradise-91 / ParaTV

19 stars 2 forks source link

[question] Comment faites-vous? #2

Closed Shuggy999 closed 4 months ago

Shuggy999 commented 4 months ago

Salut, votre référentiel est très intéressant. Je me demandais comment fonctionnaient les scripts. Quelle plateforme utilisez-vous pour héberger les scripts ? Et serait-il possible de partager les scripts ?

Merci. Je pensais créer un référentiel similaire pour les chaînes du Royaume-Uni.

Paradise91D4 commented 4 months ago

Hello,

Thank you for your interest. I'll do my best to explain how it works.

  1. The channel scripts are stored in my private repository. They won't work with your UK channels, but the basic idea is that they are written in Python and run with GitHub Actions. These actions refresh the links and update the m3u8 files of the channels in the "streams" folder of the private repository.

  2. To trigger these actions, I use a schedule with Cronicle which runs on a home server using Docker.

  3. Each of the channel scripts is run by an action using repository_dispatch in the workflow. Cronicle triggers these APIs.

  4. I schedule the channel actions to trigger at certain times of the day, all on the same minute. This creates a queue.

  5. Five minutes after the channel actions trigger, Cronicle triggers another final action. This action is the last in the queue and its task is to run a command:

    rsync -rav --delete ParaTV-dev/streams/ ParaTV/streams

    This command syncs the private repository's "streams" folder with the public "streams" folder.

This is how it appears as one commit in the public repository. There may be simpler methods to handle this entire process, particularly when it comes to scheduling workflows, such as using schedule. However, I encountered issues where the actions didn't always run on time. This is why I use Cronicle; the actions always run on time. It's precise and customizable.

I can share the sync_streams workflow if you really need it. I hope this explanation helps and wish you the best of luck with your UK channels repository.