Skip to content

Commit b332f9a

Browse files
committed
- reimplemented get_segments() function to Video object
- release 4.8.2
1 parent f1fbf6b commit b332f9a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "phub"
3-
version = "4.8.1"
3+
version = "4.8.2"
44
description = "An API for Pornhub"
55
authors = [
66
{name = 'Egsagon', email = "[email protected]"},

src/phub/objects/video.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,15 @@ def get_m3u8_urls(self) -> dict:
218218
except Exception as e:
219219
self.logger.warning(f"Skipping invalid quality entry: {q}, {e}")
220220
continue
221-
222221
return quality_urls
223222

223+
def get_segments(self, quality) -> list:
224+
"""
225+
:param quality: (str) The video quality
226+
:return: (list) A list of segments (URLs)
227+
"""
228+
segments = self.client.core.get_segments(m3u8_url_master=self.m3u8_base_url, quality=quality)
229+
return segments
224230

225231
def download(self,
226232
path: Union[str, os.PathLike],

0 commit comments

Comments
 (0)