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

--max-downloads issues #232

Closed
SilentGob opened this issue Nov 28, 2011 · 4 comments
Closed

--max-downloads issues #232

SilentGob opened this issue Nov 28, 2011 · 4 comments

Comments

@SilentGob
Copy link

@SilentGob SilentGob commented Nov 28, 2011

When I started using the --max-downloads option I expected it to limit the number of actually downloaded files. I was wrong :)

I'm using this option with --match-title option and --max-downloads are counting all files not only the ones matching the REGEXP. So I ended with less than --max-downloads files on my harddrive.

Is it possible to only increment the counter when a file is actually downloaded ? (maybe it will raises an issue with simulate, I'm not familiar enough with the code)

One other "issue" is that when you reach max-downloads youtube-dl keeps running even if it is never going to download another file. Instead of only writing a message saying "max-downloads reached" why not stop youtube-dl ?

@phihag
Copy link
Contributor

@phihag phihag commented Nov 28, 2011

Wow, the new option gets used quickly. Checking --max-downloads after matching the title is reasonable (and moving the download increment out of the IE is a great idea anyways), and I'll leave this issue open for that.

On the other hand, terminating youtube-dl is not that easy. Note that any solution must work even if youtube-dl is used as a library by another hosting program. Therefore, we can't just call sys.exit or so. Raising an exception is possible, but would complicate the API.

@phihag
Copy link
Contributor

@phihag phihag commented Nov 29, 2011

If you want --max-downloads to skip any further videos, you'll likely have large playlists. In these cases, simply specify --playlistend 42 to get only part of the playlist. I'm not certain that --max-downloads is really that useful in the first place, and there won't be any API changes to accommodate it (Why do you want to use it?).

@phihag phihag closed this in 7731555 Nov 29, 2011
@SilentGob
Copy link
Author

@SilentGob SilentGob commented Nov 29, 2011

Not counting unmatched videos is fine for me.

For the record, limiting playlist size with playlistend may not work in my case.
I was looking to get a fixed number of files from a playlist, and in this playlist I only want files matching a specific name format. As the playlist can be quite spammed with non matching files using playlistend can be difficult.

Anyway your solution fits me well for now, and if I absolutely want max-downloads, I can still make a quick and dirty hack :)

Thank you for your reactivity anyway!

@phihag
Copy link
Contributor

@phihag phihag commented Dec 8, 2011

After careful deliberation, we raise a MaxDownloadsReached exception starting with youtube-dl 2011-12-8. This can significantly speed up the process if the number of videos is large.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.