mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 14:14:54 +01:00
parent
b99ba3df09
commit
fe0918bb65
|
@ -1,6 +1,5 @@
|
||||||
import base64
|
import base64
|
||||||
import contextlib
|
import contextlib
|
||||||
import ctypes
|
|
||||||
import http.cookiejar
|
import http.cookiejar
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
@ -876,10 +875,12 @@ def _decrypt_windows_dpapi(ciphertext, logger):
|
||||||
References:
|
References:
|
||||||
- https://docs.microsoft.com/en-us/windows/win32/api/dpapi/nf-dpapi-cryptunprotectdata
|
- 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):
|
class DATA_BLOB(ctypes.Structure):
|
||||||
_fields_ = [('cbData', DWORD),
|
_fields_ = [('cbData', ctypes.wintypes.DWORD),
|
||||||
('pbData', ctypes.POINTER(ctypes.c_char))]
|
('pbData', ctypes.POINTER(ctypes.c_char))]
|
||||||
|
|
||||||
buffer = ctypes.create_string_buffer(ciphertext)
|
buffer = ctypes.create_string_buffer(ciphertext)
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
import codecs
|
import codecs
|
||||||
import collections
|
import collections
|
||||||
import contextlib
|
import contextlib
|
||||||
import ctypes
|
|
||||||
import datetime
|
import datetime
|
||||||
import email.header
|
import email.header
|
||||||
import email.utils
|
import email.utils
|
||||||
|
@ -1983,6 +1982,7 @@ def __init__(self):
|
||||||
|
|
||||||
# Cross-platform file locking
|
# Cross-platform file locking
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
|
import ctypes
|
||||||
import ctypes.wintypes
|
import ctypes.wintypes
|
||||||
import msvcrt
|
import msvcrt
|
||||||
|
|
||||||
|
@ -2362,9 +2362,10 @@ def fix_xml_ampersands(xml_str):
|
||||||
def setproctitle(title):
|
def setproctitle(title):
|
||||||
assert isinstance(title, str)
|
assert isinstance(title, str)
|
||||||
|
|
||||||
# ctypes in Jython is not complete
|
# Workaround for https://github.com/yt-dlp/yt-dlp/issues/4541
|
||||||
# http://bugs.jython.org/issue2148
|
try:
|
||||||
if sys.platform.startswith('java'):
|
import ctypes
|
||||||
|
except ImportError:
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user