phub 4.8.0__tar.gz → 4.8.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {phub-4.8.0 → phub-4.8.1}/PKG-INFO +1 -2
  2. {phub-4.8.0 → phub-4.8.1}/pyproject.toml +2 -2
  3. {phub-4.8.0 → phub-4.8.1}/src/phub/objects/video.py +7 -27
  4. {phub-4.8.0 → phub-4.8.1}/src/phub/tests/test_video.py +2 -1
  5. {phub-4.8.0 → phub-4.8.1}/src/phub.egg-info/PKG-INFO +1 -2
  6. {phub-4.8.0 → phub-4.8.1}/src/phub.egg-info/requires.txt +0 -1
  7. {phub-4.8.0 → phub-4.8.1}/LICENSE +0 -0
  8. {phub-4.8.0 → phub-4.8.1}/README.md +0 -0
  9. {phub-4.8.0 → phub-4.8.1}/pypi.md +0 -0
  10. {phub-4.8.0 → phub-4.8.1}/setup.cfg +0 -0
  11. {phub-4.8.0 → phub-4.8.1}/setup.py +0 -0
  12. {phub-4.8.0 → phub-4.8.1}/src/phub/__init__.py +0 -0
  13. {phub-4.8.0 → phub-4.8.1}/src/phub/__main__.py +0 -0
  14. {phub-4.8.0 → phub-4.8.1}/src/phub/consts.py +0 -0
  15. {phub-4.8.0 → phub-4.8.1}/src/phub/core.py +0 -0
  16. {phub-4.8.0 → phub-4.8.1}/src/phub/errors.py +0 -0
  17. {phub-4.8.0 → phub-4.8.1}/src/phub/literals.py +0 -0
  18. {phub-4.8.0 → phub-4.8.1}/src/phub/modules/__init__.py +0 -0
  19. {phub-4.8.0 → phub-4.8.1}/src/phub/modules/display.py +0 -0
  20. {phub-4.8.0 → phub-4.8.1}/src/phub/modules/parser.py +0 -0
  21. {phub-4.8.0 → phub-4.8.1}/src/phub/modules/rss.py +0 -0
  22. {phub-4.8.0 → phub-4.8.1}/src/phub/objects/__init__.py +0 -0
  23. {phub-4.8.0 → phub-4.8.1}/src/phub/objects/account.py +0 -0
  24. {phub-4.8.0 → phub-4.8.1}/src/phub/objects/data.py +0 -0
  25. {phub-4.8.0 → phub-4.8.1}/src/phub/objects/feed.py +0 -0
  26. {phub-4.8.0 → phub-4.8.1}/src/phub/objects/image.py +0 -0
  27. {phub-4.8.0 → phub-4.8.1}/src/phub/objects/playlist.py +0 -0
  28. {phub-4.8.0 → phub-4.8.1}/src/phub/objects/query.py +0 -0
  29. {phub-4.8.0 → phub-4.8.1}/src/phub/objects/user.py +0 -0
  30. {phub-4.8.0 → phub-4.8.1}/src/phub/tests/__init__.py +0 -0
  31. {phub-4.8.0 → phub-4.8.1}/src/phub/tests/test_auth.py +0 -0
  32. {phub-4.8.0 → phub-4.8.1}/src/phub/tests/test_model.py +0 -0
  33. {phub-4.8.0 → phub-4.8.1}/src/phub/tests/test_playlist.py +0 -0
  34. {phub-4.8.0 → phub-4.8.1}/src/phub/tests/test_search.py +0 -0
  35. {phub-4.8.0 → phub-4.8.1}/src/phub/utils.py +0 -0
  36. {phub-4.8.0 → phub-4.8.1}/src/phub.egg-info/SOURCES.txt +0 -0
  37. {phub-4.8.0 → phub-4.8.1}/src/phub.egg-info/dependency_links.txt +0 -0
  38. {phub-4.8.0 → phub-4.8.1}/src/phub.egg-info/entry_points.txt +0 -0
  39. {phub-4.8.0 → phub-4.8.1}/src/phub.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: phub
3
- Version: 4.8.0
3
+ Version: 4.8.1
4
4
  Summary: An API for Pornhub
5
5
  Author-email: Egsagon <egsagon.git@gmail.com>, EchterAlsFake <EchterAlsFake@proton.me>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -688,7 +688,6 @@ Requires-Python: >=3.9
688
688
  Description-Content-Type: text/markdown
689
689
  License-File: LICENSE
690
690
  Requires-Dist: httpx[brotli,socks]
691
- Requires-Dist: ffmpeg-progress-yield
692
691
  Requires-Dist: eaf_base_api
693
692
  Dynamic: license-file
