minor code cleanup

pull/20/head
msramalho 2022-03-15 11:32:39 +01:00
rodzic 0304860bce
commit 3b9b42b854
5 zmienionych plików z 6 dodań i 7 usunięć

4
.gitignore vendored
Wyświetl plik

@ -6,5 +6,5 @@ service_account.json
__pycache__/ __pycache__/
._* ._*
anu.html anu.html
geckodriver.log *.log
.pytest_cach

Wyświetl plik

@ -6,7 +6,6 @@ from dataclasses import dataclass
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from urllib.parse import urlparse from urllib.parse import urlparse
import hashlib import hashlib
from selenium.common.exceptions import TimeoutException
from loguru import logger from loguru import logger
import time import time
import requests import requests

Wyświetl plik

@ -39,7 +39,7 @@ class TelegramArchiver(Archiver):
images = [] images = []
for im in image_tags: for im in image_tags:
urls = [u.replace("'", "") for u in re.findall('url\((.*?)\)', im['style'])] urls = [u.replace("'", "") for u in re.findall(r'url\((.*?)\)', im['style'])]
images += urls images += urls
page_cdn, page_hash, thumbnail = self.generate_media_page(images, url, html.escape(str(t.content))) page_cdn, page_hash, thumbnail = self.generate_media_page(images, url, html.escape(str(t.content)))

Wyświetl plik

@ -6,10 +6,10 @@ class Storage(ABC):
def __init__(self, config): pass def __init__(self, config): pass
@abstractmethod @abstractmethod
def get_cdn_url(self, path): pass def get_cdn_url(self, key): pass
@abstractmethod @abstractmethod
def exists(self, path): pass def exists(self, key): pass
@abstractmethod @abstractmethod
def uploadf(self, file, key, **kwargs): pass def uploadf(self, file, key, **kwargs): pass

Wyświetl plik

@ -1,3 +1,3 @@
# we need to explicitly expose the available imports here # we need to explicitly expose the available imports here
from .gworksheet import GWorksheet from .gworksheet import *
from .misc import * from .misc import *