podflow 20250331.2__py3-none-any.whl → 20250401__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.
@@ -3,7 +3,7 @@
3
3
 
4
4
  from datetime import datetime
5
5
  from podflow import gVar
6
- from podflow.httpfs.ansi_to_html import ansi_to_html
6
+ from podflow.httpfs.to_html import ansi_to_html
7
7
 
8
8
 
9
9
  def time_print(text, Top=False, NoEnter=False, Time=True):
@@ -17,10 +17,10 @@ def time_print(text, Top=False, NoEnter=False, Time=True):
17
17
  print(text)
18
18
  text = ansi_to_html(text)
19
19
  if not gVar.index_message["enter"] and gVar.index_message["podflow"]:
20
- if Top:
21
- gVar.index_message["podflow"][0] = text
20
+ if Top and gVar.index_message["podflow"]:
21
+ gVar.index_message["podflow"][-1] = text
22
22
  else:
23
- gVar.index_message["podflow"][0] += (text)
23
+ gVar.index_message["podflow"][-1] += (text)
24
24
  else:
25
25
  gVar.index_message["podflow"].append(text)
26
26
  if NoEnter:
@@ -4,7 +4,7 @@
4
4
  import re
5
5
  from datetime import datetime
6
6
  from podflow import gVar
7
- from podflow.httpfs.ansi_to_html import ansi_to_html
7
+ from podflow.httpfs.to_html import ansi_to_html
8
8
 
9
9
 
10
10
  # 日志模块
@@ -13,7 +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
+ from podflow.httpfs.to_html import ansi_to_html
17
17
  from podflow.httpfs.get_channelid import get_channelid
18
18
 
19
19
 
@@ -1,8 +1,9 @@
1
- # podflow/httpfs/ansi_to_htmlpy
1
+ # podflow/httpfs/to_html.py
2
2
  # coding: utf-8
3
3
 
4
4
  import re
5
5
  import html
6
+ from podflow import gVar
6
7
 
7
8
 
8
9
  def ansi_to_html(ansi_text):
@@ -48,3 +49,8 @@ def ansi_to_html(ansi_text):
48
49
  html_output += "</span>"
49
50
 
50
51
  return html_output
52
+
53
+
54
+ def qrcode_to_html(url):
55
+ text = f'<span class="qrcode-container" data-url="{url}"></span>'
56
+ gVar.index_message["podflow"].append(text)
@@ -6,6 +6,7 @@ from podflow.basic.qr_code import qr_code
6
6
  from podflow.message.xml_rss import xml_rss
7
7
  from podflow.basic.file_save import file_save
8
8
  from podflow.basic.write_log import write_log
9
+ from podflow.httpfs.to_html import qrcode_to_html
9
10
  from podflow.message.backup_zip_save import backup_zip_save
10
11
  from podflow.message.display_qrcode_and_url import display_qrcode_and_url
11
12
 
@@ -79,6 +80,7 @@ def save_rss():
79
80
  # 如果gVar.displayed_QRcode中不包含"main",则调用qr_code函数,显示总播客的二维码,并将"main"添加到gVar.displayed_QRcode中
80
81
  if "main" not in gVar.displayed_QRcode:
81
82
  qr_code(overall_url)
83
+ qrcode_to_html(overall_url)
82
84
  gVar.displayed_QRcode.append("main")
83
85
 
84
86
  # 备份主rss
@@ -21,7 +21,7 @@
21
21
  --menu-width: 170px;
22
22
  --menu-selected-bg: #cccccc;
23
23
  }
24
-
24
+
25
25
  /* 深色模式变量 */
26
26
  @media (prefers-color-scheme: dark) {
27
27
  :root {
@@ -41,39 +41,39 @@
41
41
  }
42
42
 
43
43
  .ansi-30m { color: #000000; }
44
- .ansi-31m { color: #ff0000; }
45
- .ansi-32m { color: #00ff00; }
46
- .ansi-33m { color: #ffff00; }
47
- .ansi-34m { color: #0000ff; }
48
- .ansi-35m { color: #ff00ff; }
49
- .ansi-36m { color: #00ffff; }
50
- .ansi-37m { color: #ffffff; }
51
- .ansi-90m { color: #808080; }
52
- .ansi-91m { color: #ff8080; }
53
- .ansi-92m { color: #80ff80; }
54
- .ansi-93m { color: #ffff80; }
55
- .ansi-94m { color: #8080ff; }
56
- .ansi-95m { color: #ff80ff; }
57
- .ansi-96m { color: #80ffff; }
58
- .ansi-97m { color: #ffffff; }.
44
+ .ansi-31m { color: #bb271b; }
45
+ .ansi-32m { color: #61992e; }
46
+ .ansi-33m { color: #bea235; }
47
+ .ansi-34m { color: #4064a0; }
48
+ .ansi-35m { color: #705278; }
49
+ .ansi-36m { color: #449598; }
50
+ .ansi-37m { color: #d4d7d0; }
51
+ .ansi-90m { color: #565752; }
52
+ .ansi-91m { color: #dc3f36; }
53
+ .ansi-92m { color: #53b739; }
54
+ .ansi-93m { color: #f9ea6b; }
55
+ .ansi-94m { color: #7c9ecb; }
56
+ .ansi-95m { color: #de30c5; }
57
+ .ansi-96m { color: #51b2bb; }
58
+ .ansi-97m { color: #eeeeec; }
59
59
 
60
60
  @media (prefers-color-scheme: dark) {
61
61
  .ansi-30m { color: #ffffff; }
62
- .ansi-31m { color: #ff0000; }
63
- .ansi-32m { color: #00ff00; }
64
- .ansi-33m { color: #ffff00; }
65
- .ansi-34m { color: #0000ff; }
66
- .ansi-35m { color: #ff00ff; }
67
- .ansi-36m { color: #00ffff; }
68
- .ansi-37m { color: #000000; }
69
- .ansi-90m { color: #e0e0e0; }
70
- .ansi-91m { color: #ff8080; }
71
- .ansi-92m { color: #80ff80; }
72
- .ansi-93m { color: #ffff80; }
73
- .ansi-94m { color: #8080ff; }
74
- .ansi-95m { color: #ff80ff; }
75
- .ansi-96m { color: #80ffff; }
76
- .ansi-97m { color: #000000; }
62
+ .ansi-31m { color: #bb271b; }
63
+ .ansi-32m { color: #61992e; }
64
+ .ansi-33m { color: #bea235; }
65
+ .ansi-34m { color: #4064a0; }
66
+ .ansi-35m { color: #705278; }
67
+ .ansi-36m { color: #449598; }
68
+ .ansi-37m { color: #d4d7d0; }
69
+ .ansi-90m { color: #565752; }
70
+ .ansi-91m { color: #dc3f36; }
71
+ .ansi-92m { color: #53b739; }
72
+ .ansi-93m { color: #f9ea6b; }
73
+ .ansi-94m { color: #7c9ecb; }
74
+ .ansi-95m { color: #de30c5; }
75
+ .ansi-96m { color: #51b2bb; }
76
+ .ansi-97m { color: #eeeeec; }
77
77
  }
78
78
 
79
79
  /* 基本样式 */
@@ -130,7 +130,7 @@
130
130
  main.full {
131
131
  margin-left: 0;
132
132
  }
133
-
133
+
134
134
  /* 表单与消息区域共用样式 */
135
135
  .common-area {
136
136
  width: 100%;
@@ -147,14 +147,16 @@
147
147
  overflow-y: auto;
148
148
  }
149
149
  textarea {
150
- height: 250px;
150
+ height: 350px;
151
151
  font-size: 16px;
152
152
  }
153
153
  #messageArea {
154
- height: 250px;
154
+ height: 30px;
155
+ font-size: 12px;
155
156
  }
156
157
  #messageHttp {
157
158
  height: 150px;
159
+ font-size: 12px;
158
160
  }
159
161
  .button-container {
160
162
  margin-top: 10px;
@@ -202,7 +204,7 @@
202
204
  #toggleMenu:hover {
203
205
  color: var(--button-hover);
204
206
  }
205
-
207
+
206
208
  /* 手机端优化 */
207
209
  @media (max-width: 600px) {
208
210
  #messageArea, textarea {
@@ -217,10 +219,15 @@
217
219
  }
218
220
  .message {
219
221
  padding: 0px;
220
- margin: 0;
221
- font-size: 11px;
222
+ }
223
+
224
+ /* 二维码容器样式 */
225
+ .qrcode-container {
226
+ display: inline-block; /* 让容器并排显示 */
227
+ margin: 0px;
222
228
  }
223
229
  </style>
230
+ <script src="https://cdn.jsdelivr.net/gh/davidshimjs/qrcodejs/qrcode.min.js"></script>
224
231
  </head>
225
232
  <body>
226
233
  <!-- 菜单栏 -->
@@ -278,6 +285,7 @@
278
285
  const pasteBtn = document.getElementById('pasteBtn');
279
286
  const copyBtn = document.getElementById('copyBtn');
280
287
  const clearBtn = document.getElementById('clearBtn');
288
+ const qrcodeContainers = document.querySelectorAll('.qrcode-container'); // 获取所有二维码容器
281
289
 
282
290
  let pollingTimer = null;
283
291
 
@@ -303,6 +311,9 @@
303
311
  toggleMenu();
304
312
  }
305
313
  pageId === 'pageMessage' ? startMessagePolling() : stopMessagePolling();
314
+ if (pageId === 'pageMessage') {
315
+ generateQRCodes(); // 当切换页面时生成二维码
316
+ }
306
317
  }
307
318
  }
308
319
 
@@ -311,7 +322,7 @@
311
322
 
312
323
  let lastMessage = { podflow: [], http: [] };
313
324
  let userScrolled = false;
314
-
325
+
315
326
  // 监听滚动事件,检测用户是否手动滚动
316
327
  function onUserScroll(event) {
317
328
  const element = event.target;
@@ -319,7 +330,7 @@
319
330
  const nearBottom = element.scrollHeight - element.scrollTop <= element.clientHeight + 10;
320
331
  userScrolled = !nearBottom;
321
332
  }
322
-
333
+
323
334
  messageArea.addEventListener('scroll', onUserScroll);
324
335
  messageHttp.addEventListener('scroll', onUserScroll);
325
336
 
@@ -341,7 +352,7 @@
341
352
  function appendMessages(container, newMessages, oldMessages) {
342
353
  // 判断当前是否在底部
343
354
  const isAtBottom = container.scrollHeight - container.scrollTop <= container.clientHeight + 10;
344
-
355
+
345
356
  // 只追加新数据,避免重复渲染
346
357
  if (newMessages.length === oldMessages.length && newMessages.length > 0) {
347
358
  const lastNewMessage = newMessages[newMessages.length - 1];
@@ -370,7 +381,7 @@
370
381
  container.appendChild(p);
371
382
  });
372
383
  }
373
-
384
+
374
385
  // 如果用户没有主动滚动,才自动滚动到底部
375
386
  if (!userScrolled) {
376
387
  container.scrollTop = container.scrollHeight;
@@ -474,6 +485,38 @@
474
485
  toggleMenuBtn.style.left = '0px';
475
486
  toggleMenuBtn.textContent = '❯';
476
487
  }
488
+
489
+ // 生成二维码的函数
490
+ function generateQRCodes() {
491
+ const rootStyles = getComputedStyle(document.documentElement);
492
+ const textColor = rootStyles.getPropertyValue('--text-color');
493
+ const inputBg = rootStyles.getPropertyValue('--input-bg');
494
+
495
+ qrcodeContainers.forEach(container => {
496
+ const url = container.dataset.url;
497
+ // 清空容器中可能已有的内容
498
+ container.innerHTML = '';
499
+ if (url) {
500
+ new QRCode(container, {
501
+ text: url,
502
+ width: 128,
503
+ height: 128,
504
+ colorDark: textColor,
505
+ colorLight: inputBg,
506
+ correctLevel: QRCode.CorrectLevel.H
507
+ });
508
+ } else {
509
+ container.textContent = 'URL 未提供';
510
+ }
511
+ });
512
+ }
513
+
514
+ // 在页面加载完成后首次生成二维码(如果当前显示的是 Channel 页面)
515
+ window.addEventListener('load', () => {
516
+ if (pages.pageChannel.style.display === 'block') {
517
+ generateQRCodes();
518
+ }
519
+ });
477
520
  })();
478
521
  </script>
479
522
  </body>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: podflow
3
- Version: 20250331.2
3
+ Version: 20250401
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
@@ -14,7 +14,7 @@ Requires-Python: >=3.8
14
14
  Description-Content-Type: text/markdown
15
15
  Requires-Dist: astral>=3.2
16
16
  Requires-Dist: bottle>=0.13.2
17
- Requires-Dist: yt-dlp>=2025.3.27
17
+ Requires-Dist: yt-dlp>=2025.3.31
18
18
  Requires-Dist: chardet>=5.2.0
19
19
  Requires-Dist: cherrypy>=18.10.0
20
20
  Requires-Dist: pyqrcode>=1.2.1
@@ -16,10 +16,10 @@ podflow/basic/list_merge_tidy.py,sha256=7hWfSnsPh23edHNU92vxtI0nfpfN8m54GTEt2rGm
16
16
  podflow/basic/qr_code.py,sha256=PvtCIq1THH72-xfxmhlI4Lz3ncE04po4XfH2XSjbhm0,1520
17
17
  podflow/basic/split_dict.py,sha256=Ir6GTortcWMUeFITFgY1v-INMla5y0IN3RN3nTgzWqM,401
18
18
  podflow/basic/time_format.py,sha256=T3tw2vbOwxMYYXDaV4Sj76WOZtsspj2lWA_DzWqUEJA,487
19
- podflow/basic/time_print.py,sha256=-OcqzMsvPqAp7HOCrpK6435DEWBQ5zP-s7EtbLctPTw,767
19
+ podflow/basic/time_print.py,sha256=utNgnf9kSxX3hdTyrRNvRph63ZpD4BKLyFXVpkqrAyc,798
20
20
  podflow/basic/time_stamp.py,sha256=Kbz9PzgPtss1fRqPXdfz1q6MTGVMRi3LPClN7wrXSIk,1888
21
21
  podflow/basic/vary_replace.py,sha256=-TyvZxfak6U7Ak8F87ctYUBpHB2Il6iYZof37lwKjto,211
22
- podflow/basic/write_log.py,sha256=3m7S1G2rqe1gKz4ErI1ay17rymxmPOuHMC1IYh2BTzo,1317
22
+ podflow/basic/write_log.py,sha256=044gSqHRnSjwtl4Hhhi_zE2bRzmKBpigukxeHmSd-Fk,1312
23
23
  podflow/bilibili/__init__.py,sha256=6ZTpvhZTyn4f0LryXzH8lzyK1_rRHBeM-hkBoklKHRA,47
24
24
  podflow/bilibili/build.py,sha256=PKxkjUa8EedpoQTFZIgdcsVbiAWRISA-qKCpCaSTLTU,7957
25
25
  podflow/bilibili/get.py,sha256=Ld8lhb_3eiSagVXWyj1KIrRLjfH6p0sUolEG5VtN8mk,20337
@@ -40,11 +40,11 @@ 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/ansi_to_html.py,sha256=oQal9iCri7MDwZcLr44QdUYVTS1Damv6N7Zu0jFR6iI,1698
44
- podflow/httpfs/app_bottle.py,sha256=XozAAbcV1kikS2NISKcN0UI7d6at1hpi8pBpjUoUvls,16792
43
+ podflow/httpfs/app_bottle.py,sha256=wMTcuRZBEzBNNb6qDRQt_v-5HO8_mv755PFiIrTuycU,16787
45
44
  podflow/httpfs/browser.py,sha256=BJ4Xkfiki_tDr0Sc9RqAcEfIVpkAZ3RFOwo0aMHlY3U,197
46
45
  podflow/httpfs/get_channelid.py,sha256=gcwy4IVHBWNQz7qPCpjwiAklGFLRGzvM33-UZz7oFvo,2296
47
46
  podflow/httpfs/port_judge.py,sha256=l_nLpsSiIhAzfJGCOWyYC-KkCCWPUW2ybe_5hdMOEzE,764
47
+ podflow/httpfs/to_html.py,sha256=q-pQWhaqSGKZqRc3nV3ZSVexIIj-EJXbfXTMGGkTB7s,1863
48
48
  podflow/makeup/__init__.py,sha256=ligUtfj0stTcOHFXDF6eAN7Up2PxlB0GnGbLq7iDY3c,45
49
49
  podflow/makeup/del_makeup_format_fail.py,sha256=XizQh74QYXxRg0e1uerXjd4Tiq5qChks0fTAY7n3Z1I,642
50
50
  podflow/makeup/make_up_file.py,sha256=WJnKtdr6-CMEpxJAADCEhcyIwdUdisxbqXGmzo3R5KQ,2222
@@ -64,7 +64,7 @@ podflow/message/get_youtube_and_bilibili_video_format.py,sha256=BFlplFy-j3J_2UVv
64
64
  podflow/message/media_format.py,sha256=Q4WoML4UqL0Ry-QN8DHFJqOQ2tXcFN6u5hmhdSLdP1g,7346
65
65
  podflow/message/original_rss_fail_print.py,sha256=7HM5Gwi3GqBIg2dtTTDlN_FRgZZjYv6ejizS3tDiePE,502
66
66
  podflow/message/rss_create_hash.py,sha256=M5OS9KcQ4mIxLes9ij4oNji-4VKgi56bg0Shv5nCIQ4,638
67
- podflow/message/save_rss.py,sha256=r56xMQ-1L3CbS9cJg42Ifjk9oKuH7Xc-PJpOsex9glM,3201
67
+ podflow/message/save_rss.py,sha256=LTVbKsWdeZWDU9FiwDBi1K6Q0hqsMuYVI-_FcviF1VY,3287
68
68
  podflow/message/title_correction.py,sha256=Zieulj2wQY_o4r3u5ZRsDQP5y8KuZHrL_l8tnM96k6g,915
69
69
  podflow/message/update_information_display.py,sha256=Zn-Xhps4PKf7NbgQrT-qTwhP096RV-48OEncK_vuUe0,3061
70
70
  podflow/message/update_youtube_bilibili_rss.py,sha256=9hHym9e2DbSTZ1tSfBfErLJWmi9I71edNORdAaZCPTw,5238
@@ -80,7 +80,7 @@ podflow/remove/remove_dir.py,sha256=xQIhrnqnYjMzXjoSWaTvm7JwPYOFTN1muuTPdaLDXpQ,
80
80
  podflow/remove/remove_file.py,sha256=8wAJQehs-XBqvu0vPlEme2_tt0FZxc5ELwGMxXA_558,982
81
81
  podflow/repair/__init__.py,sha256=Gpc1i6xiSLodKjjmzH66c_Y1z0HQ9E9CS3p95FRnVFM,45
82
82
  podflow/repair/reverse_log.py,sha256=Wc_vAH0WB-z1fNdWx7FYaVH4caRPtot7tDwDwFhmpz4,1106
83
- podflow/templates/index.html,sha256=ujoYTcRcybbJQEVQYOEdYZUxHUdT8bPnKadWXdY8AIQ,14867
83
+ podflow/templates/index.html,sha256=8Z1ar797theXZ428tad-lVMWvVImi0UGzP5_1PIvKMs,16401
84
84
  podflow/upload/__init__.py,sha256=AtOSXDrE5EjUe3z-iBd1NTDaH8n_X9qA5WXdBLkONjA,45
85
85
  podflow/upload/add_upload.py,sha256=_2-V0z75Lwu-PUCfMD9HOSxZTB102yZlZW5hSdlHcsc,1432
86
86
  podflow/upload/build_hash.py,sha256=9opa3xLd7nJbGGX5xa3uuKPS6dxlbkAb87ZdEiUxmxI,473
@@ -95,8 +95,8 @@ podflow/youtube/__init__.py,sha256=pgXod8gq0IijZxIkPSwgAOcb9JI5rd1mqMomoR7bcJ4,4
95
95
  podflow/youtube/build.py,sha256=3LYk_ICVXj9XkE9jZ8jEVI8596xxS_QZkcoIwcBE3Ys,12006
96
96
  podflow/youtube/get.py,sha256=Of7PRgUknhpyW70nvyVAUYVb5KyFViKiBTfH3Y6Mke8,16970
97
97
  podflow/youtube/login.py,sha256=KYl--ya6Z1u0uIcOp9l8i3DIIj9hsYUDH4dtJjI0MLM,1295
98
- podflow-20250331.2.dist-info/METADATA,sha256=QhkIsJCACzqWzqoqvaRHNzdEvbyFu9k-vxXiknDQ8W0,14165
99
- podflow-20250331.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
100
- podflow-20250331.2.dist-info/entry_points.txt,sha256=mn7hD_c_dmpKe3XU0KNekheBvD01LhlJ9htY-Df0j2A,131
101
- podflow-20250331.2.dist-info/top_level.txt,sha256=fUujhhz-RrMI8aGvi-3Ey5y7FQnpOOgoFw9OWM3yLCU,8
102
- podflow-20250331.2.dist-info/RECORD,,
98
+ podflow-20250401.dist-info/METADATA,sha256=7zZoMBD-z1yQvleAQ52j9t27BCSNOdzuVfQzcB3Xeqk,14163
99
+ podflow-20250401.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
100
+ podflow-20250401.dist-info/entry_points.txt,sha256=mn7hD_c_dmpKe3XU0KNekheBvD01LhlJ9htY-Df0j2A,131
101
+ podflow-20250401.dist-info/top_level.txt,sha256=fUujhhz-RrMI8aGvi-3Ey5y7FQnpOOgoFw9OWM3yLCU,8
102
+ podflow-20250401.dist-info/RECORD,,