-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[utils] js_to_json
: Implement template strings
#6623
Merged
Grub4K
merged 3 commits into
yt-dlp:master
from
Grub4K:feat/js_to_json-template-strings
Mar 25, 2023
Merged
[utils] js_to_json
: Implement template strings
#6623
Grub4K
merged 3 commits into
yt-dlp:master
from
Grub4K:feat/js_to_json-template-strings
Mar 25, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Limited implementation that covers just our required use case is fine for these kinds of functions |
This passes the common cases in tests and resolves the BibelTV case so should be good to go. |
pukkandan
reviewed
Mar 25, 2023
dirkf
added a commit
to dirkf/youtube-dl
that referenced
this pull request
May 3, 2023
* support variable substitution, from https://github.com/yt-dlp/yt-dlp/pull/#521 etc, thanks ChillingPepper, Grub4k, pukkandan * improve escape handling, from https://github.com/yt-dlp/yt-dlp/pull/#521 thanks Grub4k * support template strings from yt-dlp/yt-dlp#6623 thanks Grub4k * add limited `!` evaluation (eg, !!0 -> false, see tests)
flashdagger
added a commit
to flashdagger/yt-dlp
that referenced
this pull request
May 25, 2023
Co-authored-by: Simon Sawicki <accounts@grub4k.xyz>
dirkf
added a commit
to dirkf/youtube-dl
that referenced
this pull request
Jul 18, 2023
* support variable substitution, from https://github.com/yt-dlp/yt-dlp/pull/#521 etc, thanks ChillingPepper, Grub4k, pukkandan * improve escape handling, from https://github.com/yt-dlp/yt-dlp/pull/#521 thanks Grub4k * support template strings from yt-dlp/yt-dlp#6623 thanks Grub4k * add limited `!` evaluation (eg, !!0 -> false, see tests)
dirkf
added a commit
to ytdl-org/youtube-dl
that referenced
this pull request
Jul 19, 2023
* support variable substitution, from https://github.com/yt-dlp/yt-dlp/pull/#521 etc, thanks ChillingPepper, Grub4k, pukkandan * improve escape handling, from https://github.com/yt-dlp/yt-dlp/pull/#521 thanks Grub4k * support template strings from yt-dlp/yt-dlp#6623 thanks Grub4k * add limited `!` evaluation (eg, !!0 -> false, see tests)
aalsuwaidi
pushed a commit
to aalsuwaidi/yt-dlp
that referenced
this pull request
Apr 21, 2024
Authored by: Grub4K
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
Rel: #6505 (comment)
Note that I have not really tested against edge cases and only in isolation. More tests are probably required. However I currently lack a lot of time and so just wanted to share this. Feel free to use.
Additionally the current implementation of
template_substitute
works only okayish (undefined
/void *
=>null
instead ofundefined
). Generally we would have to provide the real string value of each object which seems out of scope forjs_to_json
.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:
What is the purpose of your pull request?