|
@@ -49,13 +49,14 @@ class ZDFVideo(object):
|
|
|
|
|
|
class Connector(object):
|
|
|
"""Connector class performing operations against the API"""
|
|
|
- def __init__(self, subscription_type, name, conf):
|
|
|
+ def __init__(self, subscription_type, name, conf, search=""):
|
|
|
if subscription_type == "user":
|
|
|
self._type = "channel"
|
|
|
else:
|
|
|
self._type = subscription_type
|
|
|
self._name = name
|
|
|
self._conf = conf
|
|
|
+ self._search = search
|
|
|
if self._type != "channel":
|
|
|
raise stov_exceptions.TypeNotSupported()
|
|
|
|
|
@@ -80,9 +81,14 @@ class Connector(object):
|
|
|
response = json.loads(data)
|
|
|
for cluster in response["broadcastCluster"]:
|
|
|
for broadcast in cluster["teaser"]:
|
|
|
- if self._name in broadcast["titel"]:
|
|
|
- new_videos.append((broadcast["sharingUrl"],
|
|
|
- broadcast["titel"]))
|
|
|
+ if self._name in broadcast["headline"]:
|
|
|
+ if self._search:
|
|
|
+ if self._search in broadcast["titel"]:
|
|
|
+ new_videos.append((broadcast["sharingUrl"],
|
|
|
+ broadcast["titel"]))
|
|
|
+ else:
|
|
|
+ new_videos.append((broadcast["sharingUrl"],
|
|
|
+ broadcast["titel"]))
|
|
|
if new_videos:
|
|
|
for broadcast in new_videos:
|
|
|
video_exists = False
|