Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urllib2.URLError: <urlopen error [Errno 111] Connection refused> #24

Open
kaytrance opened this issue Feb 10, 2015 · 0 comments
Open

urllib2.URLError: <urlopen error [Errno 111] Connection refused> #24

kaytrance opened this issue Feb 10, 2015 · 0 comments

Comments

@kaytrance
Copy link

Started to get this messages now.
Any ideas how to skip urls that cause connection refused exception?
Here's the output log

Downloading images from "unixporn" subreddit
Attempting to download URL [http://i.minus.com/ibbOA7nTrGwmOK.png] as [2vc6eu.png].
URL ERROR: http://i.minus.com/ibbOA7nTrGwmOK.png!
Attempting to download URL [http://i.imgur.com/4Q79met.jpg] as [2vb0qz.jpg].
URL [http://i.imgur.com/4Q79met.jpg] already downloaded.
Attempting to download URL [https://i.imgur.com/UpQ1BkU.jpg] as [2vc7yk.jpg].
URL [https://i.imgur.com/UpQ1BkU.jpg] already downloaded.
Attempting to download URL [https://www.youtube.com/watch?v=q2nEIJpzLMQ&hd=1] as [2vc2nb].
WRONG FILE TYPE: https://www.youtube.com/watch?v=q2nEIJpzLMQ&amp;hd=1 has type: text/html; charset=utf-8!
Attempting to download URL [https://u.teknik.io/0g6q7Y.png] as [2va26r.png].
URL [https://u.teknik.io/0g6q7Y.png] already downloaded.
Attempting to download URL [http://www.reddit.com/r/unixporn/comments/2vdh80/text_field_bar/] as [2vdh80].
WRONG FILE TYPE: http://www.reddit.com/r/unixporn/comments/2vdh80/text_field_bar/ has type: text/html; charset=UTF-8!
Attempting to download URL [http://i.imgur.com/ew2dYjO.jpg] as [2v8dj9.jpg].
URL [http://i.imgur.com/ew2dYjO.jpg] already downloaded.
Attempting to download URL [http://i.imgur.com/lpR8GKH.jpg] as [2v91ln_0.jpg].
URL [http://i.imgur.com/lpR8GKH.jpg] already downloaded.
Attempting to download URL [http://i.imgur.com/8WNnHcJ.jpg] as [2v91ln_0.jpg].
URL [http://i.imgur.com/8WNnHcJ.jpg] already downloaded.
Attempting to download URL [http://i.imgur.com/6NTHSUy.jpg] as [2v91ln_0.jpg].
URL [http://i.imgur.com/6NTHSUy.jpg] already downloaded.
Attempting to download URL [http://i.imgur.com/WtLRprC.jpg] as [2v7r1b_0.jpg].
Sucessfully downloaded URL [http://i.imgur.com/WtLRprC.jpg] as [2v7r1b_0.jpg].
Attempting to download URL [http://i.imgur.com/fFD1amp.jpg] as [2v7r1b_1.jpg].
Sucessfully downloaded URL [http://i.imgur.com/fFD1amp.jpg] as [2v7r1b_1.jpg].
Attempting to download URL [http://i.imgur.com/u6N8fjK.jpg] as [2v7r1b_2.jpg].
URL ERROR: http://i.imgur.com/u6N8fjK.jpg!
Attempting to download URL [http://i.imgur.com/WtLRprC.jpg] as [2v7r1b_2.jpg].
URL ERROR: http://i.imgur.com/WtLRprC.jpg!
Attempting to download URL [http://i.imgur.com/fFD1amp.jpg] as [2v7r1b_2.jpg].
URL ERROR: http://i.imgur.com/fFD1amp.jpg!
Attempting to download URL [http://i.imgur.com/u6N8fjK.jpg] as [2v7r1b_2.jpg].
URL ERROR: http://i.imgur.com/u6N8fjK.jpg!
Attempting to download URL [http://i.imgur.com/BxwrfRi.jpg] as [2v80q5.jpg].
URL ERROR: http://i.imgur.com/BxwrfRi.jpg!
Traceback (most recent call last):
File "/home/ubuntu/workspace/RedditImageGrab/redditdownload.py", line 269, in
URLS = extract_urls(ITEM['url'])
File "/home/ubuntu/workspace/RedditImageGrab/redditdownload.py", line 195, in extract_urls
urls = process_imgur_url(url)
File "/home/ubuntu/workspace/RedditImageGrab/redditdownload.py", line 140, in process_imgur_url
return extract_imgur_album_urls(url)
File "/home/ubuntu/workspace/RedditImageGrab/redditdownload.py", line 58, in extract_imgur_album_urls
response = urlopen(album_url)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1214, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 111] Connection refused>

Thanks

rachmadaniHaryono referenced this issue in rachmadaniHaryono/RedditImageGrab Aug 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant