diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-08-03 17:47:38 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-08-03 17:48:59 +0530 |
commit | fe0918bb65c828ec81ce904cece58d450c117eba (patch) | |
tree | c36e7f7404f8bb2629e765c626e59c3d28f8d88a /yt_dlp/cookies.py | |
parent | b99ba3df096cd9c2973f7cf978c58ccfb3fa2200 (diff) | |
download | hypervideo-pre-fe0918bb65c828ec81ce904cece58d450c117eba.tar.lz hypervideo-pre-fe0918bb65c828ec81ce904cece58d450c117eba.tar.xz hypervideo-pre-fe0918bb65c828ec81ce904cece58d450c117eba.zip |
Import ctypes only when necessary
Closes #4541
Diffstat (limited to 'yt_dlp/cookies.py')
-rw-r--r-- | yt_dlp/cookies.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/yt_dlp/cookies.py b/yt_dlp/cookies.py index df8f97b44..1a164bb31 100644 --- a/yt_dlp/cookies.py +++ b/yt_dlp/cookies.py @@ -1,6 +1,5 @@ import base64 import contextlib -import ctypes import http.cookiejar import json import os @@ -876,10 +875,12 @@ def _decrypt_windows_dpapi(ciphertext, logger): References: - https://docs.microsoft.com/en-us/windows/win32/api/dpapi/nf-dpapi-cryptunprotectdata """ - from ctypes.wintypes import DWORD + + import ctypes + import ctypes.wintypes class DATA_BLOB(ctypes.Structure): - _fields_ = [('cbData', DWORD), + _fields_ = [('cbData', ctypes.wintypes.DWORD), ('pbData', ctypes.POINTER(ctypes.c_char))] buffer = ctypes.create_string_buffer(ciphertext) |