Changeset 39608
- Timestamp:
- 01/02/17 02:33:37 (7 years ago)
- Location:
- titan/mediathek/localhoster
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/mediathek/localhoster/hoster.sh
r39606 r39608 164 164 $BIN $CMD/nowvideo.py $INPUT 165 165 } 166 167 divxstage() 168 { 169 $BIN $CMD/divxstage.py $INPUT 170 } 171 166 172 167 173 if [ "$TYPE" == "get" ];then … … 192 198 streamcloud1) streamcloud $INPUT;; 193 199 nowvideo) nowvideo $INPUT;; 200 divxstage) divxstage $INPUT;; 201 cloudtime) divxstage $INPUT;; 194 202 esac 195 203 fi -
titan/mediathek/localhoster/lib/common.py
r39604 r39608 35 35 IE_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko' 36 36 #FF_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0' 37 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' 37 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' 38 38 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' 39 39 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' -
titan/mediathek/localhoster/openload.py
r38996 r39608 6 6 import re 7 7 import lib.ol_gmu as ol_gmu 8 import lib.common as common 8 9 9 OL_SOURCE = 'https://offshoregit.com/tvaresolvers/ol_gmu.py'10 #OL_SOURCE = 'https://offshoregit.com/tvaresolvers/ol_gmu.py' 10 11 OL_PATH = '' 12 13 API_BASE_URL = 'https://api.openload.co/1' 14 INFO_URL = API_BASE_URL + '/streaming/info' 15 GET_URL = API_BASE_URL + '/streaming/get?file={media_id}' 16 #OL_PATH = os.path.join(common.plugins_path, 'ol_gmu.py') 17 11 18 12 19 class OpenLoadResolver(object): … … 30 37 return False 31 38 39 def i18n(string_id): 40 try: 41 return addon.getLocalizedString(strings.STRINGS[string_id]).encode('utf-8', 'ignore') 42 except Exception as e: 43 # log_utils.log('Failed String Lookup: %s (%s)' % (string_id, e)) 44 return string_id 45 32 46 def get_ol_code(self): 33 47 try: … … 39 53 f.write(new_py) 40 54 except Exception as e: 41 common.log_utils.log_warning('Exception during openload code retrieve: %s' % e) 55 print 'Exception during openload code retrieve:' 56 # common.log_utils.log_warning('Exception during openload code retrieve: %s' % e) 42 57 43 58 def get_media_url(self, host, media_id): 44 # common.log_utils.log('host: %s' % (host)) 45 # common.log_utils.log('media_id: %s' % (media_id)) 46 # common.log_utils.log('OL_PATH: %s' % (OL_PATH)) 59 video_url = "" 47 60 try: 48 # if self.get_setting('auto_update') == 'true': 49 # self.get_ol_code() 50 # with open(OL_PATH, 'r') as f: 51 # py_data = f.read() 52 # common.log_utils.log('py_data: %s' % (py_data)) 53 # common.log_utils.log('ol_gmu hash: %s' % (hashlib.md5(py_data).hexdigest())) 54 # import ol_gmu 55 web_url = self.get_url(host, media_id) 56 # common.log_utils.log('web_url: %s' % (web_url)) 57 print ol_gmu.get_media_url(web_url) 61 self._auto_update(self.get_setting('url'), OL_PATH, self.get_setting('key')) 62 reload(ol_gmu) 63 return ol_gmu.get_media_url(self.get_url(host, media_id)) # @UndefinedVariable 58 64 except Exception as e: 59 # common.log_utils.log_debug('Exception during openload resolve parse: %s' % e) 60 raise 65 # common.log_utils.log_debug('Exception during openload resolve parse: %s' % (e)) 66 try: 67 video_url = self.__check_auth(media_id) 68 if not video_url: 69 video_url = self.__auth_ip(media_id) 70 #except ResolverError: 71 except Exception as e: 72 print "raise" 73 # raise 74 75 if video_url: 76 print video_url 61 77 62 78 def get_url(self, host, media_id): 63 return 'http://openload. io/embed/%s' % media_id79 return 'http://openload.co/embed/%s' % (media_id) 64 80 65 def get_settings_xml(cls): 66 xml = super(cls, cls).get_settings_xml() 67 xml.append('<setting id="%s_auto_update" type="bool" label="Automatically update resolver" default="true"/>' % (cls.__name__)) 68 return xml 81 def __auth_ip(self, media_id): 82 js_data = self.__get_json(INFO_URL) 83 pair_url = js_data.get('result', {}).get('auth_url', '') 84 if pair_url: 85 pair_url = pair_url.replace('\/', '/') 86 header = i18n('ol_auth_header') 87 line1 = i18n('auth_required') 88 line2 = i18n('visit_link') 89 line3 = i18n('click_pair') % (pair_url) 90 with common.kodi.CountdownDialog(header, line1, line2, line3) as cd: 91 return cd.start(self.__check_auth, [media_id]) 92 93 def __check_auth(self, media_id): 94 try: 95 js_data = self.__get_json(GET_URL.format(media_id=media_id)) 96 # except ResolverError as e: 97 except Exception as e: 98 status, msg = e 99 if status == 403: 100 return 101 # else: 102 # raise ResolverError(msg) 103 104 return js_data.get('result', {}).get('url') 105 106 def __get_json(self, url): 107 result = self.net.http_GET(url).content 108 js_result = json.loads(result) 109 # common.log_utils.log_debug(js_result) 110 # if js_result['status'] != 200: 111 # raise ResolverError(js_result['status'], js_result['msg']) 112 return js_result 113 69 114 70 115 sys.stdout = OpenLoadResolver()
Note: See TracChangeset
for help on using the changeset viewer.