Fixes broadcast tests
This commit is contained in:
parent
e9be31e9c1
commit
9ddd60ce16
4 changed files with 28 additions and 22 deletions
|
@ -1,3 +1,4 @@
|
|||
''' bring connectors into the namespace '''
|
||||
from .settings import CONNECTORS
|
||||
from .abstract_connector import ConnectorException
|
||||
from .abstract_connector import get_data, get_image
|
||||
|
|
|
@ -318,6 +318,17 @@ def get_data(url):
|
|||
return data
|
||||
|
||||
|
||||
def get_image(url):
|
||||
''' wrapper for requesting an image '''
|
||||
try:
|
||||
resp = requests.get(url)
|
||||
except RequestError:
|
||||
return None
|
||||
if not resp.ok:
|
||||
return None
|
||||
return resp
|
||||
|
||||
|
||||
@dataclass
|
||||
class SearchResult:
|
||||
''' standardized search result object '''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue