Comments (3)
System
In win10
[ten_years] PS C:\Users\we> conda list
# packages in environment at D:\ProgramData\Anaconda2\envs\ten_years:
#
certifi 2016.2.28 py36_0
pafy 0.5.3.1 <pip>
pip 9.0.1 py36_1
python 3.6.2 0
setuptools 36.4.0 py36_1
vs2015_runtime 14.0.25420 0
wheel 0.29.0 py36_0
wincertstore 0.2 py36_0
youtube-dl 2017.9.24 <pip>
run
>>> import pafy
>>> url = "https://www.youtube.com/watch?v=3Ikq55DyX34"
>>> video = pafy.new(url)
Error:
ERROR: Unable to download webpage: <urlopen error [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。> (caused by URLError(TimeoutError(10060, '由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。', None, 10060, None),))
Traceback (most recent call last):
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\urllib\request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\http\client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\http\client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\http\client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\http\client.py", line 1026, in _send_output
self.send(msg)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\http\client.py", line 964, in send
self.connect()
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\http\client.py", line 936, in connect
(self.host,self.port), self.timeout, self.source_address)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\socket.py", line 722, in create_connection
raise err
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\socket.py", line 713, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\extractor\common.py", line 503, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\YoutubeDL.py", line 2178, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\urllib\request.py", line 526, in open
response = self._open(req, data)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\urllib\request.py", line 544, in _open
'_open', req)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\utils.py", line 930, in http_open
req)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\urllib\request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\YoutubeDL.py", line 777, in extract_info
ie_result = ie.extract(url)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\extractor\common.py", line 434, in extract
ie_result = self._real_extract(url)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\extractor\youtube.py", line 1488, in _real_extract
video_webpage = self._download_webpage(url, video_id)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\extractor\youtube.py", line 252, in _download_webpage
*args, **compat_kwargs(kwargs))
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\extractor\common.py", line 635, in _download_webpage
res = self._download_webpage_handle(url_or_request, video_id, note, errnote, fatal, encoding=encoding, data=data, headers=headers, query=query)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\extractor\common.py", line 532, in _download_webpage_handle
urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\extractor\common.py", line 512, in _request_webpage
raise ExtractorError(errmsg, sys.exc_info()[2], cause=err)
youtube_dl.utils.ExtractorError: Unable to download webpage: <urlopen error [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。> (caused by URLError(TimeoutError(10060, '由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。', None, 10060, None),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\pafy\backend_youtube_dl.py", line 38, in _fetch_basic
self._ydl_info = ydl.extract_info(self.videoid, download=False)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\YoutubeDL.py", line 800, in extract_info
self.report_error(compat_str(e), e.format_traceback())
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\YoutubeDL.py", line 605, in report_error
self.trouble(error_message, tb)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\youtube_dl\YoutubeDL.py", line 575, in trouble
raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: Unable to download webpage: <urlopen error [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。> (caused by URLError(TimeoutError(10060, '由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。', None, 10060, None),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\pafy\pafy.py", line 122, in new
return Pafy(url, basic, gdata, size, callback, ydl_opts)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\pafy\backend_youtube_dl.py", line 29, in __init__
super(YtdlPafy, self).__init__(*args, **kwargs)
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\pafy\backend_shared.py", line 96, in __init__
self._fetch_basic()
File "D:\ProgramData\Anaconda2\envs\ten_years\lib\site-packages\pafy\backend_youtube_dl.py", line 41, in _fetch_basic
raise IOError(str(e).replace('YouTube said', 'Youtube says'))
OSError: ERROR: Unable to download webpage: <urlopen error [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。> (caused by URLError(TimeoutError(10060, '由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。', None, 10060, None),))
使用 ss PAC模式.
from gopython.
根据错误: urlopen error WinError 10060 youtube-dl 搜索答案, 没有解决办法.
暂时止损, 放弃.
有空在linux系统上尝试.
from gopython.
在 Linux mint 上使用:
anifacc@mint /media/anifacc/geek/youtube_download $ pipenv graph
pafy==0.5.3.1
youtube-dl==2017.10.1
anifacc@mint /media/anifacc/geek/youtube_download $ pipenv shell
Spawning environment shell (/bin/bash). Use 'exit' to leave.
source /home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/bin/activate
anifacc@mint /media/anifacc/geek/youtube_download $ source /home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/bin/activate
(youtube_download-YJRREo8d) anifacc@mint /media/anifacc/geek/youtube_download $ python
Python 3.5.2 (default, Aug 18 2017, 17:48:00)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pafy
>>> url = "https://www.youtube.com/watch?v=bMt47wvK6u0"
>>> video = pafy.new(url)
ERROR: Unable to download webpage: <urlopen error [Errno 110] Connection timed out> (caused by URLError(TimeoutError(110, 'Connection timed out'),))
Traceback (most recent call last):
File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/lib/python3.5/http/client.py", line 1106, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.5/socket.py", line 711, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 702, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/extractor/common.py", line 503, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 2184, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python3.5/urllib/request.py", line 466, in open
response = self._open(req, data)
File "/usr/lib/python3.5/urllib/request.py", line 484, in _open
'_open', req)
File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/utils.py", line 930, in http_open
req)
File "/usr/lib/python3.5/urllib/request.py", line 1256, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 783, in extract_info
ie_result = ie.extract(url)
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/extractor/common.py", line 434, in extract
ie_result = self._real_extract(url)
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/extractor/youtube.py", line 1488, in _real_extract
video_webpage = self._download_webpage(url, video_id)
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/extractor/youtube.py", line 252, in _download_webpage
*args, **compat_kwargs(kwargs))
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/extractor/common.py", line 635, in _download_webpage
res = self._download_webpage_handle(url_or_request, video_id, note, errnote, fatal, encoding=encoding, data=data, headers=headers, query=query)
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/extractor/common.py", line 532, in _download_webpage_handle
urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query)
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/extractor/common.py", line 512, in _request_webpage
raise ExtractorError(errmsg, sys.exc_info()[2], cause=err)
youtube_dl.utils.ExtractorError: Unable to download webpage: <urlopen error [Errno 110] Connection timed out> (caused by URLError(TimeoutError(110, 'Connection timed out'),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/pafy/backend_youtube_dl.py", line 38, in _fetch_basic
self._ydl_info = ydl.extract_info(self.videoid, download=False)
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 806, in extract_info
self.report_error(compat_str(e), e.format_traceback())
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 611, in report_error
self.trouble(error_message, tb)
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/youtube_dl/YoutubeDL.py", line 581, in trouble
raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: Unable to download webpage: <urlopen error [Errno 110] Connection timed out> (caused by URLError(TimeoutError(110, 'Connection timed out'),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/pafy/pafy.py", line 122, in new
return Pafy(url, basic, gdata, size, callback, ydl_opts)
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/pafy/backend_youtube_dl.py", line 29, in __init__
super(YtdlPafy, self).__init__(*args, **kwargs)
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/pafy/backend_shared.py", line 96, in __init__
self._fetch_basic()
File "/home/anifacc/.local/share/virtualenvs/youtube_download-YJRREo8d/lib/python3.5/site-packages/pafy/backend_youtube_dl.py", line 41, in _fetch_basic
raise IOError(str(e).replace('YouTube said', 'Youtube says'))
OSError: ERROR: Unable to download webpage: <urlopen error [Errno 110] Connection timed out> (caused by URLError(TimeoutError(110, 'Connection timed out'),))
出现同样问题. 是 网络连接不上 youtube的问题. ss 无法从 shell 中 科学上网.
还是使用 youtube 下载的 firefox 插件. 等以后有精力再来尝试.
from gopython.
Related Issues (10)
- Install Linux mint 18.1 Serena Cinnamon Edititon log HOT 8
- git push issue: Support for password authentication was removed HOT 1
- 有道词典安装 Linux mint
- 路益士中文网站部署 http://jeremyanifaccc.pythonanywhere.com/
- How to install python 3.6 in Linux mint 18.1? HOT 3
- Set up Python virtual environment in Linux Mint 18.1 HOT 6
- Pipenv install numpy failed! HOT 2
- Sina 新浪博文中文名乱码问题(博文批量下载)
- Linux Mint(32bit) install ss-qt5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gopython.