Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

[BUG] crash - Twint silent exception due to using invalid parameter for aiohttp-socks ProxyConnector #913

Closed
lmeyerov opened this issue Sep 15, 2020 · 4 comments

Comments

@lmeyerov
Copy link
Contributor

lmeyerov commented Sep 15, 2020

Command Ran

twint -u realDonaldTrump --user-full --proxy-type Socks5 --proxy-port 9050 --proxy-host localhost

from #847

Environment

FROM python:3.7
RUN apt-get update \
    && apt-get install -y --no-install-recommends git vim tor \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

RUN pip install prefect==0.10.1 aiohttp==3.5.4 aiohttp_socks==0.4.1 simplejson twarc neo4j boto3==1.12.39 \
    pandas  pyarrow urlextract 

Test:

service tor start && twint -u realDonaldTrump --user-full --proxy-type Socks5 --proxy-port 9050 --proxy-host localhost

Description of Issue

Twint's tor mode is broken due to incomplete fix 0871376 . It results in a failure due to passing the wrong arguments to aiohttp-socks's new ProxyConnector.

The initial issue seems to be:

  1. Twint's tor call ProxyConnector(socks_ver=ProxyType.SOCKS5, ...

socks_ver=ProxyType.SOCKS5,

  1. Should instead be ProxyConnector(proxy_type=ProxyType.SOCKS5, ...

For reference, see their deprecated internal call: https://github.com/romis2012/aiohttp-socks/blob/67821e3f9913129604c2b4cb216a2ea181e2e570/aiohttp_socks/_deprecated.py#L30

This might fix use of tor ( #847 ), or at least one blocker for it

@lmeyerov lmeyerov changed the title [BUG] crash - Twint tor passing non-working SOCKS version to aiohttp-socks [BUG] crash - Twint silent exception due to using invalid parameter for aiohttp-socks ProxyConnector Sep 15, 2020
@lmeyerov
Copy link
Contributor Author

@lmeyerov
Copy link
Contributor Author

Fixed: #914

Until upstream merge, you can do pip install git+https://github.com/lmeyerov/twint.git@patch-1#egg=twint`

@pielco11
Copy link
Member

Just merged. My bad for not checking that.

Thanks

@LinqLover
Copy link
Contributor

@lmeyerov Can you confirm that your setup still works for you? If I try to reproduce your configuration, twint gives me an error:

root@e1a60d3653e6:/# twint -u realDonaldTrump --user-full --proxy-type Socks5 --proxy-port 9050 --proxy-host localhost
CRITICAL:root:twint.get:User:'NoneType' object is not subscriptable

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants