2 requires = ["hatchling"]
3 build-backend = "hatchling.build"
8 {name = "pukkandan", email = "pukkandan.ytdlp@gmail.com"},
9 {name = "Grub4K", email = "contact@grub4k.xyz"},
10 {name = "bashonly", email = "bashonly@protonmail.com"},
11 {name = "coletdjnz", email = "coletdjnz@protonmail.com"},
12 {name = "sepro", email = "sepro@sepr0.com"},
14 description = "A feature-rich command-line audio/video downloader"
16 requires-python = ">=3.8"
25 license = {file = "LICENSE"}
27 "Topic :: Multimedia :: Video",
28 "Development Status :: 5 - Production/Stable",
29 "Environment :: Console",
30 "Programming Language :: Python",
31 "Programming Language :: Python :: 3 :: Only",
32 "Programming Language :: Python :: 3.8",
33 "Programming Language :: Python :: 3.9",
34 "Programming Language :: Python :: 3.10",
35 "Programming Language :: Python :: 3.11",
36 "Programming Language :: Python :: 3.12",
37 "Programming Language :: Python :: Implementation",
38 "Programming Language :: Python :: Implementation :: CPython",
39 "Programming Language :: Python :: Implementation :: PyPy",
40 "License :: OSI Approved :: The Unlicense (Unlicense)",
41 "Operating System :: OS Independent",
45 "brotli; implementation_name=='cpython'",
46 "brotlicffi; implementation_name!='cpython'",
50 "requests>=2.32.2,<3",
51 "urllib3>=1.26.17,<3",
55 [project.optional-dependencies]
58 "curl-cffi==0.5.10; os_name=='nt' and implementation_name=='cpython'",
59 "curl-cffi>=0.5.10,!=0.6.*,<0.7.2; os_name!='nt' and implementation_name=='cpython'",
69 "setuptools>=71.0.2", # 71.0.0 broke pyinstaller
74 "yt-dlp[static-analysis]",
83 "pytest-rerunfailures~=14.0",
86 "pyinstaller>=6.10.0", # Windows temp cleanup fixed in 6.10.0
93 Documentation = "https://github.com/yt-dlp/yt-dlp#readme"
94 Repository = "https://github.com/yt-dlp/yt-dlp"
95 Tracker = "https://github.com/yt-dlp/yt-dlp/issues"
96 Funding = "https://github.com/yt-dlp/yt-dlp/blob/master/Collaborators.md#collaborators"
99 yt-dlp = "yt_dlp:main"
101 [project.entry-points.pyinstaller40]
102 hook-dirs = "yt_dlp.__pyinstaller:get_hook_dirs"
104 [tool.hatch.build.targets.sdist]
109 "/.gitignore", # included by default, needed for auto-excludes
111 "/LICENSE", # included as license
112 "/pyproject.toml", # included by default
113 "/README.md", # included as readme
115 "/supportedsites.md",
118 "/yt_dlp/extractor/lazy_extractors.py",
120 "/AUTHORS", # included by default
125 [tool.hatch.build.targets.wheel]
126 packages = ["yt_dlp"]
127 artifacts = ["/yt_dlp/extractor/lazy_extractors.py"]
129 [tool.hatch.build.targets.wheel.shared-data]
130 "completions/bash/yt-dlp" = "share/bash-completion/completions/yt-dlp"
131 "completions/zsh/_yt-dlp" = "share/zsh/site-functions/_yt-dlp"
132 "completions/fish/yt-dlp.fish" = "share/fish/vendor_completions.d/yt-dlp.fish"
133 "README.txt" = "share/doc/yt_dlp/README.txt"
134 "yt-dlp.1" = "share/man/man1/yt-dlp.1"
137 path = "yt_dlp/version.py"
138 pattern = "_pkg_version = '(?P<version>[^']+)'"
140 [tool.hatch.envs.default]
141 features = ["curl-cffi", "default"]
142 dependencies = ["pre-commit"]
146 [tool.hatch.envs.default.scripts]
147 setup = "pre-commit install --config .pre-commit-hatch.yaml"
148 yt-dlp = "python -Werror -Xdev -m yt_dlp {args}"
150 [tool.hatch.envs.hatch-static-analysis]
152 features = ["static-analysis"]
153 dependencies = [] # override hatch ruff version
154 config-path = "pyproject.toml"
156 [tool.hatch.envs.hatch-static-analysis.scripts]
157 format-check = "autopep8 --diff {args:.}"
158 format-fix = "autopep8 --in-place {args:.}"
159 lint-check = "ruff check {args:.}"
160 lint-fix = "ruff check --fix {args:.}"
162 [tool.hatch.envs.hatch-test]
165 "pytest-randomly~=3.15",
166 "pytest-xdist[psutil]~=3.5",
169 [tool.hatch.envs.hatch-test.scripts]
170 run = "python -m devscripts.run_tests {args}"
171 run-cov = "echo Code coverage not implemented && exit 1"
173 [[tool.hatch.envs.hatch-test.matrix]]
190 "E402", # module-import-not-at-top-of-file
191 "E501", # line-too-long
192 "E731", # lambda-assignment
193 "E741", # ambiguous-variable-name
194 "UP036", # outdated-version-block
195 "B006", # mutable-argument-default
196 "B008", # function-call-in-default-argument
197 "B011", # assert-false
198 "B017", # assert-raises-exception
199 "B023", # function-uses-loop-variable (false positives)
200 "B028", # no-explicit-stacklevel
201 "B904", # raise-without-from-inside-except
202 "C401", # unnecessary-generator-set
203 "C402", # unnecessary-generator-dict
204 "PIE790", # unnecessary-placeholder
205 "SIM102", # collapsible-if
206 "SIM108", # if-else-block-instead-of-if-exp
207 "SIM112", # uncapitalized-environment-variables
208 "SIM113", # enumerate-for-loop
209 "SIM114", # if-with-same-arms
210 "SIM115", # open-file-with-context-handler
211 "SIM117", # multiple-with-statements
212 "SIM223", # expr-and-false
213 "SIM300", # yoda-conditions
214 "TD001", # invalid-todo-tag
215 "TD002", # missing-todo-author
216 "TD003", # missing-todo-link
217 "PLE0604", # invalid-all-object (false positives)
218 "PLE0643", # potential-index-error (false positives)
219 "PLW0603", # global-statement
220 "PLW1510", # subprocess-run-without-check
221 "PLW2901", # redefined-loop-name
222 "RUF001", # ambiguous-unicode-character-string
223 "RUF012", # mutable-class-default
224 "RUF100", # unused-noqa (flake8 has slightly different behavior)
227 "E", # pycodestyle Error
228 "W", # pycodestyle Warning
232 "N803", # invalid-argument-name
233 "N804", # invalid-first-argument-name-for-class-method
235 "B", # flake8-bugbear
236 "A", # flake8-builtins
237 "COM", # flake8-commas
238 "C4", # flake8-comprehensions
239 "FA", # flake8-future-annotations
240 "ISC", # flake8-implicit-str-concat
241 "ICN003", # banned-import-from
243 "T20", # flake8-print
244 "RSE", # flake8-raise
245 "RET504", # unnecessary-assign
246 "SIM", # flake8-simplify
247 "TID251", # banned-api
249 "PLC", # Pylint Convention
250 "PLE", # Pylint Error
251 "PLW", # Pylint Warning
252 "RUF", # Ruff-specific rules
255 [tool.ruff.lint.per-file-ignores]
256 "devscripts/lazy_load_template.py" = [
257 "F401", # unused-import
259 "!yt_dlp/extractor/**.py" = [
261 "ICN003", # banned-import-from
262 "T20", # flake8-print
263 "A002", # builtin-argument-shadowing
264 "C408", # unnecessary-collection-call
266 "yt_dlp/jsinterp.py" = [
267 "UP031", # printf-string-formatting
270 [tool.ruff.lint.isort]
271 known-first-party = [
276 relative-imports-order = "closest-to-furthest"
278 [tool.ruff.lint.flake8-quotes]
279 docstring-quotes = "double"
280 multiline-quotes = "single"
281 inline-quotes = "single"
284 [tool.ruff.lint.pep8-naming]
285 classmethod-decorators = [
286 "yt_dlp.utils.classproperty",
289 [tool.ruff.lint.flake8-import-conventions]
311 [tool.ruff.lint.flake8-tidy-imports.banned-api]
312 "yt_dlp.compat.compat_str".msg = "Use `str` instead."
313 "yt_dlp.compat.compat_b64decode".msg = "Use `base64.b64decode` instead."
314 "yt_dlp.compat.compat_urlparse".msg = "Use `urllib.parse` instead."
315 "yt_dlp.compat.compat_parse_qs".msg = "Use `urllib.parse.parse_qs` instead."
316 "yt_dlp.compat.compat_urllib_parse_unquote".msg = "Use `urllib.parse.unquote` instead."
317 "yt_dlp.compat.compat_urllib_parse_urlencode".msg = "Use `urllib.parse.urlencode` instead."
318 "yt_dlp.compat.compat_urllib_parse_urlparse".msg = "Use `urllib.parse.urlparse` instead."
319 "yt_dlp.compat.compat_shlex_quote".msg = "Use `yt_dlp.utils.shell_quote` instead."
320 "yt_dlp.utils.error_to_compat_str".msg = "Use `str` instead."
323 max_line_length = 120
384 [tool.pytest.ini_options]
385 addopts = "-ra -v --strict-markers"