694
693
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "phub"
3
- version = "4.8.0"
3
+ version = "4.8.1"
4
4
  description = "An API for Pornhub"
5
5
  authors = [
6
6
  {name = 'Egsagon', email = "egsagon.git@gmail.com"},
@@ -13,7 +13,7 @@ classifiers = [
13
13
  "Development Status :: 4 - Beta",
14
14
  "Programming Language :: Python"
15
15
  ]
16
- dependencies = ["httpx[brotli,socks]", "ffmpeg-progress-yield", "eaf_base_api"]
16
+ dependencies = ["httpx[brotli,socks]", "eaf_base_api"]
17
17
  requires-python = ">=3.9"
18
18
 
19
19
 
@@ -18,7 +18,6 @@ from ..modules import parser, display
18
18
 
19
19
  if TYPE_CHECKING:
20
20
  from ..core import Client
21
- from ..utils import Quality
22
21
 
23
22
 
24
23
  class Video:
@@ -226,7 +225,9 @@ class Video:
226
225
  def download(self,
227
226
  path: Union[str, os.PathLike],
228
227
  downloader: Union[Callable, str] = "threaded",
229
- quality: Quality | str = 'best',
228
+ quality: str = 'best',
229
+ remux: bool = False,
230
+ display_remux: Callable[[int, int], None] = None,
230
231
  *,
231
232
  display: Callable[[int, int], None] = display.default()) -> str:
232
233
  '''
@@ -237,6 +238,8 @@ class Video:
237
238
  quality (Quality | str | int): The video quality.
238
239
  downloader (Callable): The download backend.
239
240
  display (Callable): The progress display.
241
+ remux (bool): Whether to remux the video from MPEG-TS to MP4 (h264)
242
+ display_remux (Callable[[int, int], None], optional): The display backend for remuxing.
240
243
 
241
244
  Returns:
242
245
  str: The downloader video path.
@@ -249,37 +252,14 @@ class Video:
249
252
  self.logger.info('Starting download for %s at %s', self, path)
250
253
 
251
254
  try:
252
- self.client.core.download(video=self, quality=quality, path=path, callback=display, downloader=downloader)
255
+ self.client.core.download(video=self, quality=quality, path=path, callback=display, downloader=downloader,
256
+ remux=remux, callback_remux=display_remux)
253
257
 
254
258
  except Exception as e:
255
259
  self.logger.error(f"An error occured while downloading video {e}")
256
260
 
257
261
  return path
258
262
 
259
- def get_direct_url(self, quality: Quality) -> str:
260
- '''
261
- Get the direct video URL given a specific quality.
262
-
263
- Args:
264
- quality (Quality): The video quality.
265
-
266
- Returns:
267
- str: The direct url.
268
- '''
269
-
270
- from ..utils import Quality
271
- qual = Quality(quality)
272
-
273
- # Get remote
274
- sources = self.fetch('page@mediaDefinitions')
275
- remote = [s for s in sources if 'remote' in s][0]['videoUrl']
276
-
277
- # Parse quality
278
- quals = {int(s['quality']): s['videoUrl']
279
- for s in self.client.call(remote).json()}
280
-
281
- return qual.select(quals)
282
-
283
263
  # === Interaction methods === #
284
264
 
285
265
  def _assert_internal_success(self, res: dict) -> None:
@@ -23,7 +23,8 @@ def test_video_information():
23
23
  embed = video.embed
24
24
  image = video.image.url
25
25
  id = video.id
26
-
26
+ assert isinstance(video.download(path="./", quality="worst", remux=True), str)
27
+ assert isinstance(video.download(path="./", quality="worst"), str)
27
28
  assert isinstance(title, str) and len(title) > 3
28
29
  assert isinstance(likes, int) and len(str(likes)) >= 1
29
30
  assert isinstance(dislikes, int) and len(str(dislikes)) >= 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: phub
3
- Version: 4.8.0
3
+ Version: 4.8.1
4
4
  Summary: An API for Pornhub
5
5
  Author-email: Egsagon <egsagon.git@gmail.com>, EchterAlsFake <EchterAlsFake@proton.me>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -688,7 +688,6 @@ Requires-Python: >=3.9
688
688
  Description-Content-Type: text/markdown
689
689
  License-File: LICENSE
690
690
  Requires-Dist: httpx[brotli,socks]
691
- Requires-Dist: ffmpeg-progress-yield
692
691
  Requires-Dist: eaf_base_api
693
692
  Dynamic: license-file
694
693
 
@@ -1,3 +1,2 @@
1
1
  httpx[brotli,socks]
2
- ffmpeg-progress-yield
3
2
  eaf_base_api
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes