Twint: CRITICAL:root:twint.get:User:'NoneType' object is not subscriptable + Unicode issues

Created on 23 Mar 2019  Â·  16Comments  Â·  Source: twintproject/twint

Issue Template

Please use this template!

Initial Check

If the issue is a request please specify that it is a request in the title (Example: [REQUEST] more features). If this is a question regarding 'twint' please specify that it's a question in the title (Example: [QUESTION] What is x?). Please only submit issues related to 'twint'. Thanks.

Make sure you've checked the following:

  • [x] Python version is 3.6;
  • [x] Updated Twint with pip3 install --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint;
  • [x] I have searched the issues and there are no duplicates of this issue/question/request.

Command Ran

Please provide the _exact_ command ran including the username/search/code so I may reproduce the issue.

$ twint -u lozgarrido -s hola

Description of Issue

Please use as much detail as possible.

First of all, thank you for your work developing and supporting the tool. That's my first issue —I'm newbie at this—, so I'm sorry too if I'm doing something too obvious wrong.

My problem is similar to this, but I've not been able to know what's happening: https://github.com/twintproject/twint/issues/352#issue-408486834

This is the complete output of previous command with Git:

imagen

As you can see, I have two types of error:

  1. It is repeated once for every missing character inside the scraped tweets. I've changed Git's encoding options, but nothing happens. I guess it could be Python or Anaconda's problem, maybe? A colleague uses Twint on Mac without any problem with emojis or special characters.

CRITICAL:root:twint.output:_output:UnicodeEncodeError
unicode error [x] output._output

  1. Which I don't understand at all and happens with all queries.

CRITICAL:root:twint.get:User:'NoneType' object is not subscriptable
'NoneType' object is not subscriptable [x] get.User

Thank you so much for your help and patience.

Update 1:

Tried with Win Command Prompt. Unicode errors disappear (it just doesn't show emojis), but NoneType remains. Where I had unicode error [x] output._output, I can see the tweet. I guess codification problems are related to Git. I will look for more info on that.

imagen

Update 2:

NoneType is everywhere when I make other queries. Next screenshot with $ twint -u lozgarrido --following --user-full:

imagen

Environment Details

Using Windows, Linux? What OS version? Running this in Anaconda? Jupyter Notebook? Terminal?

Clean installation of Windows 10. Working on Git+Anaconda up to date.

Compatibility

All 16 comments

I tried your query and this is what I get
immagine

I do not know where those CRITICAL:root:twint.get:User:'NoneType' object is not subscriptable are coming from

Thanks for your reply, @pielco11. That seems perfect.

The truth is, I'm pretty lost. Are you on Windows? Maybe I could try with different tools...

Currently I'm on Ubuntu

Updated main post.

I'm going to keep looking for a solution in the next few days. If I don't get it I will end up installing Ubuntu.

Anyway, thanks again for your time.

@lozgarrido did you end up installing ubuntu? I have exactly the same problem.

@NaRuecker I was able to avoid NoneType errors with Windows Subsystem for Linux. Unfortunately, pure Windows+Twint still doesn't work properly for me.

@lozgarrido thank you for letting us know that Windows+Twint does not work properly

Added Compatibility label

Edit:
just to be sure, may you run pip3 install --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint and then re-try? It seems that you are having errors related to an old and already patched issue

Tried to run the code below on both Windows and Ubuntu for a random account. Got the NoneType error for all followers except two.

#!/usr/bin/python3

import twint
c = twint.Config()
c.Username = "hannegraat"
c.Store_csv = True
c.User_full = True
c.Output = "users.csv"
twint.run.Followers(c)

изображение

Tried it with another username: RocioMV2 (312 followers). Only 13 as a result. All of them private btw.
изображение

same error now on ubuntu.
CRITICAL:root:twint.get:User:'NoneType' object is not subscriptable
This error happen on "twint -u " not on "twint -s".

Twint is up to date (I redid pip3 install --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint)

Fresh install of Twint

immagine

Trying the @Konstantin555 query

immagine

Trying something with "twint -u"

immagine

immagine

If we look closer, nothing "wrong" happens

immagine

Since the supposed missing tweet, is missing, so nothing is missed

immagine

So maybe when Twint makes a new request to get other tweets, it's not properly handling the response, but it's still working

Sorry I get this now:

CRITICAL:root:twint.get:User:'NoneType' object is not subscriptable

And afterwards, the tweets:
1126462919963705344 2019-05-09 14:24:23 Hora de verano romance @atleti pongan los 80M de Lucas https://twitter.com/rubenuria/status/1126445234769014784 …
1126403330123665408 2019-05-09 10:27:36 Hora de verano romance Este tío es un hijo de la gran puta. No convoca a ninguna jugadora del Barça pero si a las del Atleti qu
e también tienen una final este sábado. https://twitter.com/SeFutbolFem/status/1126161332598919170 …

And with this:

import twint

c = twint.Config()
c.Username = "RobertoEntio"
c.Since = "2019-05-01"
c.Until = "2019-05-10"

twint.run.Lookup(c)

CRITICAL:root:twint.get:User:'NoneType' object is not subscriptable

Process finished with exit code 0

Is it because he probably hasn’t any info in his account?. Could anyone provide me a account with Lookup info?, just to try with another one. Thank you!

@AntonioNieto92 please don't crosspost. There's already an issue where you did post the same comment

We can continue the discussion here, or there #414. Not both

So sorry 😔. Do you recommend any VPN or something in order not to be banned by Twitter?

@AntonioNieto92 no problem

I do not have any VPN to recommend, I guess that a random one should be enough

pip3 install --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint

yup, that did it

Was this page helpful?
0 / 5 - 0 ratings