From 30e251ac09bc866a5dea283c0800bfda07790831 Mon Sep 17 00:00:00 2001 From: djib Date: Tue, 8 Oct 2019 23:32:04 +0200 Subject: [PATCH] Fetch the list of available Channels from the Freebox API --- .gitmodules | 3 +++ FreeboxMoviePlanner.py | 28 ++++++++++++++++++++++++---- config.template.json | 5 +++-- pyfbx | 1 + 4 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 .gitmodules create mode 160000 pyfbx diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..1da7b0e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "pyfbx"] + path = pyfbx + url = https://djib.fr/djib/pyfbx.git diff --git a/FreeboxMoviePlanner.py b/FreeboxMoviePlanner.py index 88bca86..e0b39c0 100755 --- a/FreeboxMoviePlanner.py +++ b/FreeboxMoviePlanner.py @@ -12,6 +12,7 @@ import requests import datetime import tmdbsimple import textwrap +from pyfbx.pyfbx import Fbx from bs4 import BeautifulSoup from collections import deque @@ -92,6 +93,14 @@ class FreeboxMoviePlanner: tmdbsimple.API_KEY = self.config['tmdb-api'] self.movies = [] + logging.info('Opening Freebox session') + self.freebox = Fbx() + self.freebox.mksession( + app_id='FreeboxMoviePlanner', + token=self.config['freebox-session-token'] + ) + self.getListOfAvailableChannels() + def __repr__(self): result = 'FreeboxMoviePlanner