threads.py 文件源码

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

项目:tvlinker 作者: ozmartian 项目源码 文件源码
def connect(self, endpoint: str, payload: object=None) -> object:
        try:
            headers = {
                'Authorization': 'Bearer %s' % self.api_token,
                'Content-Type': 'application/x-www-form-urlencoded',
                'Cache-Control': 'no-cache'
            }
            res = requests.post('%s%s' % (self.api_url, endpoint), headers=headers, data=payload,
                                proxies=self.proxy, verify=False)
            return res.json()
        except HTTPError:
            print(sys.exc_info())
            QMessageBox.critical(self, 'ERROR NOTIFICATION',
                                 '<h3>Real-Debrid API Error</h3>' +
                                 'A problem occurred whilst communicating with Real-Debrid. Please check your '
                                 'Internet connection.<br/><br/>' +
                                 '<b>ERROR LOG:</b><br/>(Error Code %s) %s<br/>%s'
                                 % (qApp.applicationName(), HTTPError.code, HTTPError.reason), QMessageBox.Ok)
            # self.exit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号