Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Gifs, Update Stars and Videos #21

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

SashaSZ
Copy link
Contributor

@SashaSZ SashaSZ commented Apr 28, 2022

Added:
Gifs with methods getGifs and getGif, that similar like Videos methods. Sorting parameters: sort_by and period

Updated:

  1. Stars:
    a) Added getStar method, that give more detail information. Also added full_data argument to getStars
    b) Added sorting parameters: period and p_type
  2. Videos: Added sorting parameters: period and region
  3. Client: Added the ability to specify sorting when initializing the client, example:
# Daily most viewed video in Argentina
client = pornhub.PornHub(sort_by="view", period="day", region="ar")
for video in client.getVideos(10, page=2):
    print(video["views"])

@SashaSZ SashaSZ force-pushed the master branch 2 times, most recently from c69d53a to 31c965e Compare April 29, 2022 05:46
@sskender
Copy link
Owner

sskender commented May 3, 2022

Does this fix issues #20 and #22 ?

Copy link
Owner

@sskender sskender left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new feature, so in the future please use feat/<feat_name> branch for this kind of PRs.

Copy link
Owner

@sskender sskender left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you replace using hard coded integers for sorting with enums? It would be a much more elegant way for this kind of job.

https://docs.python.org/3/library/enum.html

@sskender
Copy link
Owner

sskender commented May 3, 2022

This should not be all in one PR. Please, in the future, use feat/<feature_name> branch name for new features and fix/<issue> branch name for fixing bugs. Also, commit messages like Update ... do not tell much about what was changed and for what purpose.

I will merge it after all comments are resolved for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants