-
Notifications
You must be signed in to change notification settings - Fork 305
Ship YouTube's challenge solver without costing anyone a reinstall #446
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| """StemDeck. | ||
|
|
||
| The vendored path insert below runs before anything else in the package, which | ||
| is the only place it can work: yt-dlp resolves its optional dependencies at | ||
| import time, and `app.pipeline.download` imports yt_dlp at module level. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| # yt-dlp's YouTube challenge solver (#432, #438). | ||
| # | ||
| # Vendored rather than declared as a dependency, and the reason is the desktop | ||
| # updater, not preference. runtimeId is sha256(uv.lock), and the updater stands | ||
| # down when it changes because it can replace `backend/` but never `python/`. | ||
| # A new dependency would therefore have sent every existing desktop install to | ||
| # a full manual reinstall to get this. | ||
| # | ||
| # This package is not one StemDeck imports. It is a 53 KB pure-Python payload | ||
| # with no dependencies that yt-dlp discovers at runtime, so it belongs in the | ||
| # app layer that the updater does replace. Existing installs get the solver | ||
| # through the ordinary in-app update instead. | ||
| # | ||
| # Refresh with: python scripts/update_vendored_ejs.py | ||
| _VENDOR = Path(__file__).resolve().parent / "_vendor" | ||
| if _VENDOR.is_dir(): | ||
| _path = str(_VENDOR) | ||
| if _path not in sys.path: | ||
| sys.path.insert(0, _path) |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| This is free and unencumbered software released into the public domain. | ||
|
|
||
| Anyone is free to copy, modify, publish, use, compile, sell, or | ||
| distribute this software, either in source code form or as a compiled | ||
| binary, for any purpose, commercial or non-commercial, and by any | ||
| means. | ||
|
|
||
| In jurisdictions that recognize copyright laws, the author or authors | ||
| of this software dedicate any and all copyright interest in the | ||
| software to the public domain. We make this dedication for the benefit | ||
| of the public at large and to the detriment of our heirs and | ||
| successors. We intend this dedication to be an overt act of | ||
| relinquishment in perpetuity of all present and future rights to this | ||
| software under copyright law. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
| IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| OTHER DEALINGS IN THE SOFTWARE. | ||
|
|
||
| For more information, please refer to <https://unlicense.org/> |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from yt_dlp_ejs._version import version | ||
|
|
||
| __all__ = ["version"] |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # file generated by setuptools-scm | ||
| # don't change, don't track in version control | ||
|
|
||
| __all__ = [ | ||
| "__version__", | ||
| "__version_tuple__", | ||
| "version", | ||
| "version_tuple", | ||
| "__commit_id__", | ||
| "commit_id", | ||
| ] | ||
|
|
||
| TYPE_CHECKING = False | ||
| if TYPE_CHECKING: | ||
| from typing import Union | ||
|
|
||
| VERSION_TUPLE = tuple[int | str, ...] | ||
| COMMIT_ID = Union[str, None] | ||
| else: | ||
| VERSION_TUPLE = object | ||
| COMMIT_ID = object | ||
|
|
||
| version: str | ||
| __version__: str | ||
| __version_tuple__: VERSION_TUPLE | ||
| version_tuple: VERSION_TUPLE | ||
| commit_id: COMMIT_ID | ||
| __commit_id__: COMMIT_ID | ||
|
|
||
| __version__ = version = "0.8.0" | ||
| __version_tuple__ = version_tuple = (0, 8, 0) | ||
|
|
||
| __commit_id__ = commit_id = None | ||
Empty file.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import importlib.resources | ||
|
|
||
| import yt_dlp_ejs.yt.solver | ||
|
thcp marked this conversation as resolved.
|
||
|
|
||
|
|
||
| def core() -> str: | ||
| """ | ||
| Read the contents of the JavaScript core solver bundle as string. | ||
| """ | ||
| return (importlib.resources.files(yt_dlp_ejs.yt.solver) / "core.min.js").read_text( | ||
| encoding="utf-8" | ||
| ) | ||
|
|
||
|
|
||
| def lib() -> str: | ||
| """ | ||
| Read the contents of the JavaScript library solver bundle as string. | ||
| """ | ||
| return (importlib.resources.files(yt_dlp_ejs.yt.solver) / "lib.min.js").read_text( | ||
| encoding="utf-8" | ||
| ) | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.