From cf159f2977fd602775d6c121d2aae78e84749cbd Mon Sep 17 00:00:00 2001 From: Haradhan Sharma <58944514+haradhansharma@users.noreply.github.com> Date: Tue, 8 Mar 2022 01:20:12 +0600 Subject: [PATCH] Update __init__.py Adding more fun --- vimeo_downloader/__init__.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/vimeo_downloader/__init__.py b/vimeo_downloader/__init__.py index 8eeefeb..50fdd7b 100644 --- a/vimeo_downloader/__init__.py +++ b/vimeo_downloader/__init__.py @@ -85,10 +85,13 @@ class Metadata(NamedTuple): class _Stream: - def __init__(self, direct_url: str, quality: str, title: str): + def __init__(self, direct_url: str, quality: str, title: str, fps:int, mime:str, id:str): self._direct_url = direct_url # Direct url for the mp4 file self._quality = quality # Quality of the stream self.title = title + self._fps = fps + self._mime = mime + self._id = id def __repr__(self): return f"Stream({self._quality})" @@ -106,7 +109,17 @@ def direct_url(self): @property def quality(self): return self._quality - + + @property + def fps(self): + return self._fps + @property + def mime(self): + return self._mime + @property + def id(self): + return self._id + def download( self, download_directory: str = "", filename: str = None, mute: bool = False ): @@ -316,9 +329,14 @@ def streams(self) -> List[_Stream]: dl = [] for stream in js_url["request"]["files"]["progressive"]: url = stream["url"] + #to make more funny + fps = stream["fps"] + mime = stream["mime"] + id = stream["id"] + #to make more funny if not requests.get(url, stream=True).ok: continue - stream_object = _Stream(quality=stream["quality"], direct_url=url, title=title) + stream_object = _Stream(quality=stream["quality"], direct_url=url, title=title, fps=fps, mime=mime, id=id)#passing extra funny dl.append(stream_object) dl.sort() return dl