Phub

Latest version: v4.6

Safety actively analyzes 623126 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.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.

4.5.6

- fixed the challenge resolver (finally)

4.5.5

Made the built-in CLI behave like a downloader. `py -m phub` now takes one argument, whether it's a video key, a video URL or a local file containing multiple URLs. It does not matter how you arange the URLs in the file. You can also use `--quality`, `--output` and `--downloader` for advanced options.

4.5.4

- Fixed recommendations
- Fixed a query cache injection

Page 1 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.