yt-dlp-utils 0.0.3__tar.gz → 0.0.5__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.

@@ -1,15 +1,14 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: yt-dlp-utils
3
- Version: 0.0.3
3
+ Version: 0.0.5
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 :: 2 - Pre-Alpha
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.1,<5.0.0)
21
- Requires-Dist: yt-dlp[default] (>=2025.3.31,<2026.0.0)
19
+ Requires-Dist: typing-extensions (>=4.14.0,<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
  [![PyPI - Version](https://img.shields.io/pypi/v/yt-dlp-utils)](https://pypi.org/project/yt-dlp-utils/)
32
31
  [![GitHub tag (with filter)](https://img.shields.io/github/v/tag/Tatsh/yt-dlp-utils)](https://github.com/Tatsh/yt-dlp-utils/tags)
33
32
  [![License](https://img.shields.io/github/license/Tatsh/yt-dlp-utils)](https://github.com/Tatsh/yt-dlp-utils/blob/master/LICENSE.txt)
34
- [![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/Tatsh/yt-dlp-utils/v0.0.3/master)](https://github.com/Tatsh/yt-dlp-utils/compare/v0.0.3...master)
33
+ [![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/Tatsh/yt-dlp-utils/v0.0.5/master)](https://github.com/Tatsh/yt-dlp-utils/compare/v0.0.5...master)
35
34
  [![QA](https://github.com/Tatsh/yt-dlp-utils/actions/workflows/qa.yml/badge.svg)](https://github.com/Tatsh/yt-dlp-utils/actions/workflows/qa.yml)
36
35
  [![Tests](https://github.com/Tatsh/yt-dlp-utils/actions/workflows/tests.yml/badge.svg)](https://github.com/Tatsh/yt-dlp-utils/actions/workflows/tests.yml)
37
36
  [![Coverage Status](https://coveralls.io/repos/github/Tatsh/yt-dlp-utils/badge.svg?branch=master)](https://coveralls.io/github/Tatsh/yt-dlp-utils?branch=master)
@@ -4,7 +4,7 @@
4
4
  [![PyPI - Version](https://img.shields.io/pypi/v/yt-dlp-utils)](https://pypi.org/project/yt-dlp-utils/)
5
5
  [![GitHub tag (with filter)](https://img.shields.io/github/v/tag/Tatsh/yt-dlp-utils)](https://github.com/Tatsh/yt-dlp-utils/tags)
6
6
  [![License](https://img.shields.io/github/license/Tatsh/yt-dlp-utils)](https://github.com/Tatsh/yt-dlp-utils/blob/master/LICENSE.txt)
7
- [![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/Tatsh/yt-dlp-utils/v0.0.3/master)](https://github.com/Tatsh/yt-dlp-utils/compare/v0.0.3...master)
7
+ [![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/Tatsh/yt-dlp-utils/v0.0.5/master)](https://github.com/Tatsh/yt-dlp-utils/compare/v0.0.5...master)
8
8
  [![QA](https://github.com/Tatsh/yt-dlp-utils/actions/workflows/qa.yml/badge.svg)](https://github.com/Tatsh/yt-dlp-utils/actions/workflows/qa.yml)
9
9
  [![Tests](https://github.com/Tatsh/yt-dlp-utils/actions/workflows/tests.yml/badge.svg)](https://github.com/Tatsh/yt-dlp-utils/actions/workflows/tests.yml)
10
10
  [![Coverage Status](https://coveralls.io/repos/github/Tatsh/yt-dlp-utils/badge.svg?branch=master)](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 :: 2 - Pre-Alpha",
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.3"
22
+ version = "0.0.5"
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,30 +75,26 @@ 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.1"
81
+ typing-extensions = "^4.14.0"
88
82
 
89
83
  [tool.poetry.dependencies.yt-dlp]
90
84
  extras = ["default"]
91
- version = "^2025.3.31"
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.5.0"
91
+ commitizen = "^4.8.2"
100
92
  djlint = "^1.36.4"
101
- mypy = ">=1.12,<1.16"
102
- ruff = "^0.11.7"
103
- types-requests = "^2.32.0.20250328"
93
+ mypy = "^1.16.0"
94
+ ruff = "^0.11.13"
95
+ types-requests = "^2.32.0.20250602"
104
96
  yapf = "^0.43.0"
105
- yt-dlp-types = "^0"
97
+ yt-dlp-types = "^0.0.17"
106
98
 
107
99
  [tool.poetry.group.docs]
108
100
  optional = true
@@ -114,28 +106,31 @@ 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.4"
112
+ sphinx-immaterial = "^0.13.5"
122
113
 
123
114
  [tool.poetry.group.docs.dependencies.enum-tools]
124
115
  extras = ["sphinx"]
125
- version = "^0.12.0"
116
+ version = "^0.13.0"
126
117
 
127
- [tool.poetry.group.docs.dependencies.erdantic]
128
- optional = true
129
- version = "<2.0"
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
133
128
 
134
129
  [tool.poetry.group.tests.dependencies]
135
130
  mock = "^5.2.0"
136
- pytest = "^8.3.5"
131
+ pytest = "^8.4.0"
137
132
  pytest-cov = "^6.1.1"
138
- pytest-mock = "^3.14.0"
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
- "TCH",
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
- "D100",
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",
@@ -4,4 +4,4 @@ from __future__ import annotations
4
4
  from .lib import YoutubeDLLogger, get_configured_yt_dlp, setup_session
5
5
 
6
6
  __all__ = ('YoutubeDLLogger', 'get_configured_yt_dlp', 'setup_session')
7
- __version__ = '0.0.3'
7
+ __version__ = '0.0.5'
@@ -1,3 +1,4 @@
1
+ """Constants."""
1
2
  from __future__ import annotations
2
3
 
3
4
  __all__ = ('DEFAULT_RETRY_BACKOFF_FACTOR', 'DEFAULT_RETRY_STATUS_FORCELIST', 'SHARED_HEADERS',
@@ -1,12 +1,13 @@
1
1
  """Utilities."""
2
2
  from __future__ import annotations
3
3
 
4
- from typing import TYPE_CHECKING, Any
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
@@ -34,11 +35,7 @@ class YoutubeDLLogger(yt_dlp.cookies.YDLLogger):
34
35
  """Log an info message."""
35
36
  log.info('%s', re.sub(r'^\[info\]\s+', '', message))
36
37
 
37
- def warning(
38
- self,
39
- message: str,
40
- once: bool = False, # noqa: FBT001, FBT002
41
- only_once: bool = False) -> None: # noqa: FBT001, FBT002
38
+ def warning(self, message: str, *, only_once: bool = False) -> None: # type: ignore[override]
42
39
  """Log a warning message."""
43
40
  log.warning('%s', re.sub(r'^\[warn(?:ing)?\]\s+', '', message))
44
41
 
@@ -48,23 +45,24 @@ class YoutubeDLLogger(yt_dlp.cookies.YDLLogger):
48
45
 
49
46
 
50
47
  def get_configured_yt_dlp(sleep_time: int = 3,
51
- logger: Any = None,
52
48
  *,
53
- debug: bool = False) -> yt_dlp.YoutubeDL:
49
+ debug: bool = False,
50
+ **kwargs: Unpack[yt_dlp._Params]) -> yt_dlp.YoutubeDL:
54
51
  """
55
52
  Get a configured ``YoutubeDL`` instance.
56
53
 
57
54
  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, disables colours, and
59
- sets the sleep time between requests. It also sets the verbose flag based on the ``debug``
55
+ located at ``~/.config/yt-dlp/config``). It overrides the default logger (``logger`` option),
56
+ disables colours (``color`` option), and sets the sleep time between requests
57
+ (``sleep_interval_requests`` option). It also sets the ``verbose`` flag based on the ``debug``
60
58
  parameter.
61
59
 
60
+ All other keyword arguments are passed directly to the ``yt_dlp.YoutubeDL`` constructor.
61
+
62
62
  Parameters
63
63
  ----------
64
64
  sleep_time : int
65
65
  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
66
  debug : bool
69
67
  Whether to enable debug mode. Default is False.
70
68
 
@@ -77,11 +75,11 @@ def get_configured_yt_dlp(sleep_time: int = 3,
77
75
  sys.argv = [sys.argv[0]]
78
76
  ydl_opts = yt_dlp.parse_options()[-1]
79
77
  ydl_opts['color'] = {'stdout': 'never', 'stderr': 'never'}
80
- ydl_opts['logger'] = logger or YoutubeDLLogger()
78
+ ydl_opts['logger'] = kwargs.pop('logger', YoutubeDLLogger())
81
79
  ydl_opts['sleep_interval_requests'] = sleep_time
82
80
  ydl_opts['verbose'] = debug
83
81
  sys.argv = old_sys_argv
84
- return yt_dlp.YoutubeDL(ydl_opts)
82
+ return yt_dlp.YoutubeDL(ydl_opts | kwargs)
85
83
 
86
84
 
87
85
  def setup_session(browser: str,
File without changes