class LiveStreams(object): # hex-codiert - wird nicht über die Github-Suche gefunden _URL = "687474703a2f2f7777772e6c6976656a61736d696e2e636f6d2f6c697374706167652e7068703f746167733d6769726c25324267726174697325324263686174267365746c616e673d656e" _PATTERN = re.compile(r"<img id=\"perfimg_(.*?)_.*src=\"(.*?)\?.*") _plugin_id = None _filter_builder = None def __init__(self, plugin_id): self._plugin_id = plugin_id self._filter_builder = FilterBuilder(self._plugin_id) def get_performer_name_and_image(self): url = self._URL.decode("hex") result = [] filters = self._filter_builder.get_filter() if filters: url = "%s-%s" % (url, filters) data = urllib.urlopen(url).readlines() for zeile in data: matchobj = self._PATTERN.findall(zeile) if matchobj: result.append(matchobj) return result
class LiveStreams(object): # hex-codiert - wird nicht über die Github-Suche gefunden _URL = "687474703a2f2f6e65772e6c6976656a61736d696e2e636f6d2f64652f6769726c732f6772617469732d63686174" _IMG_PATTERN = re.compile(r'style="background-image: url\((.*?jpg)') _PERFORMER_PATTERN = re.compile(r'<span class="performer_name">(.*?)</span>') _plugin_id = None _filter_builder = None def __init__(self, plugin_id): self._plugin_id = plugin_id self._filter_builder = FilterBuilder(self._plugin_id) def get_performer_name_and_image(self): url = self._URL.decode("hex") filters = self._filter_builder.get_filter() if filters: url = "%s-%s" % (url, filters) data = " ".join(urllib.urlopen(url).readlines()) return zip( self._PERFORMER_PATTERN.findall(data), self._IMG_PATTERN.findall(data) )
def __init__(self, plugin_id): self._plugin_id = plugin_id self._filter_builder = FilterBuilder(self._plugin_id)