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

Commit ceb532c

Browse files
authored
Merge pull request #32 from code-yeongyu/feature/add-pyright
Add pyright as another type checker
2 parents 3dc3c58 + 9b93aa7 commit ceb532c

File tree

819 files changed

+16590
-5
lines changed

Some content is hidden

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

819 files changed

+16590
-5
lines changed

.typings/youtube_dl/YoutubeDL.pyi

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

.typings/youtube_dl/__init__.pyi

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""
2+
This type stub file was generated by pyright.
3+
"""
4+
5+
import codecs
6+
import io
7+
import os
8+
import random
9+
import sys
10+
from __future__ import unicode_literals
11+
from .options import parseOpts
12+
from .compat import compat_getpass, compat_shlex_split, workaround_optparse_bug9161
13+
from .utils import DEFAULT_OUTTMPL, DateRange, DownloadError, MaxDownloadsReached, SameFileError, decodeOption, expand_path, match_filter_func, preferredencoding, read_batch_urls, render_table, setproctitle, std_headers, write_string
14+
from .update import update_self
15+
from .downloader import FileDownloader
16+
from .extractor import gen_extractors, list_extractors
17+
from .extractor.adobepass import MSO_INFO
18+
from .YoutubeDL import YoutubeDL
19+
20+
__license__ = ...
21+
def main(argv=...):
22+
...
23+
24+
__all__ = ['main', 'YoutubeDL', 'gen_extractors', 'list_extractors']

.typings/youtube_dl/aes.pyi

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
"""
2+
This type stub file was generated by pyright.
3+
"""
4+
5+
BLOCK_SIZE_BYTES = ...
6+
def aes_ctr_decrypt(data, key, counter): # -> list[Unknown]:
7+
"""
8+
Decrypt with aes in counter mode
9+
10+
@param {int[]} data cipher
11+
@param {int[]} key 16/24/32-Byte cipher key
12+
@param {instance} counter Instance whose next_value function (@returns {int[]} 16-Byte block)
13+
returns the next counter block
14+
@returns {int[]} decrypted data
15+
"""
16+
...
17+
18+
def aes_cbc_decrypt(data, key, iv): # -> list[Unknown]:
19+
"""
20+
Decrypt with aes in CBC mode
21+
22+
@param {int[]} data cipher
23+
@param {int[]} key 16/24/32-Byte cipher key
24+
@param {int[]} iv 16-Byte IV
25+
@returns {int[]} decrypted data
26+
"""
27+
...
28+
29+
def aes_cbc_encrypt(data, key, iv): # -> list[Unknown]:
30+
"""
31+
Encrypt with aes in CBC mode. Using PKCS#7 padding
32+
33+
@param {int[]} data cleartext
34+
@param {int[]} key 16/24/32-Byte cipher key
35+
@param {int[]} iv 16-Byte IV
36+
@returns {int[]} encrypted data
37+
"""
38+
...
39+
40+
def key_expansion(data):
41+
"""
42+
Generate key schedule
43+
44+
@param {int[]} data 16/24/32-Byte cipher key
45+
@returns {int[]} 176/208/240-Byte expanded key
46+
"""
47+
...
48+
49+
def aes_encrypt(data, expanded_key): # -> list[Unknown]:
50+
"""
51+
Encrypt one block with aes
52+
53+
@param {int[]} data 16-Byte state
54+
@param {int[]} expanded_key 176/208/240-Byte expanded key
55+
@returns {int[]} 16-Byte cipher
56+
"""
57+
...
58+
59+
def aes_decrypt(data, expanded_key): # -> list[Unknown]:
60+
"""
61+
Decrypt one block with aes
62+
63+
@param {int[]} data 16-Byte cipher
64+
@param {int[]} expanded_key 176/208/240-Byte expanded key
65+
@returns {int[]} 16-Byte state
66+
"""
67+
...
68+
69+
def aes_decrypt_text(data, password, key_size_bytes): # -> bytes:
70+
"""
71+
Decrypt text
72+
- The first 8 Bytes of decoded 'data' are the 8 high Bytes of the counter
73+
- The cipher key is retrieved by encrypting the first 16 Byte of 'password'
74+
with the first 'key_size_bytes' Bytes from 'password' (if necessary filled with 0's)
75+
- Mode of operation is 'counter'
76+
77+
@param {str} data Base64 encoded string
78+
@param {str,unicode} password Password (will be encoded with utf-8)
79+
@param {int} key_size_bytes Possible values: 16 for 128-Bit, 24 for 192-Bit or 32 for 256-Bit
80+
@returns {str} Decrypted data
81+
"""
82+
class Counter:
83+
...
84+
85+
86+
87+
RCON = ...
88+
SBOX = ...
89+
SBOX_INV = ...
90+
MIX_COLUMN_MATRIX = ...
91+
MIX_COLUMN_MATRIX_INV = ...
92+
RIJNDAEL_EXP_TABLE = ...
93+
RIJNDAEL_LOG_TABLE = ...
94+
def sub_bytes(data): # -> list[int]:
95+
...
96+
97+
def sub_bytes_inv(data): # -> list[int]:
98+
...
99+
100+
def rotate(data):
101+
...
102+
103+
def key_schedule_core(data, rcon_iteration): # -> list[int]:
104+
...
105+
106+
def xor(data1, data2): # -> list[Unknown]:
107+
...
108+
109+
def rijndael_mul(a, b): # -> Literal[0, 1, 3, 5, 15, 17, 51, 85, 255, 26, 46, 114, 150, 161, 248, 19, 53, 95, 225, 56, 72, 216, 115, 149, 164, 247, 2, 6, 10, 30, 34, 102, 170, 229, 52, 92, 228, 55, 89, 235, 38, 106, 190, 217, 112, 144, 171, 230, 49, 83, 245, 4, 12, 20, 60, 68, 204, 79, 209, 104, 184, 211, 110, 178, 205, 76, 212, 103, 169, 224, 59, 77, 215, 98, 166, 241, 8, 24, 40, 120, 136, 131, 158, 185, 208, 107, 189, 220, 127, 129, 152, 179, 206, 73, 219, 118, 154, 181, 196, 87, 249, 16, 48, 80, 240, 11, 29, 39, 105, 187, 214, 97, 163, 254, 25, 43, 125, 135, 146, 173, 236, 47, 113, 147, 174, 233, 32, 96, 160, 251, 22, 58, 78, 210, 109, 183, 194, 93, 231, 50, 86, 250, 21, 63, 65, 195, 94, 226, 61, 71, 201, 64, 192, 91, 237, 44, 116, 156, 191, 218, 117, 159, 186, 213, 100, 172, 239, 42, 126, 130, 157, 188, 223, 122, 142, 137, 128, 155, 182, 193, 88, 232, 35, 101, 175, 234, 37, 111, 177, 200, 67, 197, 84, 252, 31, 33, 99, 165, 244, 7, 9, 27, 45, 119, 153, 176, 203, 70, 202, 69, 207, 74, 222, 121, 139, 134, 145, 168, 227, 62, 66, 198, 81, 243, 14, 18, 54, 90, 238, 41, 123, 141, 140, 143, 138, 133, 148, 167, 242, 13, 23, 57, 75, 221, 124, 132, 151, 162, 253, 28, 36, 108, 180, 199, 82, 246]:
110+
...
111+
112+
def mix_column(data, matrix): # -> list[Unknown]:
113+
...
114+
115+
def mix_columns(data, matrix=...): # -> list[Unknown]:
116+
...
117+
118+
def mix_columns_inv(data): # -> list[Unknown]:
119+
...
120+
121+
def shift_rows(data): # -> list[Unknown]:
122+
...
123+
124+
def shift_rows_inv(data): # -> list[Unknown]:
125+
...
126+
127+
def inc(data):
128+
...
129+
130+
__all__ = ['aes_encrypt', 'key_expansion', 'aes_ctr_decrypt', 'aes_cbc_decrypt', 'aes_decrypt_text']

.typings/youtube_dl/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=...): # -> Any | None:
17+
...
18+
19+
def remove(self): # -> None:
20+
...
21+
22+
23+

.typings/youtube_dl/compat.pyi

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
"""
2+
This type stub file was generated by pyright.
3+
"""
4+
5+
import platform
6+
import shutil
7+
import sys
8+
import xml.etree.ElementTree
9+
10+
if sys.version_info[0] == 2:
11+
...
12+
else:
13+
compat_cookiejar_Cookie = compat_cookiejar.Cookie
14+
if sys.version_info[0] == 2:
15+
...
16+
else:
17+
compat_cookies_SimpleCookie = compat_cookies.SimpleCookie
18+
etree = xml.etree.ElementTree
19+
class _TreeBuilder(etree.TreeBuilder):
20+
def doctype(self, name, pubid, system): # -> None:
21+
...
22+
23+
24+
25+
if sys.version_info[0] >= 3:
26+
def compat_etree_fromstring(text): # -> Element:
27+
...
28+
29+
else:
30+
...
31+
if hasattr(etree, 'register_namespace'):
32+
compat_etree_register_namespace = ...
33+
else:
34+
def compat_etree_register_namespace(prefix, uri): # -> None:
35+
"""Register a namespace prefix.
36+
The registry is global, and any existing mapping for either the
37+
given prefix or the namespace URI will be removed.
38+
*prefix* is the namespace prefix, *uri* is a namespace uri. Tags and
39+
attributes in this namespace will be serialized with prefix if possible.
40+
ValueError is raised if prefix is reserved or is invalid.
41+
"""
42+
...
43+
44+
if sys.version_info < (2, 7):
45+
...
46+
else:
47+
compat_xpath = ...
48+
compat_os_name = ...
49+
if compat_os_name == 'nt':
50+
def compat_shlex_quote(s):
51+
...
52+
53+
else:
54+
...
55+
def compat_ord(c): # -> int:
56+
...
57+
58+
if sys.version_info >= (3, 0):
59+
compat_getenv = ...
60+
compat_expanduser = ...
61+
def compat_setenv(key, value, env=...): # -> None:
62+
...
63+
64+
else:
65+
...
66+
if compat_os_name == 'nt' and sys.version_info < (3, 8):
67+
...
68+
else:
69+
compat_realpath = ...
70+
if sys.version_info < (3, 0):
71+
...
72+
else:
73+
def compat_print(s): # -> None:
74+
...
75+
76+
if sys.version_info < (3, 0) and sys.platform == 'win32':
77+
...
78+
else:
79+
compat_getpass = ...
80+
if sys.version_info < (2, 7):
81+
...
82+
else:
83+
compat_socket_create_connection = ...
84+
def workaround_optparse_bug9161(): # -> None:
85+
...
86+
87+
if hasattr(shutil, 'get_terminal_size'):
88+
compat_get_terminal_size = ...
89+
else:
90+
_terminal_size = ...
91+
def compat_get_terminal_size(fallback=...): # -> terminal_size:
92+
...
93+
94+
if sys.version_info >= (3, 0):
95+
...
96+
else:
97+
...
98+
if sys.version_info < (3, 3):
99+
...
100+
else:
101+
compat_b64decode = ...
102+
if platform.python_implementation() == 'PyPy' and sys.pypy_version_info < (5, 4, 0):
103+
def compat_ctypes_WINFUNCTYPE(*args, **kwargs): # -> (tpl: Unknown, *args: Unknown, **kwargs: Unknown) -> Unknown:
104+
...
105+
106+
else:
107+
def compat_ctypes_WINFUNCTYPE(*args, **kwargs):
108+
...
109+
110+
__all__ = ['compat_HTMLParseError', 'compat_HTMLParser', 'compat_HTTPError', 'compat_Struct', 'compat_b64decode', 'compat_basestring', 'compat_chr', 'compat_cookiejar', 'compat_cookiejar_Cookie', 'compat_cookies', 'compat_cookies_SimpleCookie', 'compat_ctypes_WINFUNCTYPE', 'compat_etree_Element', 'compat_etree_fromstring', 'compat_etree_register_namespace', 'compat_expanduser', 'compat_get_terminal_size', 'compat_getenv', 'compat_getpass', 'compat_html_entities', 'compat_html_entities_html5', 'compat_http_client', 'compat_http_server', 'compat_input', 'compat_integer_types', 'compat_itertools_count', 'compat_kwargs', 'compat_numeric_types', 'compat_ord', 'compat_os_name', 'compat_parse_qs', 'compat_print', 'compat_realpath', 'compat_setenv', 'compat_shlex_quote', 'compat_shlex_split', 'compat_socket_create_connection', 'compat_str', 'compat_struct_pack', 'compat_struct_unpack', 'compat_subprocess_get_DEVNULL', 'compat_tokenize_tokenize', 'compat_urllib_error', 'compat_urllib_parse', 'compat_urllib_parse_unquote', 'compat_urllib_parse_unquote_plus', 'compat_urllib_parse_unquote_to_bytes', 'compat_urllib_parse_urlencode', 'compat_urllib_parse_urlparse', 'compat_urllib_request', 'compat_urllib_request_DataHandler', 'compat_urllib_response', 'compat_urlparse', 'compat_urlretrieve', 'compat_xml_parse_error', 'compat_xpath', 'compat_zip', 'workaround_optparse_bug9161']
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
This type stub file was generated by pyright.
3+
"""
4+
5+
from __future__ import unicode_literals
6+
from .common import FileDownloader
7+
from .f4m import F4mFD
8+
from .hls import HlsFD
9+
from .http import HttpFD
10+
from .rtmp import RtmpFD
11+
from .dash import DashSegmentsFD
12+
from .rtsp import RtspFD
13+
from .ism import IsmFD
14+
from .external import FFmpegFD, get_external_downloader
15+
from ..utils import determine_protocol
16+
17+
PROTOCOL_MAP = ...
18+
def get_suitable_downloader(info_dict, params=...): # -> Any | Type[FFmpegFD] | Type[HlsFD] | Type[RtmpFD] | Type[RtspFD] | Type[F4mFD] | Type[DashSegmentsFD] | Type[IsmFD] | Type[HttpFD]:
19+
"""Get the downloader class that can handle the info dict."""
20+
...
21+
22+
__all__ = ['get_suitable_downloader', 'FileDownloader']

0 commit comments

Comments
 (0)