yt-dlp-utils 0.0.3__py3-none-any.whl → 0.0.4__py3-none-any.whl

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/__init__.py CHANGED
@@ -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.4'
yt_dlp_utils/constants.py CHANGED
@@ -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',
yt_dlp_utils/lib.py CHANGED
@@ -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
@@ -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) -> yt_dlp.YoutubeDL:
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, disables colours, and
59
- sets the sleep time between requests. It also sets the verbose flag based on the ``debug``
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 or YoutubeDLLogger()
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,
@@ -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.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 :: 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.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
  [![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.4/master)](https://github.com/Tatsh/yt-dlp-utils/compare/v0.0.4...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)
@@ -0,0 +1,8 @@
1
+ yt_dlp_utils/__init__.py,sha256=GP6qBU0cuggloj55QKWxpXDVSl4J-mJkXfcG8VTLiZA,250
2
+ yt_dlp_utils/constants.py,sha256=SNzzxIkyJRsVopyLQJtYGlZT_znvYbPFOg6klw5KDdI,746
3
+ yt_dlp_utils/lib.py,sha256=YXCBTVccmLk619Hs5ygkbFZtBDVcAIw7y75JNY1auC4,5283
4
+ yt_dlp_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ yt_dlp_utils-0.0.4.dist-info/LICENSE.txt,sha256=1z3v176A2bAtCVZXlb8HZXUf3HpQIjW2GanQd8PaVK4,1087
6
+ yt_dlp_utils-0.0.4.dist-info/METADATA,sha256=7QFfocC5N76B11QL9skbkJQ-mdIvmLgA8goWskGm7q0,3967
7
+ yt_dlp_utils-0.0.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
8
+ yt_dlp_utils-0.0.4.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.2
2
+ Generator: poetry-core 2.1.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,8 +0,0 @@
1
- yt_dlp_utils/__init__.py,sha256=X7TiX3gMNiWQ0TxPn955yYVwHUCAJAIddmQR2axyJOk,250
2
- yt_dlp_utils/constants.py,sha256=CXWDlIFPB_Aom_dfa9RwACX8i8DANivmlT0GQxnrYDg,729
3
- yt_dlp_utils/lib.py,sha256=hlzLfdouTdDT_b-7O4bg6zPKKee5Kn7rCFTuXxBxzAs,5127
4
- yt_dlp_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- yt_dlp_utils-0.0.3.dist-info/LICENSE.txt,sha256=1z3v176A2bAtCVZXlb8HZXUf3HpQIjW2GanQd8PaVK4,1087
6
- yt_dlp_utils-0.0.3.dist-info/METADATA,sha256=geul-XdSNkzzRa8OaFK4cy3kkSIpDasiXMIVVsGZ8Zk,4023
7
- yt_dlp_utils-0.0.3.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
8
- yt_dlp_utils-0.0.3.dist-info/RECORD,,