kopia lustrzana https://github.com/bellingcat/auto-archiver
minor code cleanup
rodzic
0304860bce
commit
3b9b42b854
|
@ -6,5 +6,5 @@ service_account.json
|
||||||
__pycache__/
|
__pycache__/
|
||||||
._*
|
._*
|
||||||
anu.html
|
anu.html
|
||||||
geckodriver.log
|
*.log
|
||||||
|
.pytest_cach
|
|
@ -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
|
||||||
|
|
|
@ -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)))
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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 *
|
Ładowanie…
Reference in New Issue