18 lines
484 B
Python
18 lines
484 B
Python
#!/usr/bin/env python3
|
|
# -*- encoding: utf-8 -*-
|
|
|
|
from typing import Any, Dict, List, Optional
|
|
|
|
from ... import simpleDownloader
|
|
from .. import cache
|
|
|
|
|
|
def get_link_bytes(link: str, *args: List[Any], **kwargs: Dict[str, Any]) -> Optional[bytes]:
|
|
bts = None
|
|
cached = cache.get_path_for_caching(link)
|
|
if cache.has_file_cache(cached):
|
|
bts = cache.read_file_from_cache(cached)
|
|
else:
|
|
bts = simpleDownloader.getUrlBytes(link, *args, **kwargs)
|
|
return bts
|