5k4nd / cinema

Fetch theaters shows.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub last commit Code style: black

Fetch theaters shows from http://www.allocine.fr in order to put them on a lightweight web page.

Credits for the idea and initial code goes to my friend JC. And design credits goes to Hamlet.

This code is licensed under GNU AGPL 3.0: a modified version used to provide a service, commercial or not, must distribute its complete source code. Illegal uses will be prosecuted under French law.

Quickstart

Install imagemagick (for compressing images, disable this with COMPRESS_PIC=False in settings), e.g. on Debian:

sudo apt install imagemagick

then clone this repo and run the script with:

python3 main.py

Your freshly generated index.html pages will be located in html/.

That's it!

(optional) systemd service

Do not forget to use absolute paths in settings.py if using a systemd service.

Move:

  • templates/systemd/cinema.unit # adapt the script path to your own location
  • templates/systemd/cinema.timer # cron to run the service everyday

into a systemd subdir of your choice, e.g.:

  • /etc/systemd/system/

Then enable and optionally start the unit (as you would do for any systemd unit):

systemctl enable cinema.timer
# restart your system or run the following:
systemctl start cinema.timer

You should see your timer here:

systemctl list-timers

Settings

Edit settings in settings.py.

Edit your theaters preference list in theaters.csv. Get theaters codes from the allocine URL, ex. http://allocine.fr/seance/salle_gen_csalle=C0076.html where C0076 is the code.

Translation

By default, everything is generated as french. You can change this by changing "fr_FR.UTF-8" to your locale in the settings. Before doing so, you need to ensure your locale is available in your current Linux system:

locale -a

If not, uncomment the desired locale from /etc/locale.gen (if multiple entries, use the UTF-8 one) then run:

sudo locale-gen

Contributing

Contributions are welcome! Feel free to open issues or pull requests.

Development on the latest version of Python is preferred. As of this writing it's 3.11.

Install pre-commit hooks:

pip install pre-commit
pre-commit install

Then, any new commit will run linting tools. You're ready to contribute!

About

Fetch theaters shows.

License:GNU Affero General Public License v3.0


Languages

Language:Python 72.3%Language:CSS 14.5%Language:HTML 13.2%