podflow 20250328__tar.gz → 20250330.1__tar.gz
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-20250328 → podflow-20250330.1}/PKG-INFO +1 -1
- {podflow-20250328 → podflow-20250330.1}/podflow/__init__.py +6 -0
- podflow-20250330.1/podflow/basic/time_print.py +27 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/write_log.py +3 -0
- podflow-20250330.1/podflow/httpfs/ansi_to_html.py +52 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/httpfs/app_bottle.py +12 -3
- {podflow-20250328 → podflow-20250330.1}/podflow/main_podcast.py +4 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/makeup/make_up_file_format_mod.py +2 -2
- {podflow-20250328 → podflow-20250330.1}/podflow/message/get_youtube_and_bilibili_video_format.py +3 -3
- podflow-20250330.1/podflow/templates/index.html +478 -0
- {podflow-20250328 → podflow-20250330.1}/podflow.egg-info/PKG-INFO +1 -1
- {podflow-20250328 → podflow-20250330.1}/podflow.egg-info/SOURCES.txt +1 -0
- {podflow-20250328 → podflow-20250330.1}/setup.py +1 -1
- podflow-20250328/podflow/basic/time_print.py +0 -15
- podflow-20250328/podflow/templates/index.html +0 -193
- {podflow-20250328 → podflow-20250330.1}/MANIFEST.in +0 -0
- {podflow-20250328 → podflow-20250330.1}/README.md +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/__init__.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/file_save.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/folder_build.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/get_duration.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/get_file_list.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/get_html_dict.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/http_client.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/list_merge_tidy.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/qr_code.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/split_dict.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/time_format.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/time_stamp.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/basic/vary_replace.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/bilibili/__init__.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/bilibili/build.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/bilibili/get.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/bilibili/login.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/config/__init__.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/config/build_original.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/config/channge_icon.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/config/correct_channelid.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/config/correct_config.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/config/get_channelid.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/config/get_channelid_id.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/config/get_config.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/download/__init__.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/download/convert_bytes.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/download/delete_part.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/download/dl_aideo_video.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/download/show_progress.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/download/wait_animation.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/download/youtube_and_bilibili_download.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/download_and_build.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/ffmpeg_judge.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/httpfs/__init__.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/httpfs/browser.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/httpfs/get_channelid.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/httpfs/port_judge.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/main.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/main_upload.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/makeup/__init__.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/makeup/del_makeup_format_fail.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/makeup/make_up_file.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/makeup/make_up_file_mod.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/__init__.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/backup_zip_save.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/create_main_rss.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/display_qrcode_and_url.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/fail_message_initialize.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/format_time.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/get_media_name.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/get_original_rss.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/get_video_format.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/get_video_format_multithread.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/media_format.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/original_rss_fail_print.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/rss_create_hash.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/save_rss.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/title_correction.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/update_information_display.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/update_youtube_bilibili_rss.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/want_retry.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/xml_item.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/xml_original_item.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/message/xml_rss.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/netscape/__init__.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/netscape/bulid_netscape.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/netscape/get_cookie_dict.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/parse_arguments.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/remove/__init__.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/remove/remove_dir.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/remove/remove_file.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/repair/__init__.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/repair/reverse_log.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/upload/__init__.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/upload/add_upload.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/upload/build_hash.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/upload/get_upload_original.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/upload/linked_client.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/upload/linked_server.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/upload/login.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/upload/time_key.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/upload/update_upload.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/upload/upload_server.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/youtube/__init__.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/youtube/build.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/youtube/get.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow/youtube/login.py +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow.egg-info/dependency_links.txt +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow.egg-info/entry_points.txt +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow.egg-info/requires.txt +0 -0
- {podflow-20250328 → podflow-20250330.1}/podflow.egg-info/top_level.txt +0 -0
- {podflow-20250328 → podflow-20250330.1}/setup.cfg +0 -0
@@ -119,6 +119,12 @@ class Application_gVar:
|
|
119
119
|
self.upload_data = {} # 上传用户账号密码字典
|
120
120
|
|
121
121
|
self.shortcuts_url = {} # 输出至shortcut的url字典
|
122
|
+
|
123
|
+
self.index_message = { # 图形界面显示信息字典
|
124
|
+
"podflow": [], # 主窗口信息列表
|
125
|
+
"http": [], # httpfs窗口信息列表
|
126
|
+
"enter": True, # 是否换行
|
127
|
+
}
|
122
128
|
|
123
129
|
|
124
130
|
# 参数变量
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# podflow/basic/time_print.py
|
2
|
+
# coding: utf-8
|
3
|
+
|
4
|
+
from datetime import datetime
|
5
|
+
from podflow import gVar
|
6
|
+
from podflow.httpfs.ansi_to_html import ansi_to_html
|
7
|
+
|
8
|
+
|
9
|
+
def time_print(text, Top=False, NoEnter=False, Time=True):
|
10
|
+
if Time:
|
11
|
+
text = f"{datetime.now().strftime('%H:%M:%S')}|{text}"
|
12
|
+
if Top:
|
13
|
+
text = f"\r{text}"
|
14
|
+
if NoEnter:
|
15
|
+
print(text, end="")
|
16
|
+
else:
|
17
|
+
print(text)
|
18
|
+
text = ansi_to_html(text)
|
19
|
+
if not gVar.index_message["enter"] and gVar.index_message["podflow"]:
|
20
|
+
if Top:
|
21
|
+
gVar.index_message["podflow"][0] = text
|
22
|
+
else:
|
23
|
+
gVar.index_message["podflow"][0] += (text)
|
24
|
+
else:
|
25
|
+
gVar.index_message["podflow"].append(text)
|
26
|
+
if NoEnter:
|
27
|
+
gVar.index_message["enter"] = False
|
@@ -3,6 +3,8 @@
|
|
3
3
|
|
4
4
|
import re
|
5
5
|
from datetime import datetime
|
6
|
+
from podflow import gVar
|
7
|
+
from podflow.httpfs.ansi_to_html import ansi_to_html
|
6
8
|
|
7
9
|
|
8
10
|
# 日志模块
|
@@ -34,4 +36,5 @@ def write_log(
|
|
34
36
|
formatted_time_mini = current_time.strftime("%H:%M:%S")
|
35
37
|
log_print = f"{formatted_time_mini}|{log}" if time_display else f"{log}"
|
36
38
|
log_print = f"{log_print}|{suffix}" if suffix else f"{log_print}"
|
39
|
+
gVar.index_message["podflow"].append(ansi_to_html(log_print))
|
37
40
|
print(log_print)
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# podflow/httpfs/ansi_to_htmlpy
|
2
|
+
# coding: utf-8
|
3
|
+
|
4
|
+
import re
|
5
|
+
import html
|
6
|
+
|
7
|
+
|
8
|
+
def ansi_to_html(ansi_text):
|
9
|
+
html_output = ""
|
10
|
+
ansi_codes = {
|
11
|
+
"\033[30m": "color: black;", # 黑色
|
12
|
+
"\033[31m": "color: red;", # 红色
|
13
|
+
"\033[32m": "color: green;", # 绿色
|
14
|
+
"\033[33m": "color: yellow;", # 黄色
|
15
|
+
"\033[34m": "color: blue;", # 蓝色
|
16
|
+
"\033[35m": "color: magenta;", # 品红
|
17
|
+
"\033[36m": "color: cyan;", # 青色
|
18
|
+
"\033[37m": "color: white;", # 白色
|
19
|
+
"\033[90m": "color: gray;", # 亮黑色 (通常显示为灰色)
|
20
|
+
"\033[91m": "color: #ff69b4;", # 亮红色 (例如:热粉色)
|
21
|
+
"\033[92m": "color: #90ee90;", # 亮绿色 (例如:浅绿色)
|
22
|
+
"\033[93m": "color: #ffff00;", # 亮黄色 (通常与黄色相同)
|
23
|
+
"\033[94m": "color: #add8e6;", # 亮蓝色 (例如:浅蓝色)
|
24
|
+
"\033[95m": "color: #ff00ff;", # 亮品红 (通常与品红相同)
|
25
|
+
"\033[96m": "color: #00ffff;", # 亮青色 (通常与青色相同)
|
26
|
+
"\033[97m": "color: #f0f8ff;", # 亮白色 (例如:爱丽丝蓝)
|
27
|
+
"\033[0m": "", # 重置
|
28
|
+
}
|
29
|
+
inside_span = False
|
30
|
+
|
31
|
+
parts = re.split(r"(\033\[\d+m)", ansi_text)
|
32
|
+
|
33
|
+
for part in parts:
|
34
|
+
if part in ansi_codes:
|
35
|
+
style = ansi_codes[part]
|
36
|
+
if style:
|
37
|
+
if inside_span:
|
38
|
+
html_output += "</span>"
|
39
|
+
html_output += f'<span style="{style}">'
|
40
|
+
inside_span = True
|
41
|
+
elif inside_span: # Reset code
|
42
|
+
html_output += "</span>"
|
43
|
+
inside_span = False
|
44
|
+
else:
|
45
|
+
escaped_part = html.escape(part)
|
46
|
+
html_output += escaped_part
|
47
|
+
|
48
|
+
if inside_span:
|
49
|
+
html_output += "</span>"
|
50
|
+
|
51
|
+
#html_output = html_output.replace("\n", "</p><p>")
|
52
|
+
return html_output
|
@@ -13,6 +13,7 @@ from podflow.basic.file_save import file_save
|
|
13
13
|
from podflow.basic.write_log import write_log
|
14
14
|
from podflow.upload.build_hash import build_hash
|
15
15
|
from podflow.upload.time_key import check_time_key
|
16
|
+
from podflow.httpfs.ansi_to_html import ansi_to_html
|
16
17
|
from podflow.httpfs.get_channelid import get_channelid
|
17
18
|
|
18
19
|
|
@@ -40,6 +41,7 @@ class bottle_app:
|
|
40
41
|
self.app_bottle.route("/index", callback=self.index)
|
41
42
|
self.app_bottle.route("/getid", method="POST", callback=self.getid)
|
42
43
|
self.app_bottle.route("/<filename:path>", callback=self.serve_static)
|
44
|
+
self.app_bottle.route("/message", callback=self.message)
|
43
45
|
|
44
46
|
# 设置日志文件名及写入判断
|
45
47
|
def set_logname(self, logname="httpfs.log", http_fs=False):
|
@@ -92,7 +94,9 @@ class bottle_app:
|
|
92
94
|
)
|
93
95
|
for suffix in suffixs:
|
94
96
|
filename = filename.replace(suffix, "")
|
95
|
-
|
97
|
+
bottle_text = f"{now_time}|{client_ip} {filename} {status}"
|
98
|
+
self.bottle_print.append(bottle_text)
|
99
|
+
gVar.index_message["http"].append(ansi_to_html(bottle_text))
|
96
100
|
|
97
101
|
# CherryPy 服务器打印模块
|
98
102
|
def cherry_print(self, flag_judgment=True):
|
@@ -376,16 +380,16 @@ class bottle_app:
|
|
376
380
|
},
|
377
381
|
}
|
378
382
|
|
383
|
+
# 使用pkg_resources获取模板文件路径
|
379
384
|
def index(self):
|
380
|
-
# 使用pkg_resources获取模板文件路径
|
381
385
|
template_path = pkg_resources.resource_filename('podflow', 'templates/index.html')
|
382
386
|
with open(template_path, 'r', encoding="UTF-8") as f:
|
383
387
|
html_content = f.read()
|
384
388
|
self.print_out("index", 200)
|
385
389
|
return html_content
|
386
390
|
|
391
|
+
# 获取 JSON 数据,Bottle 会自动解析请求体中的 JSON 数据
|
387
392
|
def getid(self):
|
388
|
-
# 获取 JSON 数据,Bottle 会自动解析请求体中的 JSON 数据
|
389
393
|
if getid_data := request.json:
|
390
394
|
content = getid_data.get("content", "")
|
391
395
|
else:
|
@@ -396,5 +400,10 @@ class bottle_app:
|
|
396
400
|
response.content_type = 'application/json'
|
397
401
|
return {"response": response_message}
|
398
402
|
|
403
|
+
# 处理消息的接收和发送。
|
404
|
+
def message(self):
|
405
|
+
response.content_type = 'application/json'
|
406
|
+
return gVar.index_message # 获取消息列表
|
407
|
+
|
399
408
|
|
400
409
|
bottle_app_instance = bottle_app()
|
@@ -120,8 +120,12 @@ def main_podcast():
|
|
120
120
|
gVar.xmls_original, gVar.hash_rss_original, gVar.xmls_original_fail = (
|
121
121
|
get_original_rss()
|
122
122
|
)
|
123
|
+
# 暂停进程打印
|
124
|
+
gVar.server_process_print_flag[0] = "pause"
|
123
125
|
# 连接上传服务器
|
124
126
|
upload_url = connect_upload_server()
|
127
|
+
# 恢复进程打印
|
128
|
+
bottle_app_instance.cherry_print()
|
125
129
|
# 登陆上传服务器
|
126
130
|
if upload_url:
|
127
131
|
upload_json = login_upload(upload_url)
|
@@ -31,9 +31,9 @@ def makeup_format(video_id, makeup_format_lock):
|
|
31
31
|
"channel_data/yt_dlp_youtube.txt",
|
32
32
|
)
|
33
33
|
if fail_info in makeup_id_format:
|
34
|
-
makeup_id_format = f"\
|
34
|
+
makeup_id_format = f"\033[31m{fail_info}\033[0m(Cookies错误)"
|
35
35
|
else:
|
36
|
-
makeup_id_format = f"\
|
36
|
+
makeup_id_format = f"\033[31m{fail_info}\033[0m(需要Cookies)"
|
37
37
|
break
|
38
38
|
if isinstance(makeup_id_format, list):
|
39
39
|
if len(makeup_id_format) == 1:
|
{podflow-20250328 → podflow-20250330.1}/podflow/message/get_youtube_and_bilibili_video_format.py
RENAMED
@@ -53,15 +53,15 @@ def get_youtube_and_bilibili_video_format(
|
|
53
53
|
gVar.video_id_update_format[id_num]["cookie"],
|
54
54
|
)
|
55
55
|
if fail_info in id_update_format:
|
56
|
-
id_update_format = f"\
|
56
|
+
id_update_format = f"\033[31m{fail_info}\033[0m(Cookies错误)"
|
57
57
|
else:
|
58
|
-
id_update_format = f"\
|
58
|
+
id_update_format = f"\033[31m{fail_info}\033[0m(需要Cookies)"
|
59
59
|
break
|
60
60
|
else:
|
61
61
|
if gVar.video_id_update_format[id_num]["power"] is True and (
|
62
62
|
"试看" in id_update_format or id_update_format == "无法获取音频ID"
|
63
63
|
):
|
64
|
-
id_update_format = "\
|
64
|
+
id_update_format = "\033[31m充电专属\033[0m"
|
65
65
|
if isinstance(id_update_format, list):
|
66
66
|
if len(id_update_format) == 1:
|
67
67
|
one_format(id_update_format, id_num)
|