forked from JoeanAmier/TikTokDownloader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencipher_example.py
More file actions
55 lines (44 loc) · 1.15 KB
/
Copy pathencipher_example.py
File metadata and controls
55 lines (44 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from abc import ABC, abstractmethod
# import curl_cffi # 可用于发送 HTTP 请求, Can be used to send HTTP requests
# https://github.com/lexiforest/curl_cffi
# import javascript # 可用于执行 JavaScript 代码, Can be used to execute JavaScript code
# Requires Node.js 18 or newer.
# https://github.com/extremeheat/JSPyBridge
__all__ = [
"DouYinParams",
"TikTokParams",
]
class Params(ABC):
def __init__(self): ...
@abstractmethod
def sign(
self,
url: str = "",
query: dict | str = "",
data: dict | str | None = None,
method: str = "",
user_agent: str = "",
ms_token: str = "",
) -> dict[str, str]:
raise NotImplementedError
@abstractmethod
def sign_url(
self,
url: str = "",
query: dict | str = "",
data: dict | str | None = None,
method: str = "",
user_agent: str = "",
ms_token: str = "",
) -> str:
raise NotImplementedError
class DouYinParams(Params):
"""
抖音接口加密参数
"""
...
class TikTokParams(Params):
"""
TikTok 接口加密参数
"""
...