twintproject / twint

An advanced Twitter scraping & OSINT tool written in Python that doesn't use Twitter's API, allowing you to scrape a user's followers, following, Tweets and more while evading most API limitations.
MIT License
15.68k stars 2.71k forks source link

Can not Save User Object to Ram after twint.run.Lookup(c) #736

Closed DenizDalkilic10 closed 4 years ago

DenizDalkilic10 commented 4 years ago

Command Ran

    conf = twint.Config()
    conf.Username = account_name
    conf.Limit = 1
    conf.Store_object = True
    conf.User_full = True
    twint.run.Lookup(conf)
    accounts = twint.output.users_list
    return accounts[0]

Description of Issue

Can not Retrieve User Object to Ram after twint.run.Lookup(c) and twint.output.users_list. I believe that using twint.output.users_list after calling Lookup is wrong but could not find a correct version in the Wiki for saving a specific account as an User object

Environment Details

Windows and Pycharm

pielco11 commented 4 years ago
import twint

c = twint.Config()
c.Username = "twitter"
c.Store_object = True

twint.run.Lookup(c)

user = twint.output.users_list[0]
print(user.join_date)
minimaxir commented 4 years ago

That test case doesn't appear to work on master post 8dbe139; it did however work on previous versions. (last working version was 2.1.18)

pielco11 commented 4 years ago

@minimaxir May you post a screenshot where you show the imported version of Twint of the code executed?

luouis commented 4 years ago

Hi @pielco11 , I am using 2.1.20 and I have the same problem, twint.output.users_list returns an empty list.

pielco11 commented 4 years ago

image may you reproduce this, please?

lxcode commented 4 years ago

Same here, it's empty.

[lx@host ~ 1363 ] pip3 show twint
Name: twint
Version: 2.1.20
Summary: An advanced Twitter scraping & OSINT tool.
Home-page: https://github.com/twintproject/twint
Author: Cody Zacharias
Author-email: codyzacharias@pm.me
License: MIT
Location: /usr/local/lib/python3.7/site-packages
Requires: aiohttp-socks, cchardet, aiohttp, fake-useragent, pandas, beautifulsoup4, elasticsearch, aiodns, schedule, googletransx, geopy, pysocks
Required-by: 

[lx@host ~ 1364 ] python3.7 /tmp/foo.py 
CRITICAL:root:twint.get:User:'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/tmp/foo.py", line 7, in <module>
    user = twint.output.users_list[0]
IndexError: list index out of range

[lx@host ~ 1365 ] cat /tmp/foo.py 
import twint

c = twint.Config()
c.Username = "twitter"
c.Store_object = True
twint.run.Lookup(c)
user = twint.output.users_list[0]
print(user.join_date)
print(twint.__version__)
jc-a3s commented 4 years ago

I have the same issue but I was able to reproduce both cases: failure and success. When you install pointing directly to Github repo (with editable mode or not - doesn't matter): pip3 install --user --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint it works but when you just execute: pip3 install twint it doesn't work. It seems that for both cases version is the same: 2.1.20. As I can see last version on pypi.org has been pushed on 29th April but master on Github has been updated in last month, so probably it contains fix for this issue.