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

Cannot format user lookup #562

Closed
ghost opened this issue Oct 31, 2019 · 6 comments
Closed

Cannot format user lookup #562

ghost opened this issue Oct 31, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Oct 31, 2019

Hi guys,

Hope you are all well !

I cannot format the output while doing a lookup on a user.

Any ideas about how to solve this problem ?

import twint

account_id = "953155617098694656"

def getUsername(target):
  c = twint.Config()
  c.User_id = target
  c.Store_object = True
  c.Hide_output = False
  c.Debug = True
  c.Format = "ID {id} | Username {username}"
  twint.run.Lookup(c)
  return twint.output.users_list

if __name__ == "__main__":
  getUsername(account_id)

error triggered

CRITICAL:root:twint.get:User:replace() argument 2 must be str, not None

Best,
X.

@erlendstromsvik
Copy link

You have verified that you get the user details without the format?
I'm asking because I just discovered that I'm only getting Username - 'NoneType' object is not subscriptable on all User searches.

@ghost
Copy link
Author

ghost commented Oct 31, 2019

if I comment c.Format, I have

953155617098694656 | MO7EP | @MO7EPMASRY | Private: 0 | Verified: 0 | Bio:  | Location:  | Url: None | Joined: 15 Jan 2018 10:43 PM | Tweets: 107 | Following: 1986 | Followers: 56 | Likes: 2 | Media: 2 | Avatar: https://abs.twimg.com/sticky/default_profile_images/default_profile_400x400.png

so there is a problem in formatting the outpout

pielco11 added a commit that referenced this issue Nov 1, 2019
@pielco11
Copy link
Member

pielco11 commented Nov 1, 2019

immagine

@ghost
Copy link
Author

ghost commented Nov 1, 2019

works for that but not for csv output... ^^

@pielco11
Copy link
Member

pielco11 commented Nov 1, 2019

@x0rzkov for CSV/JSON output you have to set c.Custom['user']

immagine

@ghost
Copy link
Author

ghost commented Nov 2, 2019

it works, thanks a lot !

@ghost ghost closed this as completed Nov 2, 2019
This issue was closed.
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

2 participants