feat: WACZ enricher can now be probed for media, and used as an archiver OR enricher

This commit is contained in:
msramalho
2023-07-27 15:42:10 +01:00
parent 65e3c99483
commit dd034da844
8 changed files with 657 additions and 579 deletions

View File

@@ -2,7 +2,6 @@
import os, json, requests
from datetime import datetime
from loguru import logger
from urllib.parse import urlparse, urlunparse
def mkdir_if_not_exists(folder):
@@ -21,14 +20,6 @@ def expand_url(url):
logger.error(f'Failed to expand url {url}')
return url
def remove_get_parameters(url):
# http://example.com/file.mp4?t=1 -> http://example.com/file.mp4
# useful for mimetypes to work
parsed_url = urlparse(url)
new_url = urlunparse(parsed_url._replace(query=''))
return new_url
def getattr_or(o: object, prop: str, default=None):
try:
res = getattr(o, prop)