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

Sorting Video Formats #25959

Closed
wants to merge 18 commits into from
Closed

Sorting Video Formats #25959

wants to merge 18 commits into from

Conversation

pukkandan
Copy link
Contributor

@pukkandan pukkandan commented Jul 10, 2020

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

Added a new switch --format-sort which can be used to specify how the video formats will be sorted. It accepts a comma separated list of the fields that should be used for the sorting (e.g. "height,width,fps,filesize,tbr").

It accepts all the same options as the field_preference argument of _sort_formats() that can be used from the extractor (language_preference, quality, height, width, fps, filesize, filesize_approx, tbr, vbr, abr, format_id, proto_preference, ext_preference, audio_ext_preference, source_preference). The user-specified fields takes higher priority that those defined in the extractor which inturn takes higher priority that the default order.

@pukkandan
Copy link
Contributor Author

pukkandan commented Jul 10, 2020

When I checked the code with flake8, I see that many other parts of the file that I did not modify are also giving errors.

This is my first time ever contributing to a project. I followed all the guidelines given in contributing.md. I'd appreciate if someone can tell me what I need to do to fix the issue.

@pukkandan
Copy link
Contributor Author

@dstftw Could you please tell me why this was labelled do-not-merge?

@dstftw
Copy link
Collaborator

dstftw commented Jul 11, 2020

There is already a superior solution which is still not flexible enough.

@pukkandan
Copy link
Contributor Author

pukkandan commented Jul 11, 2020

@dstftw As I understand, that branch provides the extractor more control over the sorting. This pull request attempts to give more control to the user instead.

@dstftw
Copy link
Collaborator

dstftw commented Jul 11, 2020

Providing more control to user is just a matter of writing CLI wrapper passing data to core sorting mechanism.

@pukkandan
Copy link
Contributor Author

Besides, #8125 was last updated 5yrs ago...

@pukkandan pukkandan mentioned this pull request Aug 30, 2020
3 tasks
@dstftw dstftw force-pushed the master branch 2 times, most recently from 5e26784 to da2069f Compare September 13, 2020 13:50
pukkandan and others added 14 commits September 21, 2020 19:01
* add option --format-sort
* added format-sort-force and allow to sort in reverse
* Added codec_preference and audio_codec_preference
* Prioritize a given value
* MKV Thumbnails with FFMpeg
* Now has the correct file name in MKV container
* Change os.rename to shutil.move
Co-authored-by: MrDoritos <[email protected]>
Co-authored-by: ian <ian@nass>
Co-authored-by: pukkandan
* Add --break-on-existing
Authored-by: Yoav Shai <[email protected]>
* Update embedthumbnail.py
Authored-by: Paul Dubois <[email protected]>
Added:
--no-include-ads, --no-write-sub, --no-write-auto-sub, --no-playlist-reverse, --no-restrict-filenames, --youtube-include-dash-manifest, --no-format-sort
And remove "_preference" from the field names
@pukkandan
Copy link
Contributor Author

Sorry, I didn't mean to close this. I accidentally merged this branch with another. That is why this request shows a ton of irrelevant commits. Then I deleted the branch as I was trying to fix it. That caused the pull to be closed. I have force pushed the branch with only the correct commits. Sorry for the mess :(

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

Successfully merging this pull request may close these issues.

2 participants