Releases: EchterAlsFake/PHUB
Releases · EchterAlsFake/PHUB
v4.4
Changelog
- Added package headers
- Added
video.is_HD
,video.is_VR
,video.embed
- For authentified accounts, started using
client._granted_token
instead of parsing one on each video page. Helps not fetching the video page when interractions are needed (TODO - Use the first encountered video page instead of the home page for optimisation since the video page is more likely to be fetched afterwards anyway and the home page is heavy). video.fetch
key argument can take a third type of key:<datakey>|<pagekey>
. The key that requires the least effort will be fetched considering the already cached data and page mediaDefinitions.- Fixed
video._assert_internal_success
not reporting errors - Overall improvements on video properties cache
- Disabled query emulation using playlists by default. If you attempt to use a video property that requires query data, and the video does not come from a VideoQuery, an error will be raised unless you set
video.ALLOW_QUERY_SIMULATION = True
. This is supposed to be dissuasive since the manipulation is costly, especially while used in a video iterator. - Implemented the #43 suggestion while keeping the old properties.
- Video objects now keep track of their parent queries.
- Quality object are a bit more permissive with the input value and can take values of the form '144p' and others.
- Improved the object representations of Queries and Quality objects
v4.3.2
v4.3.1
v4.3
Changelog
- Typo fixes by @EchterAlsFake (#35)
- [BREAKING] Removed the
Client.search
feature
argument. Instead, use the booleanuse_hubtraffic
to specify if you want to use a JSONQuery or an HTMLQuery - [BREAKING] Removed
Client.search_pornstar
. It is much easier to search for a user and you can use more filters - [BREAKING] Removed Query slices implementations
- Reduced number of query objects to 5 elementary queries (JSONQuery, VideoQuery, UserQuery and FeedQuery)
- Added
Query.sample
as a way to replace query slices. You can use it to filter query items and set a max limit. More controls are to be expected in the futre - Refactored the built-in CLI script. More functionnalities are to be expected in the future
- Each query now fetch their videos according to a container. By default, the global pornhub container (
consts.re.container
). It can be overrided by Query.container_hint to adapt to different pages. The hint should be aconsts.WrappedRegex
or a special callable. - The feed object can now be iterated through like a query. Iterate
client.account.feed
instead ofclient.account.feed.feed
- Feed items now have a proper representation
- Added video interaction methods:
video.like()
,video.favorite()
,video.watch_later()
- Added video properties:
video.liked
,video.is_favorite
,video.watched
,video.id
,video.is_free_premium
,video.preview
[BETA] - Added
EmptyQuery
, representing an empty query. Used to silence low priority query errors, e.g. when a pornstar does not have uploads. - Added a slient option to
client.call
to not log some repetitive calls (e.g. video segment calls who are already displayed by the download backend anyway) - Added
video._supports_queries
and the_QuerySupportIndex
dataclass. Used internally by Video objects to keep trace of which queries are available for a video. - Client and Video objects now keep trace of their tokens for API calls
- Video fetching regex is now split between
consts.re.get_videos
andconsts.re.eval_video
for optimization purposes - Added markers and preview parsing to video fetching regexes
- User objects representation now displays the user type too
- User objects now "smartly" select a query url and container hint for user videos and user uploads queries (#27)
- Added
utils.head
which silently makes HEAD requests to check URLs - Implemented
video._as_query
. This property emulates what would the initial video data be like if it was fetched by a query. This allows access to more data (watched status, video preview, etc.) but is implemented in the least optimized way (with a temporary pornhub playlist) - Updated docs
- Wrote a fucking 30 lines changelog
v4.2
V4.2
Boring stuff and breaking query updates
Fixes and improvements
dictify
now takes arecursive
argument to make sure the user wants recusrion over dictified objects- Implemented
VideoError
, which raises when a video exists but is unavailable (disabled by author, invalid country, etc.) - Implemented
phub.utils.suppress
, which bypasses videos that can raiseVideoError
when iterating through a query - Download logs pass from info level to debug level to improve clarity
- Re-implemented challenge resolving at client level
client.call
now have the capacity to re-send requests if they fail- Fixed the built-in display bar length with float numbers
- Improved progress display (added custom message and color support)
Query updates
- Removed index-based query searching.. In particular, removed the
query.get
function. This is due to some queries not having a fixed page length, so we cannot know the real index of a video unless we load all the pages before that video, which is costly. It also helps having to declare less different queries. In the future, There should be only one query per obect type (video, user, etc.). Fixes #30 and #33. - Queries now have a new cached property
query.pages
which let users iterate through each query page. This gives the user more control over the query pages. - In a future update, i will try to re-implement query slices but relatively to authorized videos.
for video in query:
print(video)
# is same as
for page in query.pages:
for video in page:
print(video)
v4.1.5
v4.1.4-1
v4.1.4
v4.1.3-1
v4.1.3
- Image objects can now handle multiple image sources if the default server is down
- Implemented experimental RSS flux.
- User avatars can be fetched from Users objects using the
User.avatar
property. - User avatars are refreshed with
User.refresh
. - Added a
Client.search_pornstar
method.