示例#1
0
 def get_episode_json(code, quality):
     try:
         ret = Tving.get_episode_json(code, quality)
         return ret
     except Exception as e:
         logger.error('Exception:%s', e)
         logger.error(traceback.format_exc())
示例#2
0
文件: basic.py 项目: wnd2da/tving
 def get_episode_json(code, quality):
     try:
         proxy = None
         if ModelSetting.get_bool('use_proxy'):
             proxy = ModelSetting.get('proxy_url')
         ret = Tving.get_episode_json(code, quality, ModelSetting.get('token'), proxy=proxy)
         return ret
     except Exception as e: 
         logger.error('Exception:%s', e)
         logger.error(traceback.format_exc()) 
示例#3
0
 def streaming(cls, req):
     try:
         c_id = req.args.get('contentid')
         quality = Tving.get_quality_to_tving(
             ModelSetting.get('tving_quality'))
         data, url = Tving.get_episode_json(c_id, quality)
         return redirect(url, code=302)
     except Exception as e:
         logger.error('Exception:%s', e)
         logger.error(traceback.format_exc())
示例#4
0
def api(sub):
    if sub == 'decrypt':
        try:
            code = request.args.get('c')
            quality = request.args.get('q')
            token = request.args.get('t')
            token = '_tving_token=%s' % py_urllib.quote(token)
            ret = Tving.get_episode_json(code, quality)
            return ret[1]
        except Exception as e:
            logger.error('Exception:%s', e)
            logger.error(traceback.format_exc())
            return str(e)
示例#5
0
    def streaming(cls, req):
        try:
            c_id = req.args.get('contentid')
            quality = Tving.get_quality_to_tving(ModelSetting.get('tving_quality'))
            proxy = None
            if ModelSetting.get_bool('tving_use_proxy'):
                proxy = ModelSetting.get('tving_proxy_url')

            #data, url = Tving.get_episode_json(c_id, quality, cls.login_data, proxy=proxy, is_live=True)
            # 이건 vod
            data, url = Tving.get_episode_json(c_id, quality, cls.login_data, proxy=proxy)
            return redirect(url, code=302)
        except Exception, e:
            logger.error('Exception:%s', e)
            logger.error(traceback.format_exc())  
示例#6
0
文件: plugin.py 项目: wnd2da/tving
def api(sub):
    if sub == 'decrypt':
        try: 
            code = request.args.get('c')
            quality = request.args.get('q')
            token = request.args.get('t')
            token = '_tving_token=%s' % urllib.quote(token)
            logger.debug(token)
            proxy = None
            if ModelSetting.get_bool('use_proxy'):
                proxy = ModelSetting.get('proxy_url')
            ret = Tving.get_episode_json(code, quality, token, proxy=proxy)
            return ret[1]
        except Exception as e: 
            logger.error('Exception:%s', e)
            logger.error(traceback.format_exc())
            return str(e)        
示例#7
0
    def get_url(cls, source_id, quality, mode):
        try:
            quality = Tving.get_quality_to_tving(quality)
            c_id = source_id
            if source_id.startswith('V'):
                c_id = source_id[1:]

            if Tving.is_drm_channel(source_id):
                return Tving.get_stream_info_by_web('live', c_id, quality)
            else:
                data, url = Tving.get_episode_json(c_id, quality, is_live=True)

                if source_id.startswith('V'):
                    return 'redirect', url
                else:
                    return 'return_after_read', url
        except Exception as e:
            logger.error('Exception:%s', e)
            logger.error(traceback.format_exc())
示例#8
0
    def get_url(cls, source_id, quality, mode):
        #logger.debug('tving get_url:%s %s %s', source_id, quality, cls.login_data)
        try:
            quality = Tving.get_quality_to_tving(quality)
            c_id = source_id
            if source_id.startswith('V'):
                c_id = source_id[1:]
            proxy = None
            if ModelSetting.get_bool('tving_use_proxy'):
                proxy = ModelSetting.get('tving_proxy_url')
            data, url = Tving.get_episode_json(c_id, quality, cls.login_data, proxy=proxy, is_live=True)

            if source_id.startswith('V'):
                return 'redirect', url
            else:
                return 'return_after_read', url
        except Exception as e:
            logger.error('Exception:%s', e)
            logger.error(traceback.format_exc())