podflow 20250522__py3-none-any.whl → 20250601__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/__init__.py +1 -0
- podflow/config/correct_config.py +5 -0
- podflow/httpfs/app_bottle.py +8 -8
- podflow/message/fail_message_initialize.py +6 -1
- podflow/upload/linked_client.py +14 -10
- podflow/upload/upload_files.py +37 -3
- podflow/youtube/build.py +3 -3
- {podflow-20250522.dist-info → podflow-20250601.dist-info}/METADATA +2 -2
- {podflow-20250522.dist-info → podflow-20250601.dist-info}/RECORD +12 -12
- {podflow-20250522.dist-info → podflow-20250601.dist-info}/WHEEL +0 -0
- {podflow-20250522.dist-info → podflow-20250601.dist-info}/entry_points.txt +0 -0
- {podflow-20250522.dist-info → podflow-20250601.dist-info}/top_level.txt +0 -0
podflow/__init__.py
CHANGED
@@ -20,6 +20,7 @@ default_config = {
|
|
20
20
|
"delete_incompletement": False, # 是否删除下载中断媒体(下载前处理流程)
|
21
21
|
"remove_media": True, # 是否删除无用的媒体文件
|
22
22
|
"upload": False, # 是否将长期媒体进行上传
|
23
|
+
"upload_ip": "10.0.3.231", # 长期媒体进行上传服务器地址(可不写, 会自动搜索, 无法搜索请填写)
|
23
24
|
"channelid_youtube": { # Youtube频道列表
|
24
25
|
"youtube": {
|
25
26
|
"update_size": 15, # 每次获取频道媒体数量
|
podflow/config/correct_config.py
CHANGED
podflow/httpfs/app_bottle.py
CHANGED
@@ -328,14 +328,14 @@ class bottle_app:
|
|
328
328
|
self.print_out("login", 401)
|
329
329
|
return {
|
330
330
|
"code": -2,
|
331
|
-
"message": "Username Error",
|
331
|
+
"message": "Username Error", # 用户名错误
|
332
332
|
}
|
333
333
|
# 验证密码是否正确
|
334
334
|
if upload_data[username] != password:
|
335
335
|
self.print_out("login", 401)
|
336
336
|
return {
|
337
337
|
"code": -3,
|
338
|
-
"message": "Password Error",
|
338
|
+
"message": "Password Error", # 密码错误
|
339
339
|
}
|
340
340
|
# 从请求中获取上传的文件对象
|
341
341
|
upload_file = request.files.get("file")
|
@@ -345,7 +345,7 @@ class bottle_app:
|
|
345
345
|
self.print_out("upload", 404)
|
346
346
|
return {
|
347
347
|
"code": -4,
|
348
|
-
"message": "No File Provided",
|
348
|
+
"message": "No File Provided", # 没有上传文件
|
349
349
|
}
|
350
350
|
# 判断文件是否完整
|
351
351
|
uploadfile = upload_file.file
|
@@ -355,7 +355,7 @@ class bottle_app:
|
|
355
355
|
self.print_out("upload", 401)
|
356
356
|
return {
|
357
357
|
"code": -5,
|
358
|
-
"message": "Incomplete File",
|
358
|
+
"message": "Incomplete File", # 文件不完整
|
359
359
|
"hash": uploadfile_hash,
|
360
360
|
}
|
361
361
|
if not channelid:
|
@@ -363,7 +363,7 @@ class bottle_app:
|
|
363
363
|
self.print_out("upload", 404)
|
364
364
|
return {
|
365
365
|
"code": -6,
|
366
|
-
"message": "ChannelId Does Not Exist",
|
366
|
+
"message": "ChannelId Does Not Exist", # 频道ID不存在
|
367
367
|
}
|
368
368
|
# 获取上传文件的原始文件名
|
369
369
|
filename = upload_file.filename
|
@@ -373,7 +373,7 @@ class bottle_app:
|
|
373
373
|
self.print_out("upload", 404)
|
374
374
|
return {
|
375
375
|
"code": -6,
|
376
|
-
"message": "File Format Error",
|
376
|
+
"message": "File Format Error", # 文件格式错误
|
377
377
|
}
|
378
378
|
address = f"channel_audiovisual/{channelid}"
|
379
379
|
if os.path.exists(address):
|
@@ -391,7 +391,7 @@ class bottle_app:
|
|
391
391
|
self.print_out("upload", 200)
|
392
392
|
return {
|
393
393
|
"code": 1,
|
394
|
-
"message": "The Same File Exists",
|
394
|
+
"message": "The Same File Exists", # 相同文件已存在
|
395
395
|
"data": {
|
396
396
|
"filename": filename,
|
397
397
|
},
|
@@ -405,7 +405,7 @@ class bottle_app:
|
|
405
405
|
self.print_out("upload", 200)
|
406
406
|
return {
|
407
407
|
"code": 0,
|
408
|
-
"message": "Upload Success",
|
408
|
+
"message": "Upload Success", # 上传成功
|
409
409
|
"data": {
|
410
410
|
"filename": filename,
|
411
411
|
},
|
@@ -148,7 +148,12 @@ error_reason = [
|
|
148
148
|
r"Offline.",
|
149
149
|
"\033[31m直播已停止\033[0m",
|
150
150
|
"text",
|
151
|
-
]
|
151
|
+
],
|
152
|
+
[
|
153
|
+
r"Got error: \<urllib3\.connection\.HTTPSConnection object at .{18}\>: Failed to resolve \'rr5---sn-a5msenek\.googlevideo\.com\' \(\[Errno 11001\] getaddrinfo failed\)",
|
154
|
+
"\033[31m无法解析\033[0m",
|
155
|
+
"regexp",
|
156
|
+
],
|
152
157
|
]
|
153
158
|
|
154
159
|
|
podflow/upload/linked_client.py
CHANGED
@@ -90,16 +90,20 @@ def discover_server(broadcast_ip, broadcast_port, time_out):
|
|
90
90
|
def connect_upload_server():
|
91
91
|
# 如果配置中启用了上传功能
|
92
92
|
if gVar.config["upload"]:
|
93
|
-
|
94
|
-
if
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
93
|
+
upload_ip = gVar.config["upload_ip"]
|
94
|
+
if upload_ip:
|
95
|
+
broadcast_ip = upload_ip
|
96
|
+
else:
|
97
|
+
local_ip = get_local_ip()
|
98
|
+
if not local_ip:
|
99
|
+
# 如果无法获取本地IP,广播发现也无法进行
|
100
|
+
time_print("\033[31m无法获取本地IP,跳过广播发现。\033[0m")
|
101
|
+
return
|
102
|
+
broadcast_ip = calculate_broadcast(local_ip)
|
103
|
+
if broadcast_ip in ["255.255.255.255", local_ip, "0.0.0.0"]:
|
104
|
+
# 避免向无效或自己的地址广播
|
105
|
+
time_print(f"\033[31m计算出的广播地址无效或为本机地址: {broadcast_ip},跳过广播发现。\033[0m")
|
106
|
+
return
|
103
107
|
# 打印正在搜索上传服务器
|
104
108
|
time_print("正在搜索上传服务器...")
|
105
109
|
# 服务器列表为空
|
podflow/upload/upload_files.py
CHANGED
@@ -2,10 +2,15 @@
|
|
2
2
|
# coding: utf-8
|
3
3
|
|
4
4
|
import time
|
5
|
+
from datetime import datetime
|
6
|
+
from podflow import gVar
|
7
|
+
from podflow.httpfs.to_html import ansi_to_html
|
5
8
|
from podflow.upload.build_hash import build_hash
|
6
9
|
from podflow.basic.http_client import http_client
|
10
|
+
from podflow.httpfs.app_bottle import bottle_app_instance
|
7
11
|
|
8
12
|
|
13
|
+
# 上传文件模块
|
9
14
|
def upload_file(username, password, channelid, filename):
|
10
15
|
filename = f"channel_audiovisual/{channelid}/{filename}"
|
11
16
|
with open(filename, "rb") as file:
|
@@ -25,12 +30,13 @@ def upload_file(username, password, channelid, filename):
|
|
25
30
|
mode="post",
|
26
31
|
file=file,
|
27
32
|
):
|
28
|
-
return response.json()
|
33
|
+
return response.json(), hashs
|
29
34
|
else:
|
30
|
-
return None
|
31
|
-
return None
|
35
|
+
return None, hashs
|
36
|
+
return None, hashs
|
32
37
|
|
33
38
|
|
39
|
+
# 查找位置模块
|
34
40
|
def find_media_index(upload_original, target_media_id):
|
35
41
|
for index, item in enumerate(upload_original):
|
36
42
|
if item.get("media_id") == target_media_id:
|
@@ -38,6 +44,7 @@ def find_media_index(upload_original, target_media_id):
|
|
38
44
|
return -1
|
39
45
|
|
40
46
|
|
47
|
+
# 过滤和排序媒体模块
|
41
48
|
def filter_and_sort_media(media_list, day):
|
42
49
|
current_time = int(time.time())
|
43
50
|
one_month_ago = current_time - day * 24 * 60 * 60 # 30天前的时间戳
|
@@ -56,3 +63,30 @@ def filter_and_sort_media(media_list, day):
|
|
56
63
|
for item in filtered_sorted
|
57
64
|
]
|
58
65
|
return result
|
66
|
+
|
67
|
+
|
68
|
+
def record_upload(username, password, channelid, filename):
|
69
|
+
response, hashs = upload_file(username, password, channelid, filename)
|
70
|
+
channelname = (
|
71
|
+
gVar.channelid_youtube_ids_original | gVar.channelid_bilibili_ids_original
|
72
|
+
).get(channelid, "")
|
73
|
+
now_time = datetime.now().strftime("%H:%M:%S")
|
74
|
+
if response:
|
75
|
+
code = response.get("code")
|
76
|
+
data = response.get("data", {})
|
77
|
+
message = response.get("message", "")
|
78
|
+
if code in [0, 1]:
|
79
|
+
index = find_media_index(gVar.upload_original, filename)
|
80
|
+
if index != -1:
|
81
|
+
filename = data.get("filename")
|
82
|
+
if filename:
|
83
|
+
gVar.upload_original[index]["upload"] = True
|
84
|
+
gVar.upload_original[index]["hash"] = hashs
|
85
|
+
gVar.upload_original[index]["filename"] = hashs
|
86
|
+
|
87
|
+
bottle_text = f"{now_time}|{channelname}/{filename} Upload: {message}"
|
88
|
+
else:
|
89
|
+
bottle_text = f"{now_time}|{channelname}/{filename} Upload Failed"
|
90
|
+
bottle_app_instance.bottle_print.append(bottle_text)
|
91
|
+
gVar.index_message["http"].append(ansi_to_html(bottle_text))
|
92
|
+
bottle_app_instance.cherry_print(False)
|
podflow/youtube/build.py
CHANGED
@@ -47,8 +47,8 @@ def get_youtube_introduction():
|
|
47
47
|
).group()
|
48
48
|
else:
|
49
49
|
xml_tree = {"introduction": False}
|
50
|
-
|
51
|
-
|
50
|
+
with youtube_xml_get_lock:
|
51
|
+
gVar.youtube_xml_get_tree[output_dir] = xml_tree
|
52
52
|
# 创建线程列表
|
53
53
|
youtube_xml_get_threads = []
|
54
54
|
for output_dir in gVar.channelid_youtube_ids_update:
|
@@ -187,7 +187,6 @@ def get_xml_item(guid, item, channelid_title, title_change, output_dir):
|
|
187
187
|
# 生成YouTube对应channel的需更新的items模块
|
188
188
|
def youtube_xml_items(output_dir, ratio_part):
|
189
189
|
items_list = [f"<!-- {output_dir} -->"]
|
190
|
-
entry_num = 0
|
191
190
|
original_judgment = True
|
192
191
|
channelid_youtube_value = gVar.channelid_youtube[
|
193
192
|
gVar.channelid_youtube_ids[output_dir]
|
@@ -227,6 +226,7 @@ def youtube_xml_items(output_dir, ratio_part):
|
|
227
226
|
else:
|
228
227
|
file_xml = output_dir_value["content"]
|
229
228
|
entrys = re.findall(r"<entry>.+?</entry>", file_xml, re.DOTALL)
|
229
|
+
entry_num = 0
|
230
230
|
for entry in entrys:
|
231
231
|
if (
|
232
232
|
re.search(r"(?<=<yt:videoId>).+(?=</yt:videoId>)", entry).group()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: podflow
|
3
|
-
Version:
|
3
|
+
Version: 20250601
|
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.
|
17
|
+
Requires-Dist: yt-dlp>=2025.5.22
|
18
18
|
Requires-Dist: chardet>=5.2.0
|
19
19
|
Requires-Dist: cherrypy>=18.10.0
|
20
20
|
Requires-Dist: pyqrcode>=1.2.1
|
@@ -1,4 +1,4 @@
|
|
1
|
-
podflow/__init__.py,sha256=
|
1
|
+
podflow/__init__.py,sha256=KdCh8mDeRDjjtdHQUzg025Qnpw8UGgrHdboFvkjOAm4,7506
|
2
2
|
podflow/download_and_build.py,sha256=GKQ1uX8Nuwdhr4wgnGr3jP1Mu0llRUPFcboQ3S05WkU,671
|
3
3
|
podflow/ffmpeg_judge.py,sha256=wM49pPXOFwFAA_8TKHal5fV6ka9sAA87yGQMDOssvXo,1340
|
4
4
|
podflow/main.py,sha256=Cz2E33-Kcc_1_oxNs4Z1OoqJYhonmClsrtoCW1oQmZA,739
|
@@ -28,7 +28,7 @@ podflow/config/__init__.py,sha256=MzgAlkSdV-5MFC11r0QSf-GPxmsLbrMc5ROIrJafjag,45
|
|
28
28
|
podflow/config/build_original.py,sha256=pG9gCkBBIWwU8QxZA06Br6JRfI4XUSIEiN8eqo1-v7k,1809
|
29
29
|
podflow/config/channge_icon.py,sha256=W-EU_5_wg94_yioNofk8OTyRD2X7SY8HEjvjFmSEyh0,5653
|
30
30
|
podflow/config/correct_channelid.py,sha256=4Z6B3cR5wQq5Vce4LPGVDqqUGc-fW54B46w7f_XEKYc,9252
|
31
|
-
podflow/config/correct_config.py,sha256=
|
31
|
+
podflow/config/correct_config.py,sha256=slC3DYiapyZ8JO6xjDvNWQ5DBOZRvO7FvAQm-2J5H08,4121
|
32
32
|
podflow/config/get_channelid.py,sha256=WUtvUZ1Q_L9n94ZGGaOqu-9QC2HlYMx5oU4gOCZ4_Ew,626
|
33
33
|
podflow/config/get_channelid_id.py,sha256=VjExb_AXPHtQ5v8SaZiehaiLNkNmfMoPcv5HyUar6GU,571
|
34
34
|
podflow/config/get_config.py,sha256=TpLbh5GoPO7csWUJ-di65XXnkN3LSnMXkFw85h5ndHs,1279
|
@@ -40,7 +40,7 @@ podflow/download/show_progress.py,sha256=y46chchUC9eZCg4ZdNMFnx_bXJQV_IUq15jVzZt
|
|
40
40
|
podflow/download/wait_animation.py,sha256=AUTvszXF89QA7XYjocFIauPKV7Qj8cFqry44teClaLQ,1314
|
41
41
|
podflow/download/youtube_and_bilibili_download.py,sha256=VCEhz6pGXFWXusdbGWqkCzi4f4VsKQVn6sZz1pfGsns,1335
|
42
42
|
podflow/httpfs/__init__.py,sha256=BxEXkufjcx-a0F7sDVXo65hmyANqCCbZUd6EH9i8T2c,45
|
43
|
-
podflow/httpfs/app_bottle.py,sha256=
|
43
|
+
podflow/httpfs/app_bottle.py,sha256=UhUIpkI4afz6fXrvXH8a-hYBmjXH8WJuNIcvnCtSIrQ,21465
|
44
44
|
podflow/httpfs/browser.py,sha256=BJ4Xkfiki_tDr0Sc9RqAcEfIVpkAZ3RFOwo0aMHlY3U,197
|
45
45
|
podflow/httpfs/download_bar.py,sha256=0n3HATEO3pdsIpx-E_IZG9OlXa6u-9SeBCoZVgUutyc,965
|
46
46
|
podflow/httpfs/get_channelid.py,sha256=gcwy4IVHBWNQz7qPCpjwiAklGFLRGzvM33-UZz7oFvo,2296
|
@@ -56,7 +56,7 @@ podflow/message/__init__.py,sha256=pZkcrrtkdtxgMriEHBZ0_rptKaQrQeMPJvPSaoI1Awo,4
|
|
56
56
|
podflow/message/backup_zip_save.py,sha256=c81jnx8IxHjTcO7G0OUAppawpBIPxa9wgkj9AQhqeJc,1864
|
57
57
|
podflow/message/create_main_rss.py,sha256=kW2QvJhxl2ZcqGV-M-OztlOaQ27ODuQxADeP8poymBQ,3118
|
58
58
|
podflow/message/display_qrcode_and_url.py,sha256=VqmRkDYYG03VihfW4SAU49HJVmfqWbLTgMxqCaREeCo,1037
|
59
|
-
podflow/message/fail_message_initialize.py,sha256=
|
59
|
+
podflow/message/fail_message_initialize.py,sha256=OlkPQUU2qgTJ-wcFhyGiTAeoY0qy_eOOQGkA0PtyxHQ,6711
|
60
60
|
podflow/message/format_time.py,sha256=gveNh4FGeS3ytwDyYB-h12d1_Km6XoX7WSPcFmDfCBk,909
|
61
61
|
podflow/message/get_media_name.py,sha256=5ULPQOQCZ2-lxdkILwlBP-ItzdFEgvEAKxeLtplACbQ,861
|
62
62
|
podflow/message/get_original_rss.py,sha256=Bzy-Fs1vZEjwvQq6D6xp-2IUidliSyaL1P4WtkLJaRg,2450
|
@@ -93,19 +93,19 @@ podflow/upload/__init__.py,sha256=AtOSXDrE5EjUe3z-iBd1NTDaH8n_X9qA5WXdBLkONjA,45
|
|
93
93
|
podflow/upload/add_upload.py,sha256=_2-V0z75Lwu-PUCfMD9HOSxZTB102yZlZW5hSdlHcsc,1432
|
94
94
|
podflow/upload/build_hash.py,sha256=9opa3xLd7nJbGGX5xa3uuKPS6dxlbkAb87ZdEiUxmxI,473
|
95
95
|
podflow/upload/get_upload_original.py,sha256=TEDnRutumm2FZNIesPJIlExHyKWpfB3ZAHb3sZt7V6A,4312
|
96
|
-
podflow/upload/linked_client.py,sha256=
|
96
|
+
podflow/upload/linked_client.py,sha256=NdSi5uh0TbZUhOHbA_mkHo4aIz1XNKoSXHhT4rMRUpc,5288
|
97
97
|
podflow/upload/linked_server.py,sha256=h-qSx13fP8_Ny2IKW3wCNPwqRqW6-Iz1pqxD9ga9-dM,2308
|
98
98
|
podflow/upload/login.py,sha256=85sqr12T-3NH-TD3kAMzy4yb1KOheV3Tr0eGee7NCJo,4007
|
99
99
|
podflow/upload/time_key.py,sha256=6jZ3cxUjzj_umYDwH27R0YNZlLXxfhNp-CqV_K22wlo,967
|
100
100
|
podflow/upload/update_upload.py,sha256=_5tp1zPNsC9DdDnLzm-P8bLcOBuDov4eMRHp_861j80,3183
|
101
|
-
podflow/upload/upload_files.py,sha256=
|
101
|
+
podflow/upload/upload_files.py,sha256=f6ME5t4shs1XB_aqO5tFYbJNqEOTzGkceZ2dF1m7cl4,3072
|
102
102
|
podflow/upload/upload_server.py,sha256=BFq3QrWE7U97LbC4EQiDhQXbLapEc4R00eRDBH12E6A,565
|
103
103
|
podflow/youtube/__init__.py,sha256=pgXod8gq0IijZxIkPSwgAOcb9JI5rd1mqMomoR7bcJ4,46
|
104
|
-
podflow/youtube/build.py,sha256=
|
104
|
+
podflow/youtube/build.py,sha256=j6SVq3HFFGlNNqRrHfnBIThdzsH88PFmwLnejosif1U,12311
|
105
105
|
podflow/youtube/get.py,sha256=oO32GjTFvUgP5AfFX5AlIuXU2UT6QtOUOXWLFzi8XtI,17157
|
106
106
|
podflow/youtube/login.py,sha256=KYl--ya6Z1u0uIcOp9l8i3DIIj9hsYUDH4dtJjI0MLM,1295
|
107
|
-
podflow-
|
108
|
-
podflow-
|
109
|
-
podflow-
|
110
|
-
podflow-
|
111
|
-
podflow-
|
107
|
+
podflow-20250601.dist-info/METADATA,sha256=8-mKVPtVbJ6lsTX8F69gX0VfHcCFjOYjOPcJuaSV1hM,14195
|
108
|
+
podflow-20250601.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
109
|
+
podflow-20250601.dist-info/entry_points.txt,sha256=mn7hD_c_dmpKe3XU0KNekheBvD01LhlJ9htY-Df0j2A,131
|
110
|
+
podflow-20250601.dist-info/top_level.txt,sha256=fUujhhz-RrMI8aGvi-3Ey5y7FQnpOOgoFw9OWM3yLCU,8
|
111
|
+
podflow-20250601.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|