Skip to content
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

Feature request for silent downloads #8

Closed
nkmathew opened this issue Jul 7, 2020 · 3 comments
Closed

Feature request for silent downloads #8

nkmathew opened this issue Jul 7, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@nkmathew
Copy link

nkmathew commented Jul 7, 2020

Hey Khaled,

Thanks for the making this. Do you think you could add an option for disabling the progress messages so we can clean logs? Like a silent flag in most command line applications

Also I have a use case where I'd like to only mirror a reddit video if it's not too big e.g if the video is over 20MB don't download it. Is this something that can be implemented?

@elmoiv
Copy link
Owner

elmoiv commented Jul 7, 2020

Thanks @nkmathew for these great ideas. I am busy today, so I will try to make this possible ASAP.

Stay tuned :)

@elmoiv elmoiv added the enhancement New feature or request label Jul 7, 2020
@elmoiv
Copy link
Owner

elmoiv commented Jul 9, 2020

@nkmathew
Silent download will work only if max_q or min_q is set True. If not, you will be prompted to quality query to select desired one.
So be sure to check one of the mentioned attributes before downloading.

Updated version will be soon :)

@elmoiv
Copy link
Owner

elmoiv commented Jul 9, 2020

Published v1.0.9:

  • Added the ability to disable logging.
  • Maximum video size can be set.
  • Maximum video duration can be set.

To download videos without logging (silent mode):

from redvid import Downloader

reddit = Downloader()

# Due to silent mode, user quality query won't be visible so redvid
# automatically downloads maximum quality unless minimum is set
reddit.log = False
reddit.url = 'https://www.reddit.com/r/PublicFreakout/comments/ho5ml9/former_judges_michael_conahan_and_mark_ciavarella/'
reddit.download()

To set a maximum size that is not allowed to be exceeded (like your 20 MB example):

from redvid import Downloader

reddit = Downloader()

# Set max size to 20 MB
# Size is passed in BYTES
reddit.max_s = 20 * (1 << 20) 

# The next video at max 1080p is 125 MB
reddit.url = 'https://www.reddit.com/r/PublicFreakout/comments/ho5ml9/former_judges_michael_conahan_and_mark_ciavarella/'
reddit.download()

Now if the video exceeds 20 MB, nothing will be downloaded and function will return error number corresponding to size which equals 0.

Hope you find redvid helpful all the time :)

@elmoiv elmoiv closed this as completed Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants