Phub

Latest version: v4.7.6

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

Scan your dependencies

Page 1 of 10

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.6

Changelog
- fixed proxy support

4.7.5

- type hinting
- removed a useless print statement which I forgot in last release (sorry)

4.7.4

- added an exception class for PornHub Premium videos, since those can't be processed

4.7.3

Changelog
- re-added FFmpeg video converting (See Documentation)
- fixed an issue which prevented the webmasters API being used which resulted in a very poor performance for non HTML scraping
- updated and fixed the RegionBlocked exception
- rewrite of the PHUB CLI

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

Page 1 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.