Phub

Latest version: v4.7.2

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 9

4.13.9

Fixes a bunch of bugs and improves a few features.

Fixes
- Fixed JQuery and HQuery taking wrong parameters
- Fixed Feed type parsing being messy
- Fixed video title fetched to time at initialisation
- Fixed categories not able to reverse
- Fixed Param bruteforce concatenation on by default
- Fixed threaded and FFMPEG download (still experimental)
- Params with a None value are now excluded from being concatenated to another (but not the reverse)

Improvements
- Refactored param concatenation to use `|` instead of `+`
- Implemented sort filter sequence check
- Added an HD constant for searching
- Documented Param assertions
- Implemented `Param._concat`, which concatenates n params together, with the option to bruteforce their concatenation (used internally to test for constant types)
- You can now use the `in` keyword to check if a Param is inside another
- Updated docstrings
- User search has more parameters (unsure of the format, experimental): country, city and age
- Using concurent.futures instead of threading for threaded downloads

Note on downloads
Downloading is becoming more stable. You can use 3 download backends for one video:
- `phub.download.default`, default and dummy backend. It simply fetches a segment one after the other. It is stable but quite slow.
- `phub.download.FFMPEG`, which let FFMPEG handle the whole download. It makes it really stable and fast, but as FFMPEG is a CLI tool, progress display is not available. Callback will be called at start (`0`) and at the end (`1`).
- `phub.download.threaded`, which uses a threaded concurent.futures pool to download everything as fast as possible. This is still experimental but already quite faster than a default download. You can also select the maximum number of workers and requests timeouts.
python
Default download
video.download(..., downloader = phub.download.default)

FFMPEG download
video.download(..., downloader = phub.download.FFMPEG)

Threaded download
video.download(..., downloader = phub.download.threaded(max_workers = 50, timeout = 30))

Note that the best threaded parameters will depend on your CPU and connection speed. I might want a higher timeout if you have a slower connection, and less workers if you have a weak CPU.

Note on download callbacks
A single download callback is not enough if you want a more precise way of keeping track of the downloading process, you can create your own custom callback object that inherits from `phub.objects.Callback`:
python
from phub import Callback

class Tracker(Callback):
def on_download(progress: int):
Execute stuff on download progress
print('Downloading', progress, '/', self.total)

def on_write(progress: int):
Execute stuff on write progress
print('Writing', progress, '/', self.total)

video.download(..., display = Tracker)

This should be useful, e.g. if you are trying to download very long videos that nescessite to keep track of their writing progress.

Simple callbacks functions that takes only 2 arguments are still available, but will be automatically trasnformed to Callback objects and only the download progress will be available. I might implement more functions into this tracker in the future (errors, retry stuff, etc.).

4.7.2

Changelog

- added geo bypass (experimental)
- switched project to httpx to fix network locks
- added direct CLI usage by executing `phub` in your terminal
- fixed an issue with domain specific languages, which would override your own value set in `language = ..`
- fixed tests & added auth to the tests
- you can now decide between html parsing and webmaster parsing
- you can now force changing the language of video titles

4.7.1

Changelog

- added an exception for videos which are blocked in the users region

4.7

python 3.11 >> 3.9

4.6

Keeping up with Pornhub updates

- Fix email auth (57)
- Fix video.watched showing wrong value when iterated from history
- Docstring changes
- Changed the client.delay algorithm (EchterAlsFake)
- Fix enumerating private videos (maybe) (46)

4.5.7

- Added a check for empty search queries (53)
- Made `query.pages` a `phub.Pages` object, able to handle page indexes or slices.

py
Unique page
first_page = query.pages[0]

Iteration
for page in query.pages: ...

Slicing
for page in query.pages[1:4]: ...


This change is a re-implementation of query item slices, removed in PHUB3 because some pages can have an inconsistent amount of items. Enhancment for 49.

Page 1 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.