Open vivly opened 3 years ago
It looks like this problem has something to do with py-googletrans, and I am not sure why the required google translation library was changed from googletrans to googletransx a while ago for twint, but here is a temporary fix:
pip install googletrans==4.0.0rc1
, only this version of googletrans is working without the error.googletransx
to googletrans
in tweet.py.At least for me, the translation works after these changes, but google translate seems to have a limit on how many translations you can request, so the number of tweets you can translate before it closes is not that many. Also when there is Emojis in the tweet, the translation will not work and will spit out NaN as the translation result.
This seems to be a bug in googletrans, not in twint.
In my program, I was able to translate some tweets, but certain strings, such as tweets with only URLs, caused errors.
So, I think a tentative solution is to return a specific string as the result or ignore the tweet itself when the translation fails in try -exception.
Description of Issue
Console
My Config is
Environment Details