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

Allow wildcards or regex on format_id #26808

Closed
jesus2099 opened this issue Oct 4, 2020 · 3 comments
Closed

Allow wildcards or regex on format_id #26808

jesus2099 opened this issue Oct 4, 2020 · 3 comments
Labels

Comments

@jesus2099
Copy link

@jesus2099 jesus2099 commented Oct 4, 2020

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2020.09.20
  • I've searched the bugtracker for similar feature requests including closed ones

Description

I would like to download a list of videos contained in a batch file with a specific format.
The format_id in my example is like m3u8-download-10xx but the last two xx digits vary.

It would be nice to be able to use either:

Wildcards

Syntax like: --format m3u8-download-10?? or --format m3u8-download-10*

Regular expressions

Syntax like: --format /^m3u8-download-10/

Workaround

So, I have to use a tedious two step work-around:

youtube-dl --list-formats --batch-file liste.txt | grep m3u8-download-10 | sort --unique

To list all the possible format variations for my list and note them down to then run:

youtube-dl --format m3u8-download-1074/m3u8-download-1076/m3u8-download-1077/m3u8-download-1078/m3u8-download-1079/m3u8-download-1080 --batch-file liste.txt
@jesus2099 jesus2099 added the request label Oct 4, 2020
@jesus2099
Copy link
Author

@jesus2099 jesus2099 commented Oct 4, 2020

For another set of videos, I was able to use another workaround, another good feature: [tbr>=1000][tbr<1100].
But it does not work in this case as there are several formats that match but the format_id that I want must contain m3u8-download-.

@jesus2099 jesus2099 changed the title Allow wildcards or regex in FORMAT Allow wildcards or regex on format_id Oct 9, 2020
@pukkandan
Copy link

@pukkandan pukkandan commented Oct 18, 2020

If you are willing to merge #26910, you can use -f "best[format_id^=m3u8-download]"

There may be another workaround for the issue, but for me to check that, give me an example url that you are trying to download

@jesus2099
Copy link
Author

@jesus2099 jesus2099 commented Oct 18, 2020

Take https://www.france.tv/france-4/la-legende-de-korra/saison-1/1794151-bienvenue-dans-la-cite-de-la-republique.html for instance where I would like --format best[format_id^=m3u8-download-10] for example.

Because I have a --batch-file with all videos in this series and the two last digits are not always the same.

You mean, I can already do that? I'll try!
Wow, it already works, undocumented!
As you say, I have to use quotes, I don't know why, but --format "best[format_id^=m3u8-download-10]" does work!
Thanks very much, @pukkandan!

@jesus2099 jesus2099 closed this Oct 18, 2020
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.