easyrip 4.15.3__py3-none-any.whl → 4.16.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- easyrip/easyrip_web/third_party_api.py +28 -7
- easyrip/global_val.py +1 -1
- {easyrip-4.15.3.dist-info → easyrip-4.16.0.dist-info}/METADATA +1 -1
- {easyrip-4.15.3.dist-info → easyrip-4.16.0.dist-info}/RECORD +8 -8
- {easyrip-4.15.3.dist-info → easyrip-4.16.0.dist-info}/WHEEL +0 -0
- {easyrip-4.15.3.dist-info → easyrip-4.16.0.dist-info}/entry_points.txt +0 -0
- {easyrip-4.15.3.dist-info → easyrip-4.16.0.dist-info}/licenses/LICENSE +0 -0
- {easyrip-4.15.3.dist-info → easyrip-4.16.0.dist-info}/top_level.txt +0 -0
|
@@ -6,6 +6,20 @@ import urllib.request
|
|
|
6
6
|
import xml.etree.ElementTree
|
|
7
7
|
from time import sleep
|
|
8
8
|
|
|
9
|
+
REQ_HEADER = {
|
|
10
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def open_req(req: urllib.request.Request):
|
|
15
|
+
from ..easyrip_log import log
|
|
16
|
+
|
|
17
|
+
proxies = urllib.request.getproxies()
|
|
18
|
+
log.debug("Proxies: {}", proxies, print_level=log.LogLevel._detail)
|
|
19
|
+
opener = urllib.request.build_opener(urllib.request.ProxyHandler(proxies))
|
|
20
|
+
|
|
21
|
+
return opener.open(req)
|
|
22
|
+
|
|
9
23
|
|
|
10
24
|
class zhconvert:
|
|
11
25
|
"""繁化姬 API"""
|
|
@@ -42,11 +56,12 @@ class zhconvert:
|
|
|
42
56
|
data=urllib.parse.urlencode(
|
|
43
57
|
{"text": org_text, "converter": target_lang.value}
|
|
44
58
|
).encode("utf-8"),
|
|
59
|
+
headers=REQ_HEADER,
|
|
45
60
|
)
|
|
46
61
|
|
|
47
62
|
for retry_num in range(5):
|
|
48
63
|
try:
|
|
49
|
-
with
|
|
64
|
+
with open_req(req) as response:
|
|
50
65
|
for _ in range(5): # 尝试重连
|
|
51
66
|
if response.getcode() != 200:
|
|
52
67
|
log.debug("response.getcode() != 200")
|
|
@@ -62,11 +77,11 @@ class zhconvert:
|
|
|
62
77
|
return text
|
|
63
78
|
|
|
64
79
|
raise Exception(f"HTTP error: {response.getcode()}")
|
|
65
|
-
except urllib.error.HTTPError:
|
|
80
|
+
except urllib.error.HTTPError as e:
|
|
66
81
|
sleep(0.5)
|
|
67
82
|
if retry_num == 4:
|
|
68
83
|
raise
|
|
69
|
-
log.debug("Attempt to reconnect")
|
|
84
|
+
log.debug("Attempt to reconnect: {}", e)
|
|
70
85
|
continue
|
|
71
86
|
|
|
72
87
|
raise Exception
|
|
@@ -78,10 +93,13 @@ class github:
|
|
|
78
93
|
"""失败返回 None"""
|
|
79
94
|
from ..easyrip_log import log
|
|
80
95
|
|
|
81
|
-
req = urllib.request.Request(
|
|
96
|
+
req = urllib.request.Request(
|
|
97
|
+
url=release_api_url,
|
|
98
|
+
headers=REQ_HEADER,
|
|
99
|
+
)
|
|
82
100
|
|
|
83
101
|
try:
|
|
84
|
-
with
|
|
102
|
+
with open_req(req) as response:
|
|
85
103
|
data: dict = json.loads(response.read().decode("utf-8"))
|
|
86
104
|
ver = data.get("tag_name")
|
|
87
105
|
if ver is None:
|
|
@@ -111,10 +129,13 @@ class mkvtoolnix:
|
|
|
111
129
|
|
|
112
130
|
from ..easyrip_log import log
|
|
113
131
|
|
|
114
|
-
req = urllib.request.Request(
|
|
132
|
+
req = urllib.request.Request(
|
|
133
|
+
url="https://mkvtoolnix.download/latest-release.xml",
|
|
134
|
+
headers=REQ_HEADER,
|
|
135
|
+
)
|
|
115
136
|
|
|
116
137
|
try:
|
|
117
|
-
with
|
|
138
|
+
with open_req(req) as response:
|
|
118
139
|
xml_tree = xml.etree.ElementTree.XML(response.read().decode("utf-8"))
|
|
119
140
|
if (ver := xml_tree.find("latest-source/version")) is None:
|
|
120
141
|
log.debug(
|
easyrip/global_val.py
CHANGED
|
@@ -4,7 +4,7 @@ from functools import cache
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
|
|
6
6
|
PROJECT_NAME = "Easy Rip"
|
|
7
|
-
PROJECT_VERSION = "4.
|
|
7
|
+
PROJECT_VERSION = "4.16.0"
|
|
8
8
|
PROJECT_TITLE = f"{PROJECT_NAME} v{PROJECT_VERSION}"
|
|
9
9
|
PROJECT_URL = "https://github.com/op200/EasyRip"
|
|
10
10
|
PROJECT_RELEASE_API = "https://api.github.com/repos/op200/EasyRip/releases/latest"
|
|
@@ -4,7 +4,7 @@ easyrip/easyrip_command.py,sha256=6j2EFg9PesESmPpDbxfs8mzLVTMwcEjj9xeuPfbq7B4,34
|
|
|
4
4
|
easyrip/easyrip_log.py,sha256=R-dM3CWUBFITtG7GSD1zy4X4MhZqxkoiBPjlIpI76cY,15573
|
|
5
5
|
easyrip/easyrip_main.py,sha256=EjEjs1UCVSMGxdQ-XUggiDbZ0pOxiKcC85toNdbFTV4,48766
|
|
6
6
|
easyrip/easyrip_prompt.py,sha256=OidVzSkBksC89HzDcvqGkF9CXyhPNINYDp1sgLarxf8,7087
|
|
7
|
-
easyrip/global_val.py,sha256=
|
|
7
|
+
easyrip/global_val.py,sha256=AwfM4dmCupM8c_3c1INZ5KUZySFfbpBwVJ_ZOk_P4TI,866
|
|
8
8
|
easyrip/utils.py,sha256=N1rMF1MyoC-YFBgy10_u29cFoowfhR-5Viea93O7wQ4,8750
|
|
9
9
|
easyrip/easyrip_config/config.py,sha256=KWXZMEYxdXYUGLQ-MR0A7nnOwR6QZdVrWBopfb2QZSA,9869
|
|
10
10
|
easyrip/easyrip_config/config_key.py,sha256=_jjdKOunskUoG7UUWOz3QZK-s4LF_x6hmM9MKttyS2Q,766
|
|
@@ -16,7 +16,7 @@ easyrip/easyrip_mlang/lang_zh_Hans_CN.py,sha256=OuWg_sNEzNkvlF1EPMFDZrucfQ1Y92zK
|
|
|
16
16
|
easyrip/easyrip_mlang/translator.py,sha256=jlgZYSPHvwv1Pps3akKkSgVsGcLtV2psKaXyZH4QCbA,5870
|
|
17
17
|
easyrip/easyrip_web/__init__.py,sha256=tMyEeaSGeEJjND7MF0MBv9aDiDgaO3MOnppwxA70U2c,177
|
|
18
18
|
easyrip/easyrip_web/http_server.py,sha256=iyulCAFQrJlz86Lrr-Dm3fhOnNCf79Bp6fVHhr0ephY,8350
|
|
19
|
-
easyrip/easyrip_web/third_party_api.py,sha256=
|
|
19
|
+
easyrip/easyrip_web/third_party_api.py,sha256=JJSkhqc1HGk2VFd90uH8bfOw0TxHOanMNp4jhhtk94s,5165
|
|
20
20
|
easyrip/ripper/media_info.py,sha256=KdSodS6nIp2BWEer5y4mD5xwyhP15_PgNRhz2fnHmw0,5082
|
|
21
21
|
easyrip/ripper/param.py,sha256=PfJzJz9LPCB5hAM9G4GjPxdn_EZRgAz-vxYzuHGQLp8,13084
|
|
22
22
|
easyrip/ripper/ripper.py,sha256=h2jZaysF8r8UB5jEJRA1gqS-L6N_IpsDvtBlEToRgYY,59555
|
|
@@ -24,9 +24,9 @@ easyrip/ripper/sub_and_font/__init__.py,sha256=cBT7mxL7RRFaJXFPXuZ7RT-YK6FbnanaU
|
|
|
24
24
|
easyrip/ripper/sub_and_font/ass.py,sha256=EhDkVY5JXU77euWPId7H2v85j444m8ZLm7wUid7TYd8,35307
|
|
25
25
|
easyrip/ripper/sub_and_font/font.py,sha256=X2dPcPzbwQf3fv_g_mxO-zY7puVAX9Nv-9QHn88q4oA,7745
|
|
26
26
|
easyrip/ripper/sub_and_font/subset.py,sha256=--rAA3VH1rm_jBOC3yMs3rOJpn3tPuvfXqkimbBtx3s,18653
|
|
27
|
-
easyrip-4.
|
|
28
|
-
easyrip-4.
|
|
29
|
-
easyrip-4.
|
|
30
|
-
easyrip-4.
|
|
31
|
-
easyrip-4.
|
|
32
|
-
easyrip-4.
|
|
27
|
+
easyrip-4.16.0.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
28
|
+
easyrip-4.16.0.dist-info/METADATA,sha256=IIR3XuhVQT62DjdPWwz-oe6MRx9sX8eF0OUwXHu0xgo,4061
|
|
29
|
+
easyrip-4.16.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
30
|
+
easyrip-4.16.0.dist-info/entry_points.txt,sha256=D6GBMMTzZ-apgX76KyZ6jxMmIFqGYwU9neeLLni_qKI,49
|
|
31
|
+
easyrip-4.16.0.dist-info/top_level.txt,sha256=kuEteBXm-Gf90jRQgH3-fTo-Z-Q6czSuUEqY158H4Ww,8
|
|
32
|
+
easyrip-4.16.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|