Open wsttxni opened 5 years ago
在 xuetangx.py 文件 第49行
res = CANDY.get('https://xuetangx.com/videoid2source/' + video.meta).text
把 https 改成 http
res = CANDY.get('http://xuetangx.com/videoid2source/' + video.meta).text
作者Foair很久没有出现了
SigureMo有个分支,有bug可以去那提 https://github.com/Foair/course-crawler/issues/23#issue-379527277
下载到最后了,出现了错误,试了两次都是这样,换了电脑也是
网站:学堂在线
课程地址:https://www.xuetangx.com/courses/course-v1%3ATsinghuaX%2B30240243X%2Bsp/about
问题描述: Traceback (most recent call last): File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\urllib3\co ntrib\pyopenssl.py", line 472, in wrap_socket cnx.do_handshake() File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\OpenSSL\SS L.py", line 1915, in do_handshake self._raise_ssl_error(self._ssl, result) File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\OpenSSL\SS L.py", line 1647, in _raise_ssl_error _raise_current_error() File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\OpenSSL_u til.py", line 54, in exception_from_error_queue raise exception_type(errors) OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certific ate verify failed')]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\urllib3\co nnectionpool.py", line 603, in urlopen chunked=chunked) File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\urllib3\co nnectionpool.py", line 344, in _make_request self._validate_conn(conn) File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\urllib3\co nnectionpool.py", line 843, in _validate_conn conn.connect() File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\urllib3\co nnection.py", line 350, in connect sslcontext=context) File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\urllib3\ut il\ssl.py", line 355, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\urllib3\co ntrib\pyopenssl.py", line 478, in wrap_socket raise ssl.SSLError('bad handshake: %r' % e) ssl.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_server_certi ficate', 'certificate verify failed')],)",)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\requests\a dapters.py", line 449, in send timeout=timeout File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\urllib3\co nnectionpool.py", line 641, in urlopen _stacktrace=sys.exc_info()[2]) File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\urllib3\ut il\retry.py", line 399, in increment raise MaxRetryError(pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='xuetangx.com', port= 443): Max retries exceeded with url: /videoid2source/2B96ED0A2F3207729C33DC59013 07461 (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls process_server_certificate', 'certificate verify failed')],)",),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "mooc.py", line 87, in
main()
File "mooc.py", line 66, in main
xuetangx.start(args.url, config, cookies)
File "D:\Konwledge\course-crawler-master\mooc\xuetangx.py", line 210, in start
File "D:\Konwledge\course-crawler-master\mooc\xuetangx.py", line 139, in get_c ontent parse_res_list(video_list, rename, playlist.write, get_video) File "D:\Konwledge\course-crawler-master\mooc\utils.py", line 337, in parse_re s_list res.operation(*operator) File "D:\Konwledge\course-crawler-master\mooc\utils.py", line 56, in operation
File "D:\Konwledge\course-crawler-master\mooc\xuetangx.py", line 49, in get_vi deo res = CANDY.get('https://xuetangx.com/videoid2source/' + video.meta).text File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\requests\s essions.py", line 546, in get return self.request('GET', url, kwargs) File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\requests\s essions.py", line 533, in request resp = self.send(prep, send_kwargs) File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\requests\s essions.py", line 646, in send r = adapter.send(request, **kwargs) File "C:\Users\Swaggy\AppData\Roaming\Python\Python36\site-packages\requests\a dapters.py", line 514, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='xuetangx.com', port=443) : Max retries exceeded with url: /videoid2source/2B96ED0A2F3207729C33DC590130746 1 (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_proc ess_server_certificate', 'certificate verify failed')],)",),))