Skip to content

Questions about the user object #25

Answered by Egsagon
blacktime1999 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,
As stated in the documentation, the output of client.get_user is a User object.
When printed in the console, only the name of the user is printed for visibility purposes.

In fact, at this point in your code none of the data is actually fetched. This is for optimization purposes. If you want to access data, you need to call it:

user = client.get_user('...')

print(user.url)
print(user.info)
print(user.videos)
# etc.

Note each of these values will be cached once you call them. This means that their value won't refresh, even if the real pornhub values change. You can refresh them using user.refresh().

This behavior is implemented on all PHUB dataclasses (user, video, image, etc.)

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@blacktime1999
Comment options

@blacktime1999
Comment options

@Egsagon
Comment options

@blacktime1999
Comment options

@blacktime1999
Comment options

Answer selected by Egsagon
Comment options

You must be logged in to vote
4 replies
@Egsagon
Comment options

@blacktime1999
Comment options

@blacktime1999
Comment options

@Egsagon
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants