diff --git a/usr/lib/enigma2/python/Plugins/Extensions/vavoo/html_conv.py b/usr/lib/enigma2/python/Plugins/Extensions/vavoo/html_conv.py deleted file mode 100644 index 6eb1dae..0000000 --- a/usr/lib/enigma2/python/Plugins/Extensions/vavoo/html_conv.py +++ /dev/null @@ -1,90 +0,0 @@ -import re -from six import (unichr, iteritems) # ensure_str -from six.moves import html_entities -from six import text_type -import sys -import functools -import itertools -import operator -import types -PY2 = sys.version_info[0] == 2 -PY3 = sys.version_info[0] == 3 - -if PY3: - string_types = str, - integer_types = int, - class_types = type, - text_type = str - binary_type = bytes - - MAXSIZE = sys.maxsize -else: - string_types = basestring, - integer_types = (int, long) - class_types = (type, types.ClassType) - text_type = text_type - binary_type = str - - if sys.platform.startswith("java"): - # Jython always uses 32 bits. - MAXSIZE = int((1 << 31) - 1) - else: - # It's possible to have sizeof(long) != sizeof(Py_ssize_t). - class X(object): - - def __len__(self): - return 1 << 31 - try: - len(X()) - except OverflowError: - # 32-bit - MAXSIZE = int((1 << 31) - 1) - else: - # 64-bit - MAXSIZE = int((1 << 63) - 1) - del X - -_UNICODE_MAP = {k: unichr(v) for k, v in iteritems(html_entities.name2codepoint)} -_ESCAPE_RE = re.compile("[&<>\"']") -_UNESCAPE_RE = re.compile(r"&\s*(#?)(\w+?)\s*;") # Whitespace handling added due to "hand-assed" parsers of html pages -_ESCAPE_DICT = {"&": "&", "<": "<", ">": ">", '"': """, "'": "'"} - - -def ensure_str(s, encoding='utf-8', errors='strict'): - """Coerce *s* to `str`. - - For Python 2: - - `unicode` -> encoded to `str` - - `str` -> `str` - - For Python 3: - - `str` -> `str` - - `bytes` -> decoded to `str` - """ - # Optimization: Fast return for the common case. - if type(s) is str: - return s - if PY2 and isinstance(s, text_type): - return s.encode(encoding, errors) - elif PY3 and isinstance(s, binary_type): - return s.decode(encoding, errors) - elif not isinstance(s, (text_type, binary_type)): - raise TypeError("not expecting type '%s'" % type(s)) - return s - - -def html_escape(value): - return _ESCAPE_RE.sub(lambda match: _ESCAPE_DICT[match.group(0)], ensure_str(value).strip()) - - -def html_unescape(value): - return _UNESCAPE_RE.sub(_convert_entity, ensure_str(value).strip()) - - -def _convert_entity(m): - if m.group(1) == "#": - try: - return unichr(int(m.group(2)[1:], 16)) if m.group(2)[:1].lower() == "x" else unichr(int(m.group(2))) - except ValueError: - return "&#%s;" % m.group(2) - return _UNICODE_MAP.get(m.group(2), "&%s;" % m.group(2)) diff --git a/usr/lib/enigma2/python/Plugins/Extensions/vavoo/plugin.py b/usr/lib/enigma2/python/Plugins/Extensions/vavoo/plugin.py index 06f600c..0382953 100644 --- a/usr/lib/enigma2/python/Plugins/Extensions/vavoo/plugin.py +++ b/usr/lib/enigma2/python/Plugins/Extensions/vavoo/plugin.py @@ -16,7 +16,6 @@ from . import _ from . import vUtils from .Console import Console -from . import html_conv # Standard library imports # Enigma2 components from Components.AVSwitch import AVSwitch @@ -194,8 +193,6 @@ def trace_error(): BakP.append((backName, backName)) except Exception as e: print(e) - - print('final folder back: ', BackPath) # BakP = sorted(BakP, key=lambda x: x[1]) @@ -428,40 +425,6 @@ def loop_sig(): pass -def returnIMDB(text_clear): - TMDB = resolveFilename(SCOPE_PLUGINS, "Extensions/{}".format('TMDB')) - tmdb = resolveFilename(SCOPE_PLUGINS, "Extensions/{}".format('tmdb')) - IMDb = resolveFilename(SCOPE_PLUGINS, "Extensions/{}".format('IMDb')) - text = html_conv.html_unescape(text_clear) - if os.path.exists(TMDB): - try: - from Plugins.Extensions.TMBD.plugin import TMBD - _session.open(TMBD.tmdbScreen, text, 0) - except Exception as e: - print("[XCF] Tmdb: ", str(e)) - return True - - elif os.path.exists(tmdb): - try: - from Plugins.Extensions.tmdb.plugin import tmdb - _session.open(tmdb.tmdbScreen, text, 0) - except Exception as e: - print("[XCF] Tmdb: ", str(e)) - return True - - elif os.path.exists(IMDb): - try: - from Plugins.Extensions.IMDb.plugin import main as imdb - imdb(_session, text) - except Exception as e: - print("[XCF] imdb: ", str(e)) - return True - else: - _session.open(MessageBox, text, MessageBox.TYPE_INFO) - return True - return False - - # check server def raises(url): try: @@ -1448,8 +1411,8 @@ def __init__(self, session, name, url, index, item, cat_list): self.srefInit = self.session.nav.getCurrentlyPlayingServiceReference() self['actions'] = ActionMap(['MoviePlayerActions', 'MovieSelectionActions', 'MediaPlayerActions', 'EPGSelectActions', 'OkCancelActions', 'InfobarShowHideActions', 'InfobarActions', 'DirectionActions', 'InfobarSeekActions'], { - 'epg': self.showIMDB, - 'info': self.showIMDB, + # 'epg': self.showIMDB, + # 'info': self.showIMDB, 'tv': self.cicleStreamType, 'stop': self.leavePlayer, 'cancel': self.cancel, @@ -1562,15 +1525,6 @@ def showinfo(self): pass return - def showIMDB(self): - try: - text_clear = self.name - if returnIMDB(text_clear): - print('show imdb/tmdb') - except Exception as error: - trace_error() - print("Error: can't find Playstream2 in live_to_stream", str(error)) - def openTest(self, servicetype, url): sig = Sig() app = '?n=1&b=5&vavoo_auth=' + str(sig) + '#User-Agent=VAVOO/2.6'