ps_vue.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:plugin.video.psvue 作者: eracknaphobia 项目源码 文件源码
def get_json(url):
    headers = {'Accept': '*/*',
               'reqPayload': ADDON.getSetting(id='EPGreqPayload'),
               'User-Agent': UA_ANDROID_TV,
               'Accept-Encoding': 'gzip, deflate, br',
               'Accept-Language': 'en-US,en;q=0.5',
               'X-Requested-With': 'com.snei.vue.android',
               'Connection': 'keep-alive'
              }

    r = requests.get(url, headers=headers, cookies=load_cookies(), verify=VERIFY)

    if r.status_code != 200:
        dialog = xbmcgui.Dialog()
        msg = 'The request could not be completed.'
        try:
            json_source = r.json()
            msg = json_source['header']['error']['message']
        except:
            pass
        dialog.notification('Error '+str(r.status_code), msg, xbmcgui.NOTIFICATION_INFO, 9000)
        sys.exit()

    return r.json()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号