podflow 20250326.2__py3-none-any.whl → 20250327__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.
- podflow/httpfs/app_bottle.py +17 -21
- podflow/templates/index.html +170 -0
- {podflow-20250326.2.dist-info → podflow-20250327.dist-info}/METADATA +1 -1
- {podflow-20250326.2.dist-info → podflow-20250327.dist-info}/RECORD +7 -7
- podflow/httpfs/html.py +0 -145
- {podflow-20250326.2.dist-info → podflow-20250327.dist-info}/WHEEL +0 -0
- {podflow-20250326.2.dist-info → podflow-20250327.dist-info}/entry_points.txt +0 -0
- {podflow-20250326.2.dist-info → podflow-20250327.dist-info}/top_level.txt +0 -0
podflow/httpfs/app_bottle.py
CHANGED
@@ -6,10 +6,9 @@ import hashlib
|
|
6
6
|
import pkg_resources
|
7
7
|
from datetime import datetime
|
8
8
|
import cherrypy
|
9
|
-
from bottle import Bottle, abort, redirect, request, static_file, response
|
9
|
+
from bottle import Bottle, abort, redirect, request, static_file, response
|
10
10
|
from podflow import gVar
|
11
11
|
from podflow.upload.login import create
|
12
|
-
from podflow.httpfs.html import html_index
|
13
12
|
from podflow.basic.file_save import file_save
|
14
13
|
from podflow.basic.write_log import write_log
|
15
14
|
from podflow.upload.build_hash import build_hash
|
@@ -38,9 +37,8 @@ class bottle_app:
|
|
38
37
|
self.app_bottle.route("/login", callback=self.login)
|
39
38
|
self.app_bottle.route("/upload", method="POST", callback=self.upload)
|
40
39
|
else:
|
41
|
-
|
42
|
-
self.app_bottle.route("/
|
43
|
-
self.app_bottle.route("/index", method=["GET", "POST"], callback=self.index)
|
40
|
+
self.app_bottle.route("/index", callback=self.index)
|
41
|
+
self.app_bottle.route("/getid", method="POST", callback=self.getid)
|
44
42
|
self.app_bottle.route("/<filename:path>", callback=self.serve_static)
|
45
43
|
|
46
44
|
# 设置日志文件名及写入判断
|
@@ -250,19 +248,6 @@ class bottle_app:
|
|
250
248
|
"message": "Unauthorized: Invalid Token",
|
251
249
|
}
|
252
250
|
|
253
|
-
# 获取Channel-ID请求
|
254
|
-
def index(self):
|
255
|
-
if request.method == "POST":
|
256
|
-
user_input = request.forms.get("inputOutput") # 获取用户输入
|
257
|
-
processed_input = get_channelid(user_input)
|
258
|
-
self.print_out("channelid", 200)
|
259
|
-
return template(
|
260
|
-
html_index, processed_input=processed_input
|
261
|
-
) # 直接回显到输入框
|
262
|
-
else:
|
263
|
-
self.print_out("index", 200)
|
264
|
-
return template(html_index, processed_input="") # 默认输入框为空
|
265
|
-
|
266
251
|
# 路由处理登陆请求
|
267
252
|
def login(self):
|
268
253
|
# 获取上传的数据
|
@@ -391,12 +376,23 @@ class bottle_app:
|
|
391
376
|
},
|
392
377
|
}
|
393
378
|
|
394
|
-
def
|
379
|
+
def index(self):
|
395
380
|
# 使用pkg_resources获取模板文件路径
|
396
|
-
template_path = pkg_resources.resource_filename('
|
397
|
-
with open(template_path, 'r') as f:
|
381
|
+
template_path = pkg_resources.resource_filename('podflow', 'templates/index.html')
|
382
|
+
with open(template_path, 'r', encoding="UTF-8") as f:
|
398
383
|
html_content = f.read()
|
399
384
|
return html_content
|
400
385
|
|
386
|
+
def getid(self):
|
387
|
+
# 获取 JSON 数据,Bottle 会自动解析请求体中的 JSON 数据
|
388
|
+
getid_data = request.json
|
389
|
+
# 提取内容(若不存在则默认为空字符串)
|
390
|
+
content = getid_data.get("content", "") if getid_data else ""
|
391
|
+
response_message = get_channelid(content)
|
392
|
+
self.print_out("channelid", 200)
|
393
|
+
# 设置响应头为 application/json
|
394
|
+
response.content_type = 'application/json'
|
395
|
+
return {"response": response_message}
|
396
|
+
|
401
397
|
|
402
398
|
bottle_app_instance = bottle_app()
|
@@ -0,0 +1,170 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="zh">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>输入输出示例</title>
|
7
|
+
<style>
|
8
|
+
/* 基本样式 */
|
9
|
+
body {
|
10
|
+
font-family: Arial, sans-serif;
|
11
|
+
text-align: center;
|
12
|
+
padding: 20px;
|
13
|
+
background-color: #f8f9fa;
|
14
|
+
}
|
15
|
+
|
16
|
+
h2 {
|
17
|
+
color: #333;
|
18
|
+
}
|
19
|
+
|
20
|
+
/* 响应式输入框 */
|
21
|
+
textarea {
|
22
|
+
width: 90%;
|
23
|
+
max-width: 600px;
|
24
|
+
height: 250px; /* 增加默认高度 */
|
25
|
+
font-size: 16px;
|
26
|
+
padding: 10px;
|
27
|
+
border: 1px solid #ccc;
|
28
|
+
border-radius: 8px;
|
29
|
+
resize: vertical; /* 允许手动调整高度 */
|
30
|
+
overflow-y: auto;
|
31
|
+
}
|
32
|
+
|
33
|
+
/* 按钮样式 */
|
34
|
+
.button-container {
|
35
|
+
margin-top: 10px;
|
36
|
+
}
|
37
|
+
|
38
|
+
button {
|
39
|
+
background-color: #007bff;
|
40
|
+
color: white;
|
41
|
+
border: none;
|
42
|
+
padding: 12px 18px;
|
43
|
+
font-size: 16px;
|
44
|
+
border-radius: 6px;
|
45
|
+
cursor: pointer;
|
46
|
+
transition: 0.3s;
|
47
|
+
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
|
48
|
+
margin: 5px;
|
49
|
+
}
|
50
|
+
|
51
|
+
button:hover {
|
52
|
+
background-color: #0056b3;
|
53
|
+
}
|
54
|
+
|
55
|
+
/* 手机端优化 */
|
56
|
+
@media (max-width: 600px) {
|
57
|
+
textarea {
|
58
|
+
font-size: 18px;
|
59
|
+
height: 180px;
|
60
|
+
}
|
61
|
+
|
62
|
+
button {
|
63
|
+
width: 90%;
|
64
|
+
font-size: 18px;
|
65
|
+
padding: 14px;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
/* 提示信息 */
|
70
|
+
.hint {
|
71
|
+
font-size: 14px;
|
72
|
+
color: #666;
|
73
|
+
margin-top: 10px;
|
74
|
+
}
|
75
|
+
</style>
|
76
|
+
</head>
|
77
|
+
<body>
|
78
|
+
<h2>获取 Channel-ID</h2>
|
79
|
+
<!-- 将表单的 action 指定为 channelid -->
|
80
|
+
<form id="inputForm" method="post" action="getid">
|
81
|
+
<label for="inputOutput">请输入:</label><br>
|
82
|
+
<textarea name="inputOutput" id="inputOutput"></textarea><br>
|
83
|
+
<div class="button-container">
|
84
|
+
<button type="button" onclick="pasteFromClipboard()">📋 粘贴</button>
|
85
|
+
<button type="submit">✅ 提交</button>
|
86
|
+
<button type="button" onclick="copyText()">📄 拷贝</button>
|
87
|
+
<button type="button" onclick="clearInput()">🗑️ 清空</button>
|
88
|
+
</div>
|
89
|
+
<p class="hint">📌 如果粘贴按钮无效,请长按输入框手动粘贴。</p>
|
90
|
+
</form>
|
91
|
+
<script>
|
92
|
+
// 监听表单提交事件,阻止默认提交并使用 fetch 异步发送请求
|
93
|
+
document.getElementById('inputForm').addEventListener('submit', function(event) {
|
94
|
+
event.preventDefault();
|
95
|
+
let inputOutput = document.getElementById('inputOutput');
|
96
|
+
const content = inputOutput.value;
|
97
|
+
|
98
|
+
fetch('getid', {
|
99
|
+
method: 'POST',
|
100
|
+
headers: {
|
101
|
+
'Content-Type': 'application/json'
|
102
|
+
},
|
103
|
+
body: JSON.stringify({ content: content })
|
104
|
+
})
|
105
|
+
.then(response => {
|
106
|
+
if (!response.ok) {
|
107
|
+
throw new Error('网络响应异常');
|
108
|
+
}
|
109
|
+
return response.json();
|
110
|
+
})
|
111
|
+
.then(data => {
|
112
|
+
// 假设服务端返回的 JSON 数据中包含 response 字段
|
113
|
+
inputOutput.value = data.response;
|
114
|
+
})
|
115
|
+
.catch(error => {
|
116
|
+
console.error('请求失败:', error);
|
117
|
+
alert('请求失败,请稍后重试!');
|
118
|
+
});
|
119
|
+
});
|
120
|
+
|
121
|
+
// 从剪贴板粘贴内容
|
122
|
+
function pasteFromClipboard() {
|
123
|
+
let inputOutput = document.getElementById('inputOutput');
|
124
|
+
if (navigator.clipboard && navigator.clipboard.readText) {
|
125
|
+
navigator.clipboard.readText().then(text => {
|
126
|
+
inputOutput.value = text;
|
127
|
+
inputOutput.focus();
|
128
|
+
}).catch(err => {
|
129
|
+
console.warn("剪贴板读取失败:", err);
|
130
|
+
alert("无法读取剪贴板,请手动粘贴!");
|
131
|
+
});
|
132
|
+
} else {
|
133
|
+
try {
|
134
|
+
inputOutput.focus();
|
135
|
+
document.execCommand('paste');
|
136
|
+
} catch (err) {
|
137
|
+
console.warn("execCommand 粘贴失败:", err);
|
138
|
+
alert("您的浏览器不支持自动粘贴,请手动操作!");
|
139
|
+
}
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
// 复制文本到剪贴板
|
144
|
+
function copyText() {
|
145
|
+
let inputOutput = document.getElementById('inputOutput');
|
146
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
147
|
+
navigator.clipboard.writeText(inputOutput.value).then(() => {
|
148
|
+
// 已成功复制到剪贴板
|
149
|
+
}).catch(err => {
|
150
|
+
console.warn("复制失败:", err);
|
151
|
+
alert("无法复制,请手动选择文本后按 Ctrl+C 复制!");
|
152
|
+
});
|
153
|
+
} else {
|
154
|
+
try {
|
155
|
+
inputOutput.select();
|
156
|
+
document.execCommand('copy');
|
157
|
+
} catch (err) {
|
158
|
+
console.warn("execCommand 复制失败:", err);
|
159
|
+
alert("您的浏览器不支持复制,请手动操作!");
|
160
|
+
}
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
// 清空输入框内容
|
165
|
+
function clearInput() {
|
166
|
+
document.getElementById('inputOutput').value = '';
|
167
|
+
}
|
168
|
+
</script>
|
169
|
+
</body>
|
170
|
+
</html>
|
@@ -40,10 +40,9 @@ podflow/download/show_progress.py,sha256=cWlyIh6WqoH3s4WpFSyL6xtiXhQFbrVJVcckxO-
|
|
40
40
|
podflow/download/wait_animation.py,sha256=RnByMq0Ql_yr9OqQ3dl3W-41GgP0T8PvlbwwVeMb7_k,1056
|
41
41
|
podflow/download/youtube_and_bilibili_download.py,sha256=dlUh9cPHrYgZAhtXlBUOdFIpZOhv9xOtgdcTaqUvLuY,1294
|
42
42
|
podflow/httpfs/__init__.py,sha256=BxEXkufjcx-a0F7sDVXo65hmyANqCCbZUd6EH9i8T2c,45
|
43
|
-
podflow/httpfs/app_bottle.py,sha256=
|
43
|
+
podflow/httpfs/app_bottle.py,sha256=kXeBMlsXxijwa4Fwg5F42-nZlPtiseNsRkJ3JpipHHA,16407
|
44
44
|
podflow/httpfs/browser.py,sha256=BJ4Xkfiki_tDr0Sc9RqAcEfIVpkAZ3RFOwo0aMHlY3U,197
|
45
45
|
podflow/httpfs/get_channelid.py,sha256=gcwy4IVHBWNQz7qPCpjwiAklGFLRGzvM33-UZz7oFvo,2296
|
46
|
-
podflow/httpfs/html.py,sha256=bEOunhd-6Zwoidl3gHSVF5NVR5jao69JjI2ZwlrTyxU,4897
|
47
46
|
podflow/httpfs/port_judge.py,sha256=l_nLpsSiIhAzfJGCOWyYC-KkCCWPUW2ybe_5hdMOEzE,764
|
48
47
|
podflow/makeup/__init__.py,sha256=ligUtfj0stTcOHFXDF6eAN7Up2PxlB0GnGbLq7iDY3c,45
|
49
48
|
podflow/makeup/del_makeup_format_fail.py,sha256=XizQh74QYXxRg0e1uerXjd4Tiq5qChks0fTAY7n3Z1I,642
|
@@ -80,6 +79,7 @@ podflow/remove/remove_dir.py,sha256=xQIhrnqnYjMzXjoSWaTvm7JwPYOFTN1muuTPdaLDXpQ,
|
|
80
79
|
podflow/remove/remove_file.py,sha256=8wAJQehs-XBqvu0vPlEme2_tt0FZxc5ELwGMxXA_558,982
|
81
80
|
podflow/repair/__init__.py,sha256=Gpc1i6xiSLodKjjmzH66c_Y1z0HQ9E9CS3p95FRnVFM,45
|
82
81
|
podflow/repair/reverse_log.py,sha256=Wc_vAH0WB-z1fNdWx7FYaVH4caRPtot7tDwDwFhmpz4,1106
|
82
|
+
podflow/templates/index.html,sha256=sRo0P3agJ5T0dFbmcuI_h6cseLtoXVhTTBrDYmTpWTA,4755
|
83
83
|
podflow/upload/__init__.py,sha256=AtOSXDrE5EjUe3z-iBd1NTDaH8n_X9qA5WXdBLkONjA,45
|
84
84
|
podflow/upload/add_upload.py,sha256=_2-V0z75Lwu-PUCfMD9HOSxZTB102yZlZW5hSdlHcsc,1432
|
85
85
|
podflow/upload/build_hash.py,sha256=9opa3xLd7nJbGGX5xa3uuKPS6dxlbkAb87ZdEiUxmxI,473
|
@@ -94,8 +94,8 @@ podflow/youtube/__init__.py,sha256=pgXod8gq0IijZxIkPSwgAOcb9JI5rd1mqMomoR7bcJ4,4
|
|
94
94
|
podflow/youtube/build.py,sha256=3LYk_ICVXj9XkE9jZ8jEVI8596xxS_QZkcoIwcBE3Ys,12006
|
95
95
|
podflow/youtube/get.py,sha256=Of7PRgUknhpyW70nvyVAUYVb5KyFViKiBTfH3Y6Mke8,16970
|
96
96
|
podflow/youtube/login.py,sha256=3nLj0KLdsc-kQmXxG5FyZfR-kiDzbQy2J0KhPXMxJGc,1380
|
97
|
-
podflow-
|
98
|
-
podflow-
|
99
|
-
podflow-
|
100
|
-
podflow-
|
101
|
-
podflow-
|
97
|
+
podflow-20250327.dist-info/METADATA,sha256=zNgZvmWEa8Q8Jnt_HW2wz836-PbqMUxwFP4y1T2W0HM,14163
|
98
|
+
podflow-20250327.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
99
|
+
podflow-20250327.dist-info/entry_points.txt,sha256=mn7hD_c_dmpKe3XU0KNekheBvD01LhlJ9htY-Df0j2A,131
|
100
|
+
podflow-20250327.dist-info/top_level.txt,sha256=fUujhhz-RrMI8aGvi-3Ey5y7FQnpOOgoFw9OWM3yLCU,8
|
101
|
+
podflow-20250327.dist-info/RECORD,,
|
podflow/httpfs/html.py
DELETED
@@ -1,145 +0,0 @@
|
|
1
|
-
# podflow/httpfs/html.py
|
2
|
-
# coding: utf-8
|
3
|
-
|
4
|
-
|
5
|
-
html_index = '''<!DOCTYPE html>
|
6
|
-
<html lang="zh">
|
7
|
-
<head>
|
8
|
-
<meta charset="UTF-8">
|
9
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
10
|
-
<title>输入输出示例</title>
|
11
|
-
<style>
|
12
|
-
/* 基本样式 */
|
13
|
-
body {
|
14
|
-
font-family: Arial, sans-serif;
|
15
|
-
text-align: center;
|
16
|
-
padding: 20px;
|
17
|
-
background-color: #f8f9fa;
|
18
|
-
}
|
19
|
-
|
20
|
-
h2 {
|
21
|
-
color: #333;
|
22
|
-
}
|
23
|
-
|
24
|
-
/* 响应式输入框 */
|
25
|
-
textarea {
|
26
|
-
width: 90%;
|
27
|
-
max-width: 600px;
|
28
|
-
height: 250px; /* 增加默认高度 */
|
29
|
-
font-size: 16px;
|
30
|
-
padding: 10px;
|
31
|
-
border: 1px solid #ccc;
|
32
|
-
border-radius: 8px;
|
33
|
-
resize: vertical; /* 允许手动调整高度 */
|
34
|
-
overflow-y: auto; /* 始终显示垂直滚动条(如需自动出现滚动条,可用 `overflow-y: auto;`) */
|
35
|
-
}
|
36
|
-
|
37
|
-
/* 按钮样式 */
|
38
|
-
.button-container {
|
39
|
-
margin-top: 10px;
|
40
|
-
}
|
41
|
-
|
42
|
-
button {
|
43
|
-
background-color: #007bff;
|
44
|
-
color: white;
|
45
|
-
border: none;
|
46
|
-
padding: 12px 18px;
|
47
|
-
font-size: 16px;
|
48
|
-
border-radius: 6px;
|
49
|
-
cursor: pointer;
|
50
|
-
transition: 0.3s;
|
51
|
-
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
|
52
|
-
margin: 5px;
|
53
|
-
}
|
54
|
-
|
55
|
-
button:hover {
|
56
|
-
background-color: #0056b3;
|
57
|
-
}
|
58
|
-
|
59
|
-
/* 手机端优化 */
|
60
|
-
@media (max-width: 600px) {
|
61
|
-
textarea {
|
62
|
-
font-size: 18px;
|
63
|
-
height: 180px;
|
64
|
-
}
|
65
|
-
|
66
|
-
button {
|
67
|
-
width: 90%;
|
68
|
-
font-size: 18px;
|
69
|
-
padding: 14px;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
|
73
|
-
/* 提示信息 */
|
74
|
-
.hint {
|
75
|
-
font-size: 14px;
|
76
|
-
color: #666;
|
77
|
-
margin-top: 10px;
|
78
|
-
}
|
79
|
-
</style>
|
80
|
-
</head>
|
81
|
-
<body>
|
82
|
-
<h2>获取Channel-ID</h2>
|
83
|
-
<form id="inputForm" method="post">
|
84
|
-
<label for="inputOutput">请输入:</label><br>
|
85
|
-
<textarea name="inputOutput" id="inputOutput">{{ processed_input }}</textarea><br>
|
86
|
-
<div class="button-container">
|
87
|
-
<button type="button" onclick="pasteFromClipboard()">📋 粘贴</button>
|
88
|
-
<button type="submit">✅ 提交</button>
|
89
|
-
<button type="button" onclick="copyText()">📄 拷贝</button>
|
90
|
-
<button type="button" onclick="clearInput()">🗑️ 清空</button>
|
91
|
-
</div>
|
92
|
-
<p class="hint">📌 如果粘贴按钮无效,请长按输入框手动粘贴。</p>
|
93
|
-
</form>
|
94
|
-
<script>
|
95
|
-
function pasteFromClipboard() {
|
96
|
-
let inputOutput = document.getElementById('inputOutput');
|
97
|
-
|
98
|
-
if (navigator.clipboard && navigator.clipboard.readText) {
|
99
|
-
navigator.clipboard.readText().then(text => {
|
100
|
-
inputOutput.value = text;
|
101
|
-
inputOutput.focus(); // 聚焦输入框
|
102
|
-
//alert("✅ 已成功粘贴!");
|
103
|
-
}).catch(err => {
|
104
|
-
console.warn("❌ 剪贴板读取失败:", err);
|
105
|
-
alert("❌ 无法读取剪贴板,请手动粘贴!");
|
106
|
-
});
|
107
|
-
} else {
|
108
|
-
// 兼容旧版浏览器
|
109
|
-
try {
|
110
|
-
inputOutput.focus();
|
111
|
-
document.execCommand('paste'); // 仅部分浏览器支持
|
112
|
-
//alert("✅ 尝试使用旧版粘贴方法!");
|
113
|
-
} catch (err) {
|
114
|
-
console.warn("❌ execCommand 粘贴失败:", err);
|
115
|
-
alert("❌ 您的浏览器不支持自动粘贴,请手动操作!");
|
116
|
-
}
|
117
|
-
}
|
118
|
-
}
|
119
|
-
function copyText() {
|
120
|
-
let inputOutput = document.getElementById('inputOutput');
|
121
|
-
if (navigator.clipboard && navigator.clipboard.writeText) {
|
122
|
-
navigator.clipboard.writeText(inputOutput.value).then(() => {
|
123
|
-
//alert("✅ 已拷贝到剪贴板!");
|
124
|
-
}).catch(err => {
|
125
|
-
console.warn("拷贝失败:", err);
|
126
|
-
alert("❌ 无法拷贝,请手动选择文本后按 Ctrl+C 复制!");
|
127
|
-
});
|
128
|
-
} else {
|
129
|
-
// 兼容旧版浏览器
|
130
|
-
try {
|
131
|
-
inputOutput.select();
|
132
|
-
document.execCommand('copy');
|
133
|
-
//alert("✅ 已拷贝到剪贴板!");
|
134
|
-
} catch (err) {
|
135
|
-
console.warn("execCommand 复制失败:", err);
|
136
|
-
alert("❌ 您的浏览器不支持拷贝,请手动操作!");
|
137
|
-
}
|
138
|
-
}
|
139
|
-
}
|
140
|
-
function clearInput() {
|
141
|
-
document.getElementById('inputOutput').value = '';
|
142
|
-
}
|
143
|
-
</script>
|
144
|
-
</body>
|
145
|
-
</html>'''
|
File without changes
|
File without changes
|
File without changes
|