From 5456a138c07021acb0d692ffff2614283a89bf65 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sun, 20 Feb 2022 21:53:36 +0000 Subject: [PATCH] move url to utils --- update_films_by_year_page.py | 3 --- vcinema_utils/VCinemaUtils.py | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/update_films_by_year_page.py b/update_films_by_year_page.py index fb03296..b1a4243 100644 --- a/update_films_by_year_page.py +++ b/update_films_by_year_page.py @@ -6,9 +6,6 @@ from vcinema_utils import VCinemaUtils from wiki_utils import WikiUtils -JACKNET_WIKI_URL = "https://wiki.jacknet.io" - - def build_table(films_by_year): films_by_year_descending = OrderedDict(sorted(films_by_year.items(), key=lambda t: t[0], reverse=True)) diff --git a/vcinema_utils/VCinemaUtils.py b/vcinema_utils/VCinemaUtils.py index 523eb57..9862daf 100644 --- a/vcinema_utils/VCinemaUtils.py +++ b/vcinema_utils/VCinemaUtils.py @@ -5,13 +5,14 @@ from imdb_utils import IMDbUtils from wiki_utils import WikiUtils +JACKNET_WIKI_URL = "https://wiki.jacknet.io" + + def get_vcinema_viewings(token_id, token_secret): # Page ID of /Vcinema/CSV page_id = 11 - wiki_base_url = "https://wiki.jacknet.io" - - html_page = WikiUtils.get_page_export_html(page_id, wiki_base_url, token_id, token_secret) + html_page = WikiUtils.get_page_export_html(page_id, JACKNET_WIKI_URL, token_id, token_secret) soup = BeautifulSoup(html_page, 'html.parser') elements = soup.find("code").text.strip().split("\n")