批量下载b站视频列表,下载第二个的时候报错:
    raise URLError(‘unknown url type: %s’ % type)
    urllib.error.URLError: <urlopen error unknown url type: [‘https>

    加上—debug,输出的错误信息为:

    1. Traceback (most recent call last):
    2. File "/home/xiongz/anaconda3/bin/you-get", line 11, in <module>
    3. sys.exit(main())
    4. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/__main__.py", line 92, in main
    5. main(**kwargs)
    6. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/common.py", line 1831, in main
    7. script_main(any_download, any_download_playlist, **kwargs)
    8. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/common.py", line 1719, in script_main
    9. **extra
    10. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/common.py", line 1343, in download_main
    11. download_playlist(url, **kwargs)
    12. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/common.py", line 1827, in any_download_playlist
    13. m.download_playlist(url, **kwargs)
    14. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/extractors/bilibili.py", line 620, in download_playlist_by_url
    15. self.__class__().download_by_url(purl, **kwargs)
    16. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/extractor.py", line 61, in download_by_url
    17. self.download(**kwargs)
    18. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/extractor.py", line 241, in download
    19. av=stream_id in self.dash_streams)
    20. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/common.py", line 1024, in download_urls
    21. headers=headers, **kwargs
    22. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/common.py", line 649, in url_save
    23. chunk_sizes = [url_size(url, faker=faker, headers=tmp_headers) for url in url]
    24. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/common.py", line 649, in <listcomp>
    25. chunk_sizes = [url_size(url, faker=faker, headers=tmp_headers) for url in url]
    26. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/common.py", line 533, in url_size
    27. response = urlopen_with_retry(request.Request(url, headers=headers))
    28. File "/home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/common.py", line 408, in urlopen_with_retry
    29. return request.urlopen(*args, **kwargs)
    30. File "/home/xiongz/anaconda3/lib/python3.6/urllib/request.py", line 223, in urlopen
    31. return opener.open(url, data, timeout)
    32. File "/home/xiongz/anaconda3/lib/python3.6/urllib/request.py", line 526, in open
    33. response = self._open(req, data)
    34. File "/home/xiongz/anaconda3/lib/python3.6/urllib/request.py", line 544, in _open
    35. '_open', req)
    36. File "/home/xiongz/anaconda3/lib/python3.6/urllib/request.py", line 504, in _call_chain
    37. result = func(*args)
    38. File "/home/xiongz/anaconda3/lib/python3.6/urllib/request.py", line 1361, in https_open
    39. context=self._context, check_hostname=self._check_hostname)
    40. File "/home/xiongz/anaconda3/lib/python3.6/urllib/request.py", line 1320, in do_open
    41. raise URLError(err)
    42. urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)>

    解决:
    /home/xiongz/anaconda3/lib/python3.6/site-packages/you_get/__main__.py里添加代码:

    1. import ssl
    2. ssl._create_default_https_context = ssl._create_unverified_context

    就ok了。

    python—urllib.error.URLError:certificate verify failed: unable to get local issuer certificat