yt-dlp-utils 0.0.3__tar.gz → 0.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of yt-dlp-utils might be problematic. Click here for more details.
- {yt_dlp_utils-0.0.3 → yt_dlp_utils-0.0.4}/PKG-INFO +5 -6
- {yt_dlp_utils-0.0.3 → yt_dlp_utils-0.0.4}/README.md +1 -1
- {yt_dlp_utils-0.0.3 → yt_dlp_utils-0.0.4}/pyproject.toml +23 -33
- {yt_dlp_utils-0.0.3 → yt_dlp_utils-0.0.4}/yt_dlp_utils/__init__.py +1 -1
- {yt_dlp_utils-0.0.3 → yt_dlp_utils-0.0.4}/yt_dlp_utils/constants.py +1 -0
- {yt_dlp_utils-0.0.3 → yt_dlp_utils-0.0.4}/yt_dlp_utils/lib.py +11 -9
- {yt_dlp_utils-0.0.3 → yt_dlp_utils-0.0.4}/LICENSE.txt +0 -0
- {yt_dlp_utils-0.0.3 → yt_dlp_utils-0.0.4}/yt_dlp_utils/py.typed +0 -0
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: yt-dlp-utils
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: Utilities for programmatic use of yt-dlp.
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: command line,yt-dlp
|
|
7
7
|
Author: Andrew Udvare
|
|
8
8
|
Author-email: audvare@gmail.com
|
|
9
9
|
Requires-Python: >=3.10,<3.14
|
|
10
|
-
Classifier: Development Status ::
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
13
12
|
Classifier: Programming Language :: Python
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -17,8 +16,8 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
17
|
Classifier: Typing :: Typed
|
|
19
18
|
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
20
|
-
Requires-Dist: typing-extensions (>=4.13.
|
|
21
|
-
Requires-Dist: yt-dlp[default] (>=2025.
|
|
19
|
+
Requires-Dist: typing-extensions (>=4.13.2,<5.0.0)
|
|
20
|
+
Requires-Dist: yt-dlp[default] (>=2025.5.22,<2026.0.0)
|
|
22
21
|
Project-URL: Documentation, https://yt-dlp-utils.readthedocs.org
|
|
23
22
|
Project-URL: Homepage, https://tatsh.github.io/yt-dlp-utils/
|
|
24
23
|
Project-URL: Issues, https://github.com/Tatsh/yt-dlp-utils/issues
|
|
@@ -31,7 +30,7 @@ Description-Content-Type: text/markdown
|
|
|
31
30
|
[](https://pypi.org/project/yt-dlp-utils/)
|
|
32
31
|
[](https://github.com/Tatsh/yt-dlp-utils/tags)
|
|
33
32
|
[](https://github.com/Tatsh/yt-dlp-utils/blob/master/LICENSE.txt)
|
|
34
|
-
[](https://img.shields.io/github/commits-since/Tatsh/yt-dlp-utils/v0.0.4/master)](https://github.com/Tatsh/yt-dlp-utils/compare/v0.0.4...master)
|
|
35
34
|
[](https://github.com/Tatsh/yt-dlp-utils/actions/workflows/qa.yml)
|
|
36
35
|
[](https://github.com/Tatsh/yt-dlp-utils/actions/workflows/tests.yml)
|
|
37
36
|
[](https://coveralls.io/github/Tatsh/yt-dlp-utils?branch=master)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://pypi.org/project/yt-dlp-utils/)
|
|
5
5
|
[](https://github.com/Tatsh/yt-dlp-utils/tags)
|
|
6
6
|
[](https://github.com/Tatsh/yt-dlp-utils/blob/master/LICENSE.txt)
|
|
7
|
-
[](https://img.shields.io/github/commits-since/Tatsh/yt-dlp-utils/v0.0.4/master)](https://github.com/Tatsh/yt-dlp-utils/compare/v0.0.4...master)
|
|
8
8
|
[](https://github.com/Tatsh/yt-dlp-utils/actions/workflows/qa.yml)
|
|
9
9
|
[](https://github.com/Tatsh/yt-dlp-utils/actions/workflows/tests.yml)
|
|
10
10
|
[](https://coveralls.io/github/Tatsh/yt-dlp-utils?branch=master)
|
|
@@ -4,9 +4,8 @@ requires = ["poetry-core"]
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
classifiers = [
|
|
7
|
-
"Development Status ::
|
|
7
|
+
"Development Status :: 4 - Beta",
|
|
8
8
|
"Intended Audience :: Developers",
|
|
9
|
-
"License :: OSI Approved :: MIT License",
|
|
10
9
|
"Programming Language :: Python",
|
|
11
10
|
"Programming Language :: Python :: 3.10",
|
|
12
11
|
"Programming Language :: Python :: 3.11",
|
|
@@ -20,7 +19,7 @@ keywords = ["command line", "yt-dlp"]
|
|
|
20
19
|
license = "MIT"
|
|
21
20
|
name = "yt-dlp-utils"
|
|
22
21
|
readme = "README.md"
|
|
23
|
-
version = "0.0.
|
|
22
|
+
version = "0.0.4"
|
|
24
23
|
|
|
25
24
|
[[project.authors]]
|
|
26
25
|
email = "audvare@gmail.com"
|
|
@@ -34,21 +33,18 @@ documentation = "https://yt-dlp-utils.readthedocs.org"
|
|
|
34
33
|
homepage = "https://tatsh.github.io/yt-dlp-utils/"
|
|
35
34
|
repository = "https://github.com/Tatsh/yt-dlp-utils"
|
|
36
35
|
|
|
37
|
-
[tool]
|
|
38
|
-
|
|
39
36
|
[tool.commitizen]
|
|
40
37
|
tag_format = "v$version"
|
|
41
38
|
version_files = [
|
|
42
39
|
".wiswa.jsonnet",
|
|
43
40
|
"CITATION.cff",
|
|
44
41
|
"README.md",
|
|
42
|
+
"docs/index.rst",
|
|
45
43
|
"package.json",
|
|
46
44
|
"yt_dlp_utils/__init__.py",
|
|
47
45
|
]
|
|
48
46
|
version_provider = "pep621"
|
|
49
47
|
|
|
50
|
-
[tool.coverage]
|
|
51
|
-
|
|
52
48
|
[tool.coverage.report]
|
|
53
49
|
exclude_also = ["if TYPE_CHECKING:"]
|
|
54
50
|
omit = ["conftest.py", "tests.py", "tests/test_*.py"]
|
|
@@ -79,27 +75,23 @@ strict = true
|
|
|
79
75
|
strict_optional = true
|
|
80
76
|
warn_unreachable = true
|
|
81
77
|
|
|
82
|
-
[tool.poetry]
|
|
83
|
-
|
|
84
78
|
[tool.poetry.dependencies]
|
|
85
79
|
python = ">=3.10,<3.14"
|
|
86
80
|
requests = "^2.32.3"
|
|
87
|
-
typing-extensions = "^4.13.
|
|
81
|
+
typing-extensions = "^4.13.2"
|
|
88
82
|
|
|
89
83
|
[tool.poetry.dependencies.yt-dlp]
|
|
90
84
|
extras = ["default"]
|
|
91
|
-
version = "^2025.
|
|
92
|
-
|
|
93
|
-
[tool.poetry.group]
|
|
85
|
+
version = "^2025.5.22"
|
|
94
86
|
|
|
95
87
|
[tool.poetry.group.dev]
|
|
96
88
|
optional = true
|
|
97
89
|
|
|
98
90
|
[tool.poetry.group.dev.dependencies]
|
|
99
|
-
commitizen = "^4.
|
|
91
|
+
commitizen = "^4.8.2"
|
|
100
92
|
djlint = "^1.36.4"
|
|
101
93
|
mypy = ">=1.12,<1.16"
|
|
102
|
-
ruff = "^0.11.
|
|
94
|
+
ruff = "^0.11.11"
|
|
103
95
|
types-requests = "^2.32.0.20250328"
|
|
104
96
|
yapf = "^0.43.0"
|
|
105
97
|
yt-dlp-types = "^0"
|
|
@@ -114,19 +106,22 @@ docutils = "^0.21.2"
|
|
|
114
106
|
esbonio = "^0.16.5"
|
|
115
107
|
numpydoc = "^1.8.0"
|
|
116
108
|
restructuredtext-lint = "^1.4.0"
|
|
117
|
-
sphinx = "<8.2.0"
|
|
118
109
|
sphinx-click = "^6.0.0"
|
|
119
110
|
sphinx-datatables = "^0.2.1"
|
|
120
111
|
sphinx-hoverxref = "^1.4.2"
|
|
121
|
-
sphinx-immaterial = "^0.13.
|
|
112
|
+
sphinx-immaterial = "^0.13.5"
|
|
122
113
|
|
|
123
114
|
[tool.poetry.group.docs.dependencies.enum-tools]
|
|
124
115
|
extras = ["sphinx"]
|
|
125
|
-
version = "^0.
|
|
116
|
+
version = "^0.13.0"
|
|
126
117
|
|
|
127
|
-
[tool.poetry.group.docs.dependencies.
|
|
128
|
-
|
|
129
|
-
version = "
|
|
118
|
+
[[tool.poetry.group.docs.dependencies.sphinx]]
|
|
119
|
+
python = ">=3.11"
|
|
120
|
+
version = "^8.2.0"
|
|
121
|
+
|
|
122
|
+
[[tool.poetry.group.docs.dependencies.sphinx]]
|
|
123
|
+
python = "<3.11"
|
|
124
|
+
version = "^7.2.5"
|
|
130
125
|
|
|
131
126
|
[tool.poetry.group.tests]
|
|
132
127
|
optional = true
|
|
@@ -135,7 +130,7 @@ optional = true
|
|
|
135
130
|
mock = "^5.2.0"
|
|
136
131
|
pytest = "^8.3.5"
|
|
137
132
|
pytest-cov = "^6.1.1"
|
|
138
|
-
pytest-mock = "^3.14.
|
|
133
|
+
pytest-mock = "^3.14.1"
|
|
139
134
|
|
|
140
135
|
[tool.poetry.group.tests.dependencies.coveralls]
|
|
141
136
|
python = "<3.13"
|
|
@@ -160,8 +155,6 @@ reportUnnecessaryTypeIgnoreComment = "none"
|
|
|
160
155
|
typeCheckingMode = "off"
|
|
161
156
|
useLibraryCodeForTypes = false
|
|
162
157
|
|
|
163
|
-
[tool.pytest]
|
|
164
|
-
|
|
165
158
|
[tool.pytest.ini_options]
|
|
166
159
|
mock_use_standalone_module = true
|
|
167
160
|
norecursedirs = ["node_modules"]
|
|
@@ -191,6 +184,7 @@ extend-select = [
|
|
|
191
184
|
"CPY",
|
|
192
185
|
"D",
|
|
193
186
|
"DJ",
|
|
187
|
+
"DOC",
|
|
194
188
|
"DTZ",
|
|
195
189
|
"E",
|
|
196
190
|
"EM",
|
|
@@ -198,6 +192,7 @@ extend-select = [
|
|
|
198
192
|
"EXE",
|
|
199
193
|
"F",
|
|
200
194
|
"FA",
|
|
195
|
+
"FAST",
|
|
201
196
|
"FBT",
|
|
202
197
|
"FIX",
|
|
203
198
|
"FLY",
|
|
@@ -229,11 +224,12 @@ extend-select = [
|
|
|
229
224
|
"SLOT",
|
|
230
225
|
"T10",
|
|
231
226
|
"T20",
|
|
232
|
-
"
|
|
227
|
+
"TC",
|
|
233
228
|
"TD",
|
|
234
229
|
"TID",
|
|
235
230
|
"TRY",
|
|
236
231
|
"UP",
|
|
232
|
+
"W",
|
|
237
233
|
"YTT",
|
|
238
234
|
]
|
|
239
235
|
ignore = [
|
|
@@ -245,17 +241,11 @@ ignore = [
|
|
|
245
241
|
"C901",
|
|
246
242
|
"COM812",
|
|
247
243
|
"CPY001",
|
|
248
|
-
"
|
|
249
|
-
"D101",
|
|
250
|
-
"D102",
|
|
251
|
-
"D103",
|
|
252
|
-
"D104",
|
|
253
|
-
"D105",
|
|
254
|
-
"D106",
|
|
255
|
-
"D107",
|
|
244
|
+
"D201",
|
|
256
245
|
"D203",
|
|
257
246
|
"D204",
|
|
258
247
|
"D212",
|
|
248
|
+
"DOC201",
|
|
259
249
|
"EM101",
|
|
260
250
|
"N818",
|
|
261
251
|
"PLR0912",
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"""Utilities."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from typing import TYPE_CHECKING
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
5
5
|
import logging
|
|
6
6
|
import re
|
|
7
7
|
import sys
|
|
8
8
|
|
|
9
9
|
from requests.adapters import HTTPAdapter
|
|
10
|
+
from typing_extensions import Unpack
|
|
10
11
|
from urllib3 import Retry
|
|
11
12
|
from yt_dlp.cookies import extract_cookies_from_browser
|
|
12
13
|
import requests
|
|
@@ -48,23 +49,24 @@ class YoutubeDLLogger(yt_dlp.cookies.YDLLogger):
|
|
|
48
49
|
|
|
49
50
|
|
|
50
51
|
def get_configured_yt_dlp(sleep_time: int = 3,
|
|
51
|
-
logger: Any = None,
|
|
52
52
|
*,
|
|
53
|
-
debug: bool = False
|
|
53
|
+
debug: bool = False,
|
|
54
|
+
**kwargs: Unpack[yt_dlp.YDLOpts]) -> yt_dlp.YoutubeDL:
|
|
54
55
|
"""
|
|
55
56
|
Get a configured ``YoutubeDL`` instance.
|
|
56
57
|
|
|
57
58
|
This function sets up a ``yt_dlp.YoutubeDL`` instance with the user's configuration (e.g.
|
|
58
|
-
located at ``~/.config/yt-dlp/config``). It overrides the default logger
|
|
59
|
-
|
|
59
|
+
located at ``~/.config/yt-dlp/config``). It overrides the default logger (``logger`` option),
|
|
60
|
+
disables colours (``color`` option), and sets the sleep time between requests
|
|
61
|
+
(``sleep_interval_requests`` option). It also sets the ``verbose`` flag based on the ``debug``
|
|
60
62
|
parameter.
|
|
61
63
|
|
|
64
|
+
All other keyword arguments are passed directly to the ``yt_dlp.YoutubeDL`` constructor.
|
|
65
|
+
|
|
62
66
|
Parameters
|
|
63
67
|
----------
|
|
64
68
|
sleep_time : int
|
|
65
69
|
The time to sleep between requests, in seconds. Default is 3 seconds.
|
|
66
|
-
logger : Any
|
|
67
|
-
The logger to use. See :py:class:`YoutubeDLLogger` for details.
|
|
68
70
|
debug : bool
|
|
69
71
|
Whether to enable debug mode. Default is False.
|
|
70
72
|
|
|
@@ -77,11 +79,11 @@ def get_configured_yt_dlp(sleep_time: int = 3,
|
|
|
77
79
|
sys.argv = [sys.argv[0]]
|
|
78
80
|
ydl_opts = yt_dlp.parse_options()[-1]
|
|
79
81
|
ydl_opts['color'] = {'stdout': 'never', 'stderr': 'never'}
|
|
80
|
-
ydl_opts['logger'] = logger
|
|
82
|
+
ydl_opts['logger'] = kwargs.pop('logger', YoutubeDLLogger())
|
|
81
83
|
ydl_opts['sleep_interval_requests'] = sleep_time
|
|
82
84
|
ydl_opts['verbose'] = debug
|
|
83
85
|
sys.argv = old_sys_argv
|
|
84
|
-
return yt_dlp.YoutubeDL(ydl_opts)
|
|
86
|
+
return yt_dlp.YoutubeDL(ydl_opts | kwargs)
|
|
85
87
|
|
|
86
88
|
|
|
87
89
|
def setup_session(browser: str,
|
|
File without changes
|
|
File without changes
|