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

randomize playlist order, i.e. --playlist-random #11889

Closed
glenn-slayden opened this issue Jan 31, 2017 · 5 comments
Closed

randomize playlist order, i.e. --playlist-random #11889

glenn-slayden opened this issue Jan 31, 2017 · 5 comments

Comments

@glenn-slayden
Copy link
Contributor

@glenn-slayden glenn-slayden commented Jan 31, 2017

  • I've verified and I assure that I'm running youtube-dl 2017.01.29
  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Feature request (request for a new functionality)

Please add support for randomizing the playlist download order via --playlist-random (or whatever other switch name).

Since there is already an option for --reverse-playlist, I don't think this should be too hard? (I'd contribute it myself if I was more confident in my python skills.)

The motivation for this feature is that it could be used in conjunction with --max-downloads (i.e. set to a low value) to randomly "sample" a variety of videos from across a channel with lots of videos, as opposed to just being able to get the first few (or last few, using --reverse-playlist).

@glenn-slayden
Copy link
Contributor Author

@glenn-slayden glenn-slayden commented Jan 31, 2017

I should also add that the "random sampling" scenario I outlined above should be possible because you would be able to combine it with --download-archive to ensure that you don't get repeated videos in the random selection.

Here I'm referencing the fact youtube-dl already does the correct thing when you combine --download-archive with --max downloads N, namely, that you get the next "N" files that you haven't already downloaded--as opposed to "the N-or-fewer files out of the first N according to the selected playlist order." The latter could have been a perfectly valid interpretation—and could have been the implemented behavior—for the interaction between --max-downloads and --download-archive when both switches are present (but fortunately it isn't)

@ThomasChr
Copy link
Contributor

@ThomasChr ThomasChr commented Jan 31, 2017

New parameter added. Pull request created.

@ThomasChr
Copy link
Contributor

@ThomasChr ThomasChr commented Jan 31, 2017

Oh, I tested my code with '--max-downloads' and '--download-archive' - seems to work as intended!

@yan12125 yan12125 closed this in 75822ca Feb 3, 2017
yan12125 added a commit that referenced this issue Feb 3, 2017
New parameter --playlist-random to randomize playlist download order. Fixes #11889
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Feb 3, 2017

Thanks to @ThomasChr, there's --playlist-random now!

@glenn-slayden
Copy link
Contributor Author

@glenn-slayden glenn-slayden commented Feb 3, 2017

Very many thanks!

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
3 participants
You can’t perform that action at this time.