示例#1
0
    def get_media_url(self, host, media_id):
        try:
            import ol_gmu
            web_url = self.get_url(host, media_id)

            return ol_gmu.get_media_url(web_url)
        except Exception as e:
            common.log_utils.log_debug('Exception during openload resolve parse: %s' % e)
            raise

        # Commented out because, by default, all openload videos no longer work with their API so it's a waste
        #         try:
        #             info_url = 'https://api.openload.io/1/file/info?file=%s' % (media_id)
        #             js_result = self.__get_json(info_url)
        #             if 'result' in js_result and media_id in js_result['result']:
        #                 if js_result['result'][media_id]['status'] != 200:
        #                     raise ResolverError('File Not Available')
        #             ticket_url = 'https://api.openload.io/1/file/dlticket?file=%s' % (media_id)
        #             js_result = self.__get_json(ticket_url)
        #             video_url = 'https://api.openload.io/1/file/dl?file=%s&ticket=%s' % (media_id, js_result['result']['ticket'])
        #             captcha_url = js_result['result'].get('captcha_url', None)
        #             if captcha_url:
        #                 captcha_response = captcha_lib.get_response(captcha_url)
        #                 if captcha_response:
        #                     video_url += '&captcha_response=%s' % urllib.quote(captcha_response)
        #             xbmc.sleep(js_result['result']['wait_time'] * 1000)
        #             js_result = self.__get_json(video_url)
        #             return js_result['result']['url'] + '?mime=true'
        #         except ResolverError:
        #             raise
        #         except Exception as e:
        #             raise ResolverError('Exception in openload: %s' % (e))

        raise ResolverError('Unable to resolve openload.io link. Filelink not found.')
    def get_media_url(self, host, media_id):
        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('ol_gmu hash: %s' %
                                 (hashlib.md5(py_data).hexdigest()))
            import ol_gmu
            web_url = self.get_url(host, media_id)
            return ol_gmu.get_media_url(web_url)
        except Exception as e:
            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:
                raise

            if video_url:
                return video_url
            else:
                raise ResolverError('No OpenLoad Authorization')
示例#3
0
 def get_media_url(self, host, media_id):
     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('ol_gmu hash: %s' % (hashlib.md5(py_data).hexdigest()))
         import ol_gmu
         web_url = self.get_url(host, media_id)
         return ol_gmu.get_media_url(web_url)
     except Exception as e:
         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:
             raise
         
         if video_url:
             return video_url
         else:
             raise ResolverError('No OpenLoad Authorization')
示例#4
0
 def get_media_url(self, host, media_id):
     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('ol_gmu hash: %s' % (hashlib.md5(py_data).hexdigest()))
         import ol_gmu
         web_url = self.get_url(host, media_id)
         return ol_gmu.get_media_url(web_url)
     except Exception as e:
         common.log_utils.log_debug('Exception during openload resolve parse: %s' % e)
         raise
示例#5
0
 def get_media_url(self, host, media_id):
     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('ol_gmu hash: %s' %
                              (hashlib.md5(py_data).hexdigest()))
         import ol_gmu
         web_url = self.get_url(host, media_id)
         return ol_gmu.get_media_url(web_url)
     except Exception as e:
         common.log_utils.log_debug(
             'Exception during openload resolve parse: %s' % e)
         raise
示例#6
0
 def get_media_url(self, host, media_id):
     try:
         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))
         try:
             video_url = self.__check_auth(media_id)
             if not video_url:
                 video_url = self.__auth_ip(media_id)
         except ResolverError:
             raise
         
         if video_url:
             return video_url
         else:
             raise ResolverError(i18n('no_ol_auth'))
示例#7
0
 def get_media_url(self, host, media_id):
     try:
         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:
         logger.log_debug('Exception during openload resolve parse: %s' % (e))
         try:
             if not self.__file_exists(media_id):
                 raise ResolverError('File Not Available')
             
             video_url = self.__check_auth(media_id)
             if not video_url:
                 video_url = self.__auth_ip(media_id)
         except ResolverError:
             raise
         
         if video_url:
             return video_url
         else:
             raise ResolverError(i18n('no_ol_auth'))
示例#8
0
    def get_media_url(self, host, media_id):
        try:
            import ol_gmu
            web_url = self.get_url(host, media_id)

            return ol_gmu.get_media_url(web_url)
        except Exception as e:
            common.log_utils.log_debug(
                'Exception during openload resolve parse: %s' % e)
            raise

        # Commented out because, by default, all openload videos no longer work with their API so it's a waste
        #         try:
        #             info_url = 'https://api.openload.io/1/file/info?file=%s' % (media_id)
        #             js_result = self.__get_json(info_url)
        #             if 'result' in js_result and media_id in js_result['result']:
        #                 if js_result['result'][media_id]['status'] != 200:
        #                     raise ResolverError('File Not Available')
        #             ticket_url = 'https://api.openload.io/1/file/dlticket?file=%s' % (media_id)
        #             js_result = self.__get_json(ticket_url)
        #             video_url = 'https://api.openload.io/1/file/dl?file=%s&ticket=%s' % (media_id, js_result['result']['ticket'])
        #             captcha_url = js_result['result'].get('captcha_url', None)
        #             if captcha_url:
        #                 captcha_response = captcha_lib.get_response(captcha_url)
        #                 if captcha_response:
        #                     video_url += '&captcha_response=%s' % urllib.quote(captcha_response)
        #             xbmc.sleep(js_result['result']['wait_time'] * 1000)
        #             js_result = self.__get_json(video_url)
        #             return js_result['result']['url'] + '?mime=true'
        #         except ResolverError:
        #             raise
        #         except Exception as e:
        #             raise ResolverError('Exception in openload: %s' % (e))

        raise ResolverError(
            'Unable to resolve openload.io link. Filelink not found.')