-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video data #9
Comments
Thanks @DrRonne for your Ideas. I will consider these features in my next update. |
if you can afford the temporary disk space and the runtime speed, you can do what I do and check the size of the file after download, then delete it if its the wrong size, or move it to the correct location if its good to go. I know its not optimal but it was only like 2 extra loc after the initial call, and adds like 2 seconds per operation. |
I found a workaround for viewing video size and duration before downloading. Here is a piece of my current work: ...
self.duration = getDuration(self.page)
self.size = int(
self.head(
self.video,
_proxies=self.proxies
).headers['Content-Length']
)
... The corresponding attributes will be ...
def __init__(
...
max_d=1e1000,
max_s=1e1000,
...
):
...
self.max_d, self.max_s = max_d, max_s
...
... Stay tuned :) |
Published v1.0.9:
To download videos shorter than 1 minute do the following: from redvid import Downloader
reddit = Downloader()
reddit.max_d = 60 # 60 seconds
# more than 3 minutes video example
reddit.url = 'https://www.reddit.com/r/PublicFreakout/comments/ho5ml9/former_judges_michael_conahan_and_mark_ciavarella/'
reddit.download() Now if the video exceeds 1 minutes, nothing will be downloaded and function will return error number corresponding to duration which equals 1. |
Hello, thank you for making this library, it is awesome and works great!
One addition I would suggest, is to make something that can check video data before you download the video. For example, I only want to download videos that are shorter than one minute. Right now I would have to download it and check the time afterwards. It would be cool if I could check this beforehand.
The text was updated successfully, but these errors were encountered: