Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 7b7b6cf

Browse files
committed
Add module yt-dlp
1 parent b1eaa24 commit 7b7b6cf

File tree

1,054 files changed

+37167
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,054 files changed

+37167
-1
lines changed

.type_stubs/yt_dlp/YoutubeDL.pyi

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

.type_stubs/yt_dlp/__init__.pyi

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
"""
2+
This type stub file was generated by pyright.
3+
"""
4+
5+
import collections
6+
import getpass
7+
import itertools
8+
import optparse
9+
import os
10+
import re
11+
import sys
12+
from .compat import compat_shlex_quote
13+
from .cookies import SUPPORTED_BROWSERS, SUPPORTED_KEYRINGS
14+
from .downloader import FileDownloader
15+
from .downloader.external import get_external_downloader
16+
from .extractor import gen_extractors, list_extractor_classes, list_extractors
17+
from .extractor.adobepass import MSO_INFO
18+
from .extractor.common import InfoExtractor
19+
from .options import parseOpts
20+
from .postprocessor import FFmpegExtractAudioPP, FFmpegMergerPP, FFmpegPostProcessor, FFmpegSubtitlesConvertorPP, FFmpegThumbnailsConvertorPP, FFmpegVideoConvertorPP, FFmpegVideoRemuxerPP, MetadataFromFieldPP, MetadataParserPP
21+
from .update import Updater
22+
from .utils import DateRange, DownloadCancelled, DownloadError, GeoUtils, NO_DEFAULT, POSTPROCESS_WHEN, PlaylistEntries, SameFileError, decodeOption, download_range_func, expand_path, float_or_none, format_field, int_or_none, match_filter_func, parse_duration, preferredencoding, read_batch_urls, read_stdin, render_table, setproctitle, std_headers, traverse_obj, variadic, write_string
23+
from .YoutubeDL import YoutubeDL
24+
25+
__license__ = ...
26+
_IN_CLI = ...
27+
def get_urls(urls, batchfile, verbose): # -> list[str | Unknown]:
28+
...
29+
30+
def print_extractor_information(opts, urls): # -> bool:
31+
...
32+
33+
def set_compat_opts(opts): # -> None:
34+
...
35+
36+
def validate_options(opts): # -> tuple[list[Unknown], list[Unknown]]:
37+
...
38+
39+
def get_postprocessors(opts): # -> Generator[Unknown | dict[str, str | Unknown] | dict[str, str | Unknown | bool] | dict[str, str], None, None]:
40+
...
41+
42+
ParsedOptions = ...
43+
def parse_options(argv=...): # -> ParsedOptions:
44+
"""@returns ParsedOptions(parser, opts, urls, ydl_opts)"""
45+
...
46+
47+
def main(argv=...):
48+
...
49+
50+
__all__ = ['main', 'YoutubeDL', 'parse_options', 'gen_extractors', 'list_extractors']

.type_stubs/yt_dlp/__main__.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""
2+
This type stub file was generated by pyright.
3+
"""
4+
5+
import sys
6+
7+
if __package__ is None and notgetattr(sys, 'frozen', False):
8+
path = ...
9+
if __name__ == '__main__':
10+
...

.type_stubs/yt_dlp/aes.pyi

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
"""
2+
This type stub file was generated by pyright.
3+
"""
4+
5+
from .dependencies import Cryptodome_AES
6+
7+
if Cryptodome_AES:
8+
def aes_cbc_decrypt_bytes(data, key, iv): # -> bytes:
9+
""" Decrypt bytes with AES-CBC using pycryptodome """
10+
...
11+
12+
def aes_gcm_decrypt_and_verify_bytes(data, key, tag, nonce): # -> bytes:
13+
""" Decrypt bytes with AES-GCM using pycryptodome """
14+
...
15+
16+
else:
17+
def aes_cbc_decrypt_bytes(data, key, iv): # -> bytes:
18+
""" Decrypt bytes with AES-CBC using native implementation since pycryptodome is unavailable """
19+
...
20+
21+
def aes_gcm_decrypt_and_verify_bytes(data, key, tag, nonce): # -> bytes:
22+
""" Decrypt bytes with AES-GCM using native implementation since pycryptodome is unavailable """
23+
...
24+
25+
def aes_cbc_encrypt_bytes(data, key, iv, **kwargs): # -> bytes:
26+
...
27+
28+
BLOCK_SIZE_BYTES = ...
29+
def unpad_pkcs7(data):
30+
...
31+
32+
def pkcs7_padding(data):
33+
"""
34+
PKCS#7 padding
35+
36+
@param {int[]} data cleartext
37+
@returns {int[]} padding data
38+
"""
39+
...
40+
41+
def pad_block(block, padding_mode):
42+
"""
43+
Pad a block with the given padding mode
44+
@param {int[]} block block to pad
45+
@param padding_mode padding mode
46+
"""
47+
...
48+
49+
def aes_ecb_encrypt(data, key, iv=...): # -> list[Unknown]:
50+
"""
51+
Encrypt with aes in ECB mode. Using PKCS#7 padding
52+
53+
@param {int[]} data cleartext
54+
@param {int[]} key 16/24/32-Byte cipher key
55+
@param {int[]} iv Unused for this mode
56+
@returns {int[]} encrypted data
57+
"""
58+
...
59+
60+
def aes_ecb_decrypt(data, key, iv=...): # -> list[Unknown]:
61+
"""
62+
Decrypt with aes in ECB mode
63+
64+
@param {int[]} data cleartext
65+
@param {int[]} key 16/24/32-Byte cipher key
66+
@param {int[]} iv Unused for this mode
67+
@returns {int[]} decrypted data
68+
"""
69+
...
70+
71+
def aes_ctr_decrypt(data, key, iv): # -> list[Unknown]:
72+
"""
73+
Decrypt with aes in counter mode
74+
75+
@param {int[]} data cipher
76+
@param {int[]} key 16/24/32-Byte cipher key
77+
@param {int[]} iv 16-Byte initialization vector
78+
@returns {int[]} decrypted data
79+
"""
80+
...
81+
82+
def aes_ctr_encrypt(data, key, iv): # -> list[Unknown]:
83+
"""
84+
Encrypt with aes in counter mode
85+
86+
@param {int[]} data cleartext
87+
@param {int[]} key 16/24/32-Byte cipher key
88+
@param {int[]} iv 16-Byte initialization vector
89+
@returns {int[]} encrypted data
90+
"""
91+
...
92+
93+
def aes_cbc_decrypt(data, key, iv): # -> list[Unknown]:
94+
"""
95+
Decrypt with aes in CBC mode
96+
97+
@param {int[]} data cipher
98+
@param {int[]} key 16/24/32-Byte cipher key
99+
@param {int[]} iv 16-Byte IV
100+
@returns {int[]} decrypted data
101+
"""
102+
...
103+
104+
def aes_cbc_encrypt(data, key, iv, *, padding_mode=...): # -> list[Unknown]:
105+
"""
106+
Encrypt with aes in CBC mode
107+
108+
@param {int[]} data cleartext
109+
@param {int[]} key 16/24/32-Byte cipher key
110+
@param {int[]} iv 16-Byte IV
111+
@param padding_mode Padding mode to use
112+
@returns {int[]} encrypted data
113+
"""
114+
...
115+
116+
def aes_gcm_decrypt_and_verify(data, key, tag, nonce): # -> list[Unknown]:
117+
"""
118+
Decrypt with aes in GBM mode and checks authenticity using tag
119+
120+
@param {int[]} data cipher
121+
@param {int[]} key 16-Byte cipher key
122+
@param {int[]} tag authentication tag
123+
@param {int[]} nonce IV (recommended 12-Byte)
124+
@returns {int[]} decrypted data
125+
"""
126+
...
127+
128+
def aes_encrypt(data, expanded_key): # -> list[Unknown]:
129+
"""
130+
Encrypt one block with aes
131+
132+
@param {int[]} data 16-Byte state
133+
@param {int[]} expanded_key 176/208/240-Byte expanded key
134+
@returns {int[]} 16-Byte cipher
135+
"""
136+
...
137+
138+
def aes_decrypt(data, expanded_key): # -> list[Unknown]:
139+
"""
140+
Decrypt one block with aes
141+
142+
@param {int[]} data 16-Byte cipher
143+
@param {int[]} expanded_key 176/208/240-Byte expanded key
144+
@returns {int[]} 16-Byte state
145+
"""
146+
...
147+
148+
def aes_decrypt_text(data, password, key_size_bytes): # -> bytes:
149+
"""
150+
Decrypt text
151+
- The first 8 Bytes of decoded 'data' are the 8 high Bytes of the counter
152+
- The cipher key is retrieved by encrypting the first 16 Byte of 'password'
153+
with the first 'key_size_bytes' Bytes from 'password' (if necessary filled with 0's)
154+
- Mode of operation is 'counter'
155+
156+
@param {str} data Base64 encoded string
157+
@param {str,unicode} password Password (will be encoded with utf-8)
158+
@param {int} key_size_bytes Possible values: 16 for 128-Bit, 24 for 192-Bit or 32 for 256-Bit
159+
@returns {str} Decrypted data
160+
"""
161+
...
162+
163+
RCON = ...
164+
SBOX = ...
165+
SBOX_INV = ...
166+
MIX_COLUMN_MATRIX = ...
167+
MIX_COLUMN_MATRIX_INV = ...
168+
RIJNDAEL_EXP_TABLE = ...
169+
RIJNDAEL_LOG_TABLE = ...
170+
def key_expansion(data):
171+
"""
172+
Generate key schedule
173+
174+
@param {int[]} data 16/24/32-Byte cipher key
175+
@returns {int[]} 176/208/240-Byte expanded key
176+
"""
177+
...
178+
179+
def iter_vector(iv): # -> Generator[Unknown, None, None]:
180+
...
181+
182+
def sub_bytes(data): # -> list[int]:
183+
...
184+
185+
def sub_bytes_inv(data): # -> list[int]:
186+
...
187+
188+
def rotate(data):
189+
...
190+
191+
def key_schedule_core(data, rcon_iteration): # -> list[int]:
192+
...
193+
194+
def xor(data1, data2): # -> list[Unknown]:
195+
...
196+
197+
def iter_mix_columns(data, matrix): # -> Generator[int, None, None]:
198+
...
199+
200+
def shift_rows(data): # -> list[Unknown]:
201+
...
202+
203+
def shift_rows_inv(data): # -> list[Unknown]:
204+
...
205+
206+
def shift_block(data): # -> list[Unknown]:
207+
...
208+
209+
def inc(data):
210+
...
211+
212+
def block_product(block_x, block_y): # -> list[int] | list[Unknown]:
213+
...
214+
215+
def ghash(subkey, data): # -> list[int] | list[Unknown]:
216+
...
217+
218+
__all__ = ['aes_cbc_decrypt', 'aes_cbc_decrypt_bytes', 'aes_ctr_decrypt', 'aes_decrypt_text', 'aes_decrypt', 'aes_ecb_decrypt', 'aes_gcm_decrypt_and_verify', 'aes_gcm_decrypt_and_verify_bytes', 'aes_cbc_encrypt', 'aes_cbc_encrypt_bytes', 'aes_ctr_encrypt', 'aes_ecb_encrypt', 'aes_encrypt', 'key_expansion', 'pad_block', 'pkcs7_padding', 'unpad_pkcs7']

.type_stubs/yt_dlp/cache.pyi

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
This type stub file was generated by pyright.
3+
"""
4+
5+
class Cache:
6+
def __init__(self, ydl) -> None:
7+
...
8+
9+
@property
10+
def enabled(self): # -> bool:
11+
...
12+
13+
def store(self, section, key, data, dtype=...): # -> None:
14+
...
15+
16+
def load(self, section, key, dtype=..., default=..., *, min_ver=...): # -> Any | None:
17+
...
18+
19+
def remove(self): # -> None:
20+
...
21+
22+
23+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
"""
2+
This type stub file was generated by pyright.
3+
"""
4+
5+
import os
6+
import sys
7+
import warnings
8+
import xml.etree.ElementTree as etree
9+
from ._deprecated import *
10+
from .compat_utils import passthrough_module
11+
from shlex import quote as compat_shlex_quote
12+
13+
class compat_HTMLParseError(ValueError):
14+
...
15+
16+
17+
class _TreeBuilder(etree.TreeBuilder):
18+
def doctype(self, name, pubid, system): # -> None:
19+
...
20+
21+
22+
23+
def compat_etree_fromstring(text): # -> Element:
24+
...
25+
26+
compat_os_name = ...
27+
if compat_os_name == 'nt':
28+
def compat_shlex_quote(s):
29+
...
30+
31+
else:
32+
...
33+
def compat_ord(c): # -> int:
34+
...
35+
36+
if compat_os_name == 'nt' and sys.version_info < (3, 8):
37+
...
38+
else:
39+
compat_realpath = ...
40+
if compat_os_name in ('nt', 'ce'):
41+
def compat_expanduser(path):
42+
...
43+
44+
else:
45+
compat_expanduser = ...
46+
if False:
47+
...
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
This type stub file was generated by pyright.
3+
"""
4+
5+
import urllib.error
6+
import urllib.parse
7+
8+
"""Deprecated - New code should avoid these"""
9+
compat_str = str
10+
compat_b64decode = ...
11+
compat_HTTPError = urllib.error.HTTPError
12+
compat_urlparse = urllib.parse
13+
compat_parse_qs = ...
14+
compat_urllib_parse_unquote = ...
15+
compat_urllib_parse_urlencode = ...
16+
compat_urllib_parse_urlparse = ...

0 commit comments

Comments
 (0)