Commit cecd95d1 authored by Francesco Poldi's avatar Francesco Poldi

Handle hidden tweets

parent a025f90d
...@@ -41,14 +41,17 @@ def _output(obj, output, config, **extra): ...@@ -41,14 +41,17 @@ def _output(obj, output, config, **extra):
if config.Lowercase: if config.Lowercase:
if isinstance(obj, str): if isinstance(obj, str):
obj = obj.lower() obj = obj.lower()
elif str(type(obj)) == "<class 'twint.user.user'>": elif obj.__class__.__name__ == "user":
pass pass
else: elif obj.__class__.__name__ == "tweet":
obj.username = obj.username.lower() obj.username = obj.username.lower()
for i in range(len(obj.mentions)): for i in range(len(obj.mentions)):
obj.mentions[i] = obj.mentions[i].lower() obj.mentions[i] = obj.mentions[i].lower()
for i in range(len(obj.hashtags)): for i in range(len(obj.hashtags)):
obj.hashtags[i] = obj.hashtags[i].lower() obj.hashtags[i] = obj.hashtags[i].lower()
else:
print("[x] Hidden tweet found, account suspended due to violation of TOS")
return
if config.Output != None: if config.Output != None:
if config.Store_csv: if config.Store_csv:
try : try :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment