V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
cr4fun
V2EX  ›  Python

4chan.org 的图片哈哈哈

  •  
  •   cr4fun · 2018-08-01 20:50:54 +08:00 · 3737 次点击
    这是一个创建于 2304 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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
    
    8 条回复    2018-08-02 16:14:07 +08:00
    cr4fun
        1
    cr4fun  
    OP
       2018-08-01 21:07:38 +08:00 via iPhone
    你们肯定不是为了爬 diy 频道的图片...
    csx163
        2
    csx163  
       2018-08-02 08:57:14 +08:00
    /gif 不错
    cr4fun
        3
    cr4fun  
    OP
       2018-08-02 09:25:10 +08:00
    @csx163 老司机,666 ~
    wangfei324017
        4
    wangfei324017  
       2018-08-02 10:14:35 +08:00
    收藏
    wangfei324017
        5
    wangfei324017  
       2018-08-02 10:16:01 +08:00
    cyang812
        6
    cyang812  
       2018-08-02 11:16:50 +08:00
    Kimipoker
        7
    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
        8
    cr4fun  
    OP
       2018-08-02 16:14:07 +08:00
    if you use linux

    you can :

    python3 get2.py
    it so fast
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2806 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 11:55 · PVG 19:55 · LAX 03:55 · JFK 06:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.