Questions about the user object #25
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
|
Beta Was this translation helpful? Give feedback.
-
Hi, 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 This behavior is implemented on all PHUB dataclasses (user, video, image, etc.) |
Beta Was this translation helpful? Give feedback.
Hi,
As stated in the documentation, the output of
client.get_user
is aUser
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:
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.)