Index: /titan/mediathek/localhoster/divxstage.py
===================================================================
--- /titan/mediathek/localhoster/divxstage.py	(revision 39608)
+++ /titan/mediathek/localhoster/divxstage.py	(revision 39608)
@@ -0,0 +1,69 @@
+
+import sys
+import re
+from lib.net import Net
+import lib.common as common
+from lib import helpers
+
+class DivxstageResolver(object):
+    name = 'divxstage'
+    domains = ['divxstage.eu', 'divxstage.net', 'divxstage.to', 'cloudtime.to']
+    pattern = '(?://|\.)(divxstage.eu|divxstage.net|divxstage.to|cloudtime.to)/(?:video/|embed/\?v=)([A-Za-z0-9]+)'
+
+    def __init__(self):
+        self.net = Net()
+        url = str(sys.argv[1])
+        host = self.get_host_and_id(url)[0]
+        media_id = self.get_host_and_id(url)[1]
+
+        return self.get_media_url(host, media_id)
+
+    def get_host_and_id(self, url):
+        r = re.search(self.pattern, url, re.I)
+        if r:
+            return r.groups()
+        else:
+            return False
+
+    def get_media_url(self, host, media_id):
+        web_url = self.get_url(host, media_id)
+        headers = {'User-Agent': common.FF_USER_AGENT}
+        stream_url = ''
+        html = self.net.http_GET(web_url, headers=headers).content
+        try:
+            r = re.search('flashvars.filekey=(.+?);', html)
+            if r:
+                r = r.group(1)
+
+                try: filekey = re.compile('\s+%s="(.+?)"' % r).findall(html)[-1]
+                except: filekey = r
+
+                player_url = 'http://www.nowvideo.sx/api/player.api.php?key=%s&file=%s' % (filekey, media_id)
+
+                html = self.net.http_GET(player_url).content
+
+                r = re.search('url=(.+?)&', html)
+
+                if r:
+                    stream_url = r.group(1)
+        except:
+            print "no embedded urls found using first method"
+            
+        try:
+            r = re.search('id="player".*?src="(.*?)"', html, re.DOTALL)
+            if r:
+                stream_url = r.group(1)
+            
+        except:
+            print "no embedded urls found using second method"
+
+        if stream_url:
+            headers.update({'Referer': web_url, })
+            print stream_url + helpers.append_headers(headers)
+#           print stream_url + helpers.append_headers({'Referer': web_url})
+
+ 
+    def get_url(self, host, media_id):
+        return 'http://www.cloudtime.to/embed/?v=%s' % media_id
+
+sys.stdout = DivxstageResolver()
Index: /titan/mediathek/localhoster/hoster.sh
===================================================================
--- /titan/mediathek/localhoster/hoster.sh	(revision 39607)
+++ /titan/mediathek/localhoster/hoster.sh	(revision 39608)
@@ -164,4 +164,10 @@
 	$BIN $CMD/nowvideo.py $INPUT
 }
+
+divxstage()
+{
+	$BIN $CMD/divxstage.py $INPUT
+}
+
 
 if [ "$TYPE" == "get" ];then
@@ -192,4 +198,6 @@
 		streamcloud1) streamcloud $INPUT;;	
 		nowvideo) nowvideo $INPUT;;
+		divxstage) divxstage $INPUT;;
+		cloudtime) divxstage $INPUT;;
 	esac
 fi
Index: /titan/mediathek/localhoster/lib/common.py
===================================================================
--- /titan/mediathek/localhoster/lib/common.py	(revision 39607)
+++ /titan/mediathek/localhoster/lib/common.py	(revision 39608)
@@ -35,5 +35,5 @@
 IE_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko'
 #FF_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0'
-FF_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.7.3000 Chrome/30.0.1599.101 Safari/537.36' 
+FF_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.7.3000 Chrome/30.0.1599.101 Safari/537.36'
 OPERA_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36 OPR/34.0.2036.50'
 IOS_USER_AGENT = 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25'
Index: /titan/mediathek/localhoster/openload.py
===================================================================
--- /titan/mediathek/localhoster/openload.py	(revision 39607)
+++ /titan/mediathek/localhoster/openload.py	(revision 39608)
@@ -6,7 +6,14 @@
 import re
 import lib.ol_gmu as ol_gmu
+import lib.common as common
 
-OL_SOURCE = 'https://offshoregit.com/tvaresolvers/ol_gmu.py'
+#OL_SOURCE = 'https://offshoregit.com/tvaresolvers/ol_gmu.py'
 OL_PATH = ''
+
+API_BASE_URL = 'https://api.openload.co/1'
+INFO_URL = API_BASE_URL + '/streaming/info'
+GET_URL = API_BASE_URL + '/streaming/get?file={media_id}'
+#OL_PATH = os.path.join(common.plugins_path, 'ol_gmu.py')
+
 
 class OpenLoadResolver(object):
@@ -30,4 +37,11 @@
             return False
 
+    def i18n(string_id):
+        try:
+            return addon.getLocalizedString(strings.STRINGS[string_id]).encode('utf-8', 'ignore')
+        except Exception as e:
+#            log_utils.log('Failed String Lookup: %s (%s)' % (string_id, e))
+            return string_id
+
     def get_ol_code(self):
         try:
@@ -39,32 +53,63 @@
                     f.write(new_py)
         except Exception as e:
-            common.log_utils.log_warning('Exception during openload code retrieve: %s' % e)
+             print 'Exception during openload code retrieve:'
+#            common.log_utils.log_warning('Exception during openload code retrieve: %s' % e)
             
     def get_media_url(self, host, media_id):
-#        common.log_utils.log('host: %s' % (host))
-#        common.log_utils.log('media_id: %s' % (media_id))
-#        common.log_utils.log('OL_PATH: %s' % (OL_PATH))
+        video_url = ""
         try:
-#            if self.get_setting('auto_update') == 'true':
-#                self.get_ol_code()
-#            with open(OL_PATH, 'r') as f:
-#                py_data = f.read()
-#            common.log_utils.log('py_data: %s' % (py_data))
-#            common.log_utils.log('ol_gmu hash: %s' % (hashlib.md5(py_data).hexdigest()))
-#            import ol_gmu
-            web_url = self.get_url(host, media_id)
-#            common.log_utils.log('web_url: %s' % (web_url))
-            print ol_gmu.get_media_url(web_url)
+            self._auto_update(self.get_setting('url'), OL_PATH, self.get_setting('key'))
+            reload(ol_gmu)
+            return ol_gmu.get_media_url(self.get_url(host, media_id))  # @UndefinedVariable
         except Exception as e:
-#            common.log_utils.log_debug('Exception during openload resolve parse: %s' % e)
-            raise
+#            common.log_utils.log_debug('Exception during openload resolve parse: %s' % (e))
+            try:
+                video_url = self.__check_auth(media_id)
+                if not video_url:
+                    video_url = self.__auth_ip(media_id)
+            #except ResolverError:
+            except Exception as e:
+                print "raise"
+               # raise
+            
+            if video_url:
+                print video_url
 
     def get_url(self, host, media_id):
-        return 'http://openload.io/embed/%s' % media_id
+        return 'http://openload.co/embed/%s' % (media_id)
 
-    def get_settings_xml(cls):
-        xml = super(cls, cls).get_settings_xml()
-        xml.append('<setting id="%s_auto_update" type="bool" label="Automatically update resolver" default="true"/>' % (cls.__name__))
-        return xml
+    def __auth_ip(self, media_id):
+        js_data = self.__get_json(INFO_URL)
+        pair_url = js_data.get('result', {}).get('auth_url', '')
+        if pair_url:
+            pair_url = pair_url.replace('\/', '/')
+            header = i18n('ol_auth_header')
+            line1 = i18n('auth_required')
+            line2 = i18n('visit_link')
+            line3 = i18n('click_pair') % (pair_url)
+            with common.kodi.CountdownDialog(header, line1, line2, line3) as cd:
+                return cd.start(self.__check_auth, [media_id])
+        
+    def __check_auth(self, media_id):
+        try:
+            js_data = self.__get_json(GET_URL.format(media_id=media_id))
+#        except ResolverError as e:
+        except Exception as e:
+            status, msg = e
+            if status == 403:
+                return
+#            else:
+#                raise ResolverError(msg)
+        
+        return js_data.get('result', {}).get('url')
+    
+    def __get_json(self, url):
+        result = self.net.http_GET(url).content
+        js_result = json.loads(result)
+#        common.log_utils.log_debug(js_result)
+#        if js_result['status'] != 200:
+#            raise ResolverError(js_result['status'], js_result['msg'])
+        return js_result
+
 
 sys.stdout = OpenLoadResolver()
