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

[extractor/generic] Add extractor-args hls_key and variant_query #6567

Merged
merged 3 commits into from Mar 21, 2023

Conversation

bashonly
Copy link
Member

  • Add extractor-arg variant_query to passthrough the master m3u8 URL query to its variant playlist URLs (similar to how fragment_query works on fragment URLs)

  • Add extractor-arg hls_key for generic m3u8s with AES-128 encryption:

Usage: generic:hls_key=(URI|KEY)[,IV]

# to pass the key URI and IV that will override the values in the m3u8:
--extractor-args "generic:hls_key=https://example.com/hls/key,0x1234567890ABCDEF"

# to pass the key and IV, override the m3u8 values:
--extractor-args "generic:hls_key=1234567890ABCDEF,0x9876543210FEDCBA"

# to pass the key URI and use the IV found in the m3u8:
--extractor-args "generic:hls_key=https://example.com/hls/key"

# to pass the AES key and use the IV found in the m3u8:
--extractor-args "generic:hls_key=1234567890ABCDEF"

# if for some reason you need to only pass the IV, it's possible like this:
--extractor-args "generic:hls_key=,0x9876543210FEDCBA"
Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • 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?

@pukkandan
Copy link
Member

  • Add extractor-arg variant_query to passthrough the master m3u8 URL query to its variant playlist URLs (similar to how fragment_query works on fragment URLs)

Should these be a single arg? Are there cases where one is needed but not the other?

yt_dlp/extractor/generic.py Outdated Show resolved Hide resolved
yt_dlp/extractor/generic.py Outdated Show resolved Hide resolved
yt_dlp/extractor/generic.py Outdated Show resolved Hide resolved
@bashonly
Copy link
Member Author

bashonly commented Mar 20, 2023

Should these be a single arg? Are there cases where one is needed but not the other?

I've seen several cases where fragment_query is needed but not variant_query. On the other hand, every time I've seen that variant_query is necessary, fragment_query has also been needed.

Hypothetically though, one of the two (variants vs fragments) could have query strings (or a lack thereof) that cannot be modified, so I think we should keep two separate args

@pukkandan pukkandan added the enhancement New feature or request label Mar 20, 2023
@bashonly bashonly merged commit c2e0fc4 into yt-dlp:master Mar 21, 2023
11 checks passed
@bashonly bashonly deleted the feat/generic-manifest-args branch March 24, 2023 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants