爬 4chan.org 的图片哈哈哈

2018-08-01 20:50:54 +08:00
 cr4fun

https://github.com/pmthink/get_pic_for_4chan

用法:

git clone https://github.com/pmthink/get_pic_for_4chan.git
cd get_pic_for_4chan
pip3 install -r install.txt
python3 get.py
3764 次点击
所在节点    Python
8 条回复
cr4fun
2018-08-01 21:07:38 +08:00
你们肯定不是为了爬 diy 频道的图片...
csx163
2018-08-02 08:57:14 +08:00
/gif 不错
cr4fun
2018-08-02 09:25:10 +08:00
@csx163 老司机,666 ~
wangfei324017
2018-08-02 10:14:35 +08:00
收藏
wangfei324017
2018-08-02 10:16:01 +08:00
cyang812
2018-08-02 11:16:50 +08:00
Kimipoker
2018-08-02 12:11:44 +08:00
$ python3 get.py
http://boards.4chan.org/diy/
Traceback (most recent call last):
File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 384, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse()
File "C:\developer\Python36\lib\http\client.py", line 1331, in getresponse
response.begin()
File "C:\developer\Python36\lib\http\client.py", line 297, in begin
version, status, reason = self._read_status()
File "C:\developer\Python36\lib\http\client.py", line 258, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "C:\developer\Python36\lib\socket.py", line 586, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [WinError 10054] Զ▒▒▒▒▒▒ǿ▒ȹر▒▒▒һ▒▒▒▒▒е▒▒▒▒ӡ▒

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\developer\Python36\lib\site-packages\requests\adapters.py", line 445, in send
timeout=timeout
File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\developer\Python36\lib\site-packages\urllib3\util\retry.py", line 367, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\developer\Python36\lib\site-packages\urllib3\packages\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 384, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "C:\developer\Python36\lib\site-packages\urllib3\connectionpool.py", line 380, in _make_request
httplib_response = conn.getresponse()
File "C:\developer\Python36\lib\http\client.py", line 1331, in getresponse
response.begin()
File "C:\developer\Python36\lib\http\client.py", line 297, in begin
version, status, reason = self._read_status()
File "C:\developer\Python36\lib\http\client.py", line 258, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "C:\developer\Python36\lib\socket.py", line 586, in readinto
return self._sock.recv_into(b)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'Զ▒▒▒▒▒▒ǿ▒ȹر▒▒▒һ▒▒▒▒▒е▒▒▒▒ӡ▒', None, 10054, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "get.py", line 44, in <module>
get_pic("diy")
File "get.py", line 31, in get_pic
get_pics_from_url(channel_url)
File "get.py", line 16, in get_pics_from_url
r = requests.get(url)
File "C:\developer\Python36\lib\site-packages\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "C:\developer\Python36\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\developer\Python36\lib\site-packages\requests\sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)
File "C:\developer\Python36\lib\site-packages\requests\sessions.py", line 622, in send
r = adapter.send(request, **kwargs)
File "C:\developer\Python36\lib\site-packages\requests\adapters.py", line 495, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'Զ▒▒▒▒▒▒ǿ▒ȹر▒▒▒һ▒▒▒▒▒е▒▒▒▒ӡ▒', None, 10054, None))
cr4fun
2018-08-02 16:14:07 +08:00
if you use linux

you can :

python3 get2.py
it so fast

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/476065

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX