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.
Files changed (110) hide show
  1. {podflow-20250328 → podflow-20250330.1}/PKG-INFO +1 -1
  2. {podflow-20250328 → podflow-20250330.1}/podflow/__init__.py +6 -0
  3. podflow-20250330.1/podflow/basic/time_print.py +27 -0
  4. {podflow-20250328 → podflow-20250330.1}/podflow/basic/write_log.py +3 -0
  5. podflow-20250330.1/podflow/httpfs/ansi_to_html.py +52 -0
  6. {podflow-20250328 → podflow-20250330.1}/podflow/httpfs/app_bottle.py +12 -3
  7. {podflow-20250328 → podflow-20250330.1}/podflow/main_podcast.py +4 -0
  8. {podflow-20250328 → podflow-20250330.1}/podflow/makeup/make_up_file_format_mod.py +2 -2
  9. {podflow-20250328 → podflow-20250330.1}/podflow/message/get_youtube_and_bilibili_video_format.py +3 -3
  10. podflow-20250330.1/podflow/templates/index.html +478 -0
  11. {podflow-20250328 → podflow-20250330.1}/podflow.egg-info/PKG-INFO +1 -1
  12. {podflow-20250328 → podflow-20250330.1}/podflow.egg-info/SOURCES.txt +1 -0
  13. {podflow-20250328 → podflow-20250330.1}/setup.py +1 -1
  14. podflow-20250328/podflow/basic/time_print.py +0 -15
  15. podflow-20250328/podflow/templates/index.html +0 -193
  16. {podflow-20250328 → podflow-20250330.1}/MANIFEST.in +0 -0
  17. {podflow-20250328 → podflow-20250330.1}/README.md +0 -0
  18. {podflow-20250328 → podflow-20250330.1}/podflow/basic/__init__.py +0 -0
  19. {podflow-20250328 → podflow-20250330.1}/podflow/basic/file_save.py +0 -0
  20. {podflow-20250328 → podflow-20250330.1}/podflow/basic/folder_build.py +0 -0
  21. {podflow-20250328 → podflow-20250330.1}/podflow/basic/get_duration.py +0 -0
  22. {podflow-20250328 → podflow-20250330.1}/podflow/basic/get_file_list.py +0 -0
  23. {podflow-20250328 → podflow-20250330.1}/podflow/basic/get_html_dict.py +0 -0
  24. {podflow-20250328 → podflow-20250330.1}/podflow/basic/http_client.py +0 -0
  25. {podflow-20250328 → podflow-20250330.1}/podflow/basic/list_merge_tidy.py +0 -0
  26. {podflow-20250328 → podflow-20250330.1}/podflow/basic/qr_code.py +0 -0
  27. {podflow-20250328 → podflow-20250330.1}/podflow/basic/split_dict.py +0 -0
  28. {podflow-20250328 → podflow-20250330.1}/podflow/basic/time_format.py +0 -0
  29. {podflow-20250328 → podflow-20250330.1}/podflow/basic/time_stamp.py +0 -0
  30. {podflow-20250328 → podflow-20250330.1}/podflow/basic/vary_replace.py +0 -0
  31. {podflow-20250328 → podflow-20250330.1}/podflow/bilibili/__init__.py +0 -0
  32. {podflow-20250328 → podflow-20250330.1}/podflow/bilibili/build.py +0 -0
  33. {podflow-20250328 → podflow-20250330.1}/podflow/bilibili/get.py +0 -0
  34. {podflow-20250328 → podflow-20250330.1}/podflow/bilibili/login.py +0 -0
  35. {podflow-20250328 → podflow-20250330.1}/podflow/config/__init__.py +0 -0
  36. {podflow-20250328 → podflow-20250330.1}/podflow/config/build_original.py +0 -0
  37. {podflow-20250328 → podflow-20250330.1}/podflow/config/channge_icon.py +0 -0
  38. {podflow-20250328 → podflow-20250330.1}/podflow/config/correct_channelid.py +0 -0
  39. {podflow-20250328 → podflow-20250330.1}/podflow/config/correct_config.py +0 -0
  40. {podflow-20250328 → podflow-20250330.1}/podflow/config/get_channelid.py +0 -0
  41. {podflow-20250328 → podflow-20250330.1}/podflow/config/get_channelid_id.py +0 -0
  42. {podflow-20250328 → podflow-20250330.1}/podflow/config/get_config.py +0 -0
  43. {podflow-20250328 → podflow-20250330.1}/podflow/download/__init__.py +0 -0
  44. {podflow-20250328 → podflow-20250330.1}/podflow/download/convert_bytes.py +0 -0
  45. {podflow-20250328 → podflow-20250330.1}/podflow/download/delete_part.py +0 -0
  46. {podflow-20250328 → podflow-20250330.1}/podflow/download/dl_aideo_video.py +0 -0
  47. {podflow-20250328 → podflow-20250330.1}/podflow/download/show_progress.py +0 -0
  48. {podflow-20250328 → podflow-20250330.1}/podflow/download/wait_animation.py +0 -0
  49. {podflow-20250328 → podflow-20250330.1}/podflow/download/youtube_and_bilibili_download.py +0 -0
  50. {podflow-20250328 → podflow-20250330.1}/podflow/download_and_build.py +0 -0
  51. {podflow-20250328 → podflow-20250330.1}/podflow/ffmpeg_judge.py +0 -0
  52. {podflow-20250328 → podflow-20250330.1}/podflow/httpfs/__init__.py +0 -0
  53. {podflow-20250328 → podflow-20250330.1}/podflow/httpfs/browser.py +0 -0
  54. {podflow-20250328 → podflow-20250330.1}/podflow/httpfs/get_channelid.py +0 -0
  55. {podflow-20250328 → podflow-20250330.1}/podflow/httpfs/port_judge.py +0 -0
  56. {podflow-20250328 → podflow-20250330.1}/podflow/main.py +0 -0
  57. {podflow-20250328 → podflow-20250330.1}/podflow/main_upload.py +0 -0
  58. {podflow-20250328 → podflow-20250330.1}/podflow/makeup/__init__.py +0 -0
  59. {podflow-20250328 → podflow-20250330.1}/podflow/makeup/del_makeup_format_fail.py +0 -0
  60. {podflow-20250328 → podflow-20250330.1}/podflow/makeup/make_up_file.py +0 -0
  61. {podflow-20250328 → podflow-20250330.1}/podflow/makeup/make_up_file_mod.py +0 -0
  62. {podflow-20250328 → podflow-20250330.1}/podflow/message/__init__.py +0 -0
  63. {podflow-20250328 → podflow-20250330.1}/podflow/message/backup_zip_save.py +0 -0
  64. {podflow-20250328 → podflow-20250330.1}/podflow/message/create_main_rss.py +0 -0
  65. {podflow-20250328 → podflow-20250330.1}/podflow/message/display_qrcode_and_url.py +0 -0
  66. {podflow-20250328 → podflow-20250330.1}/podflow/message/fail_message_initialize.py +0 -0
  67. {podflow-20250328 → podflow-20250330.1}/podflow/message/format_time.py +0 -0
  68. {podflow-20250328 → podflow-20250330.1}/podflow/message/get_media_name.py +0 -0
  69. {podflow-20250328 → podflow-20250330.1}/podflow/message/get_original_rss.py +0 -0
  70. {podflow-20250328 → podflow-20250330.1}/podflow/message/get_video_format.py +0 -0
  71. {podflow-20250328 → podflow-20250330.1}/podflow/message/get_video_format_multithread.py +0 -0
  72. {podflow-20250328 → podflow-20250330.1}/podflow/message/media_format.py +0 -0
  73. {podflow-20250328 → podflow-20250330.1}/podflow/message/original_rss_fail_print.py +0 -0
  74. {podflow-20250328 → podflow-20250330.1}/podflow/message/rss_create_hash.py +0 -0
  75. {podflow-20250328 → podflow-20250330.1}/podflow/message/save_rss.py +0 -0
  76. {podflow-20250328 → podflow-20250330.1}/podflow/message/title_correction.py +0 -0
  77. {podflow-20250328 → podflow-20250330.1}/podflow/message/update_information_display.py +0 -0
  78. {podflow-20250328 → podflow-20250330.1}/podflow/message/update_youtube_bilibili_rss.py +0 -0
  79. {podflow-20250328 → podflow-20250330.1}/podflow/message/want_retry.py +0 -0
  80. {podflow-20250328 → podflow-20250330.1}/podflow/message/xml_item.py +0 -0
  81. {podflow-20250328 → podflow-20250330.1}/podflow/message/xml_original_item.py +0 -0
  82. {podflow-20250328 → podflow-20250330.1}/podflow/message/xml_rss.py +0 -0
  83. {podflow-20250328 → podflow-20250330.1}/podflow/netscape/__init__.py +0 -0
  84. {podflow-20250328 → podflow-20250330.1}/podflow/netscape/bulid_netscape.py +0 -0
  85. {podflow-20250328 → podflow-20250330.1}/podflow/netscape/get_cookie_dict.py +0 -0
  86. {podflow-20250328 → podflow-20250330.1}/podflow/parse_arguments.py +0 -0
  87. {podflow-20250328 → podflow-20250330.1}/podflow/remove/__init__.py +0 -0
  88. {podflow-20250328 → podflow-20250330.1}/podflow/remove/remove_dir.py +0 -0
  89. {podflow-20250328 → podflow-20250330.1}/podflow/remove/remove_file.py +0 -0
  90. {podflow-20250328 → podflow-20250330.1}/podflow/repair/__init__.py +0 -0
  91. {podflow-20250328 → podflow-20250330.1}/podflow/repair/reverse_log.py +0 -0
  92. {podflow-20250328 → podflow-20250330.1}/podflow/upload/__init__.py +0 -0
  93. {podflow-20250328 → podflow-20250330.1}/podflow/upload/add_upload.py +0 -0
  94. {podflow-20250328 → podflow-20250330.1}/podflow/upload/build_hash.py +0 -0
  95. {podflow-20250328 → podflow-20250330.1}/podflow/upload/get_upload_original.py +0 -0
  96. {podflow-20250328 → podflow-20250330.1}/podflow/upload/linked_client.py +0 -0
  97. {podflow-20250328 → podflow-20250330.1}/podflow/upload/linked_server.py +0 -0
  98. {podflow-20250328 → podflow-20250330.1}/podflow/upload/login.py +0 -0
  99. {podflow-20250328 → podflow-20250330.1}/podflow/upload/time_key.py +0 -0
  100. {podflow-20250328 → podflow-20250330.1}/podflow/upload/update_upload.py +0 -0
  101. {podflow-20250328 → podflow-20250330.1}/podflow/upload/upload_server.py +0 -0
  102. {podflow-20250328 → podflow-20250330.1}/podflow/youtube/__init__.py +0 -0
  103. {podflow-20250328 → podflow-20250330.1}/podflow/youtube/build.py +0 -0
  104. {podflow-20250328 → podflow-20250330.1}/podflow/youtube/get.py +0 -0
  105. {podflow-20250328 → podflow-20250330.1}/podflow/youtube/login.py +0 -0
  106. {podflow-20250328 → podflow-20250330.1}/podflow.egg-info/dependency_links.txt +0 -0
  107. {podflow-20250328 → podflow-20250330.1}/podflow.egg-info/entry_points.txt +0 -0
  108. {podflow-20250328 → podflow-20250330.1}/podflow.egg-info/requires.txt +0 -0
  109. {podflow-20250328 → podflow-20250330.1}/podflow.egg-info/top_level.txt +0 -0
  110. {podflow-20250328 → podflow-20250330.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: podflow
3
- Version: 20250328
3
+ Version: 20250330.1
4
4
  Summary: A podcast server that includes YouTube and BiliBili
5
5
  Home-page: https://github.com/gruel-zxz/podflow
6
6
  Author: gruel_zxz
@@ -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
- self.bottle_print.append(f"{now_time}|{client_ip} {filename} {status}")
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"\x1b[31m{fail_info}\x1b[0m(Cookies错误)"
34
+ makeup_id_format = f"\033[31m{fail_info}\033[0m(Cookies错误)"
35
35
  else:
36
- makeup_id_format = f"\x1b[31m{fail_info}\x1b[0m(需要Cookies)"
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:
@@ -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"\x1b[31m{fail_info}\x1b[0m(Cookies错误)"
56
+ id_update_format = f"\033[31m{fail_info}\033[0m(Cookies错误)"
57
57
  else:
58
- id_update_format = f"\x1b[31m{fail_info}\x1b[0m(需要Cookies)"
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 = "\x1b[31m充电专属\x1b[0m"
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)