From 12648bbce90b15af125b9f387be2ac4a98552876 Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Tue, 14 Jun 2022 20:15:14 +0200 Subject: [PATCH] centralizing slugify url method --- archivers/base_archiver.py | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/archivers/base_archiver.py b/archivers/base_archiver.py index 7e9c85a..18e4c1b 100644 --- a/archivers/base_archiver.py +++ b/archivers/base_archiver.py @@ -8,6 +8,7 @@ import ffmpeg from loguru import logger from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By +from slugify import slugify from storages import Storage from utils import mkdir_if_not_exists @@ -46,9 +47,6 @@ class Archiver(ABC): def get_netloc(self, url): return urlparse(url).netloc - def get_html_key(self, url): - return self.get_key(urlparse(url).path.replace("/", "_") + ".html") - # generate the html page eg SM3013/twitter__minmyatnaing13_status_1499415562937503751.html def generate_media_page_html(self, url, urls_info: dict, object, thumbnail=None): """ @@ -65,8 +63,7 @@ class Archiver(ABC): page += f"
{object}"
page += f"