elmoiv / redvid

Smart downloader for Reddit hosted videos
GNU General Public License v3.0
110 stars 15 forks source link

Select custom quality without user intervention #11

Closed IcyMint closed 4 years ago

IcyMint commented 4 years ago

I'm in a situation where I would like to select the highest quality while being under the defined size limit. I can set quality to be highest or lowest but I can't find a way to retrieve the list of qualities from UserSelect or select a custom quality. TL;DR: I was wondering if there was a way to select the highest quality under a given size limit, or at least be able to select a quality without needing user intervention.

elmoiv commented 4 years ago

Hey @IcyMint ,

From what you said, I understood the following:

Is that all you want, or I missed a thing?

IcyMint commented 4 years ago

The second feature would be optimal but if it proves to be too involved the first one would be great. Either one would go a long way to solving the problem.

elmoiv commented 4 years ago

Ok. I will start working on your request ASAP. Stay tuned :)

elmoiv commented 4 years ago

Hey @IcyMint , sorry for adding this feature too late.

redvid now can match the given maximum size to highest possible quality.

To do this:

reddit = Downloader() reddit.url = 'https://www.reddit.com/r/Unexpected/comments/9n8mmz/_/'

redvid will find the quality with the size

that does not exceed max_s (3 MB)

reddit.max_s = 3 * (1 << 20)

Enable the "auto match" feature

reddit.auto_max = True

reddit.download()



If this solves your problem, kindly close this issue :) 
IcyMint commented 4 years ago

Just tried it out and it works exactly as expected. Thanks a ton! 🥇