podflow 20250601__py3-none-any.whl → 20250606__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 +2 -0
- podflow/download_and_build.py +6 -0
- podflow/httpfs/app_bottle.py +1 -1
- podflow/main_podcast.py +2 -0
- podflow/message/get_youtube_and_bilibili_video_format.py +6 -1
- podflow/upload/upload_files.py +33 -11
- {podflow-20250601.dist-info → podflow-20250606.dist-info}/METADATA +1 -1
- {podflow-20250601.dist-info → podflow-20250606.dist-info}/RECORD +11 -11
- {podflow-20250601.dist-info → podflow-20250606.dist-info}/WHEEL +0 -0
- {podflow-20250601.dist-info → podflow-20250606.dist-info}/entry_points.txt +0 -0
- {podflow-20250601.dist-info → podflow-20250606.dist-info}/top_level.txt +0 -0
podflow/__init__.py
CHANGED
podflow/download_and_build.py
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
# coding: utf-8
|
3
3
|
|
4
4
|
import threading
|
5
|
+
from podflow import gVar
|
6
|
+
from podflow.upload.upload_files import all_upload
|
5
7
|
from podflow.youtube.build import get_youtube_introduction
|
6
8
|
from podflow.message.create_main_rss import create_main_rss
|
7
9
|
from podflow.download.youtube_and_bilibili_download import youtube_and_bilibili_download
|
@@ -10,15 +12,19 @@ from podflow.download.youtube_and_bilibili_download import youtube_and_bilibili_
|
|
10
12
|
def get_and_duild():
|
11
13
|
get_youtube_introduction()
|
12
14
|
create_main_rss()
|
15
|
+
gVar.upload_stop = True # 停止上传线程
|
13
16
|
|
14
17
|
|
15
18
|
# 下载并构建YouTube和哔哩哔哩视频模块
|
16
19
|
def download_and_build():
|
17
20
|
thread_download = threading.Thread(target=youtube_and_bilibili_download)
|
18
21
|
thread_build = threading.Thread(target=get_and_duild)
|
22
|
+
thread_upload = threading.Thread(target=all_upload)
|
19
23
|
|
20
24
|
thread_download.start()
|
21
25
|
thread_build.start()
|
26
|
+
thread_upload.start()
|
22
27
|
|
23
28
|
thread_download.join()
|
24
29
|
thread_build.join()
|
30
|
+
thread_upload.join()
|
podflow/httpfs/app_bottle.py
CHANGED
podflow/main_podcast.py
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
from podflow import gVar
|
5
5
|
from podflow.basic.write_log import write_log
|
6
|
+
from podflow.bilibili.get import get_bilibili_cid
|
6
7
|
from podflow.httpfs.progress_bar import progress_bar
|
7
8
|
from podflow.message.media_format import media_format
|
8
9
|
|
@@ -63,7 +64,11 @@ def get_youtube_and_bilibili_video_format(
|
|
63
64
|
id_update_format = f"\033[31m{fail_info}\033[0m(需要Cookies)"
|
64
65
|
break
|
65
66
|
else:
|
66
|
-
if gVar.video_id_update_format[id_num]["
|
67
|
+
if gVar.channelid_bilibili[gVar.video_id_update_format[id_num]["name"]]["AllPartGet"]:
|
68
|
+
power = gVar.video_id_update_format[id_num]["power"]
|
69
|
+
else:
|
70
|
+
power = get_bilibili_cid(id_num, gVar.video_id_update_format[id_num]["name"])[2]
|
71
|
+
if power is True and (
|
67
72
|
"试看" in id_update_format or id_update_format == "无法获取音频ID"
|
68
73
|
):
|
69
74
|
id_update_format = "\033[31m充电专属\033[0m"
|
podflow/upload/upload_files.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# podflow/upload/upload_files.py
|
2
2
|
# coding: utf-8
|
3
3
|
|
4
|
-
import time
|
5
4
|
from datetime import datetime
|
6
5
|
from podflow import gVar
|
7
6
|
from podflow.httpfs.to_html import ansi_to_html
|
@@ -25,7 +24,7 @@ def upload_file(username, password, channelid, filename):
|
|
25
24
|
}
|
26
25
|
if response := http_client(
|
27
26
|
url="http://10.0.3.231:5000/upload",
|
28
|
-
name="
|
27
|
+
name="",
|
29
28
|
data=data,
|
30
29
|
mode="post",
|
31
30
|
file=file,
|
@@ -44,17 +43,14 @@ def find_media_index(upload_original, target_media_id):
|
|
44
43
|
return -1
|
45
44
|
|
46
45
|
|
47
|
-
#
|
48
|
-
def filter_and_sort_media(media_list
|
49
|
-
current_time = int(time.time())
|
50
|
-
one_month_ago = current_time - day * 24 * 60 * 60 # 30天前的时间戳
|
46
|
+
# 过滤和排序上传媒体模块
|
47
|
+
def filter_and_sort_media(media_list):
|
51
48
|
filtered_sorted = sorted(
|
52
49
|
(
|
53
50
|
item
|
54
51
|
for item in media_list
|
55
52
|
if not item["upload"]
|
56
53
|
and not item["remove"]
|
57
|
-
and item["media_time"] < one_month_ago
|
58
54
|
),
|
59
55
|
key=lambda x: x["media_time"],
|
60
56
|
)
|
@@ -65,12 +61,24 @@ def filter_and_sort_media(media_list, day):
|
|
65
61
|
return result
|
66
62
|
|
67
63
|
|
64
|
+
# 媒体文件上传模块
|
68
65
|
def record_upload(username, password, channelid, filename):
|
69
66
|
response, hashs = upload_file(username, password, channelid, filename)
|
70
67
|
channelname = (
|
71
68
|
gVar.channelid_youtube_ids_original | gVar.channelid_bilibili_ids_original
|
72
69
|
).get(channelid, "")
|
73
70
|
now_time = datetime.now().strftime("%H:%M:%S")
|
71
|
+
result = {
|
72
|
+
0: "",
|
73
|
+
1: "存在相同文件",
|
74
|
+
-2: "用户名错误",
|
75
|
+
-3: "密码错误",
|
76
|
+
-4: "上传文件为空",
|
77
|
+
-5: "文件不完整",
|
78
|
+
-6: "频道ID不存在",
|
79
|
+
-7: "文件格式有误",
|
80
|
+
}
|
81
|
+
name = filename.split(".")[0]
|
74
82
|
if response:
|
75
83
|
code = response.get("code")
|
76
84
|
data = response.get("data", {})
|
@@ -82,11 +90,25 @@ def record_upload(username, password, channelid, filename):
|
|
82
90
|
if filename:
|
83
91
|
gVar.upload_original[index]["upload"] = True
|
84
92
|
gVar.upload_original[index]["hash"] = hashs
|
85
|
-
gVar.upload_original[index]["filename"] =
|
86
|
-
|
87
|
-
|
93
|
+
gVar.upload_original[index]["filename"] = filename
|
94
|
+
if code == 0:
|
95
|
+
bottle_text = f"{now_time}|{channelname}/{name}|\033[32m上传成功\033[0m"
|
96
|
+
else:
|
97
|
+
bottle_text = f"{now_time}|{channelname}/{name}|\033[33m上传成功\033[0m: {result.get(code, message)}"
|
88
98
|
else:
|
89
|
-
bottle_text = f"{now_time}|{channelname}/{
|
99
|
+
bottle_text = f"{now_time}|{channelname}/{name}|\033[31m上传失败\033[0m: {result.get(code, message)}"
|
90
100
|
bottle_app_instance.bottle_print.append(bottle_text)
|
91
101
|
gVar.index_message["http"].append(ansi_to_html(bottle_text))
|
92
102
|
bottle_app_instance.cherry_print(False)
|
103
|
+
|
104
|
+
|
105
|
+
# 总体上传模块
|
106
|
+
def all_upload():
|
107
|
+
if gVar.config["upload"]:
|
108
|
+
result = filter_and_sort_media(gVar.upload_original)
|
109
|
+
username = gVar.upload_json["username"]
|
110
|
+
password = gVar.upload_json["password"]
|
111
|
+
for item in result:
|
112
|
+
record_upload(username, password, item["channel_id"], item["media_id"])
|
113
|
+
if gVar.upload_stop:
|
114
|
+
break
|
@@ -1,8 +1,8 @@
|
|
1
|
-
podflow/__init__.py,sha256=
|
2
|
-
podflow/download_and_build.py,sha256=
|
1
|
+
podflow/__init__.py,sha256=mquu8BdWK9V4dDObCCfnPodeXOPkz-kj8_RNB7kK3Ys,7628
|
2
|
+
podflow/download_and_build.py,sha256=UPFTc8XjBEkg3GnCt3zkNjCzSbHugS3O8AreaWIgHJ0,904
|
3
3
|
podflow/ffmpeg_judge.py,sha256=wM49pPXOFwFAA_8TKHal5fV6ka9sAA87yGQMDOssvXo,1340
|
4
4
|
podflow/main.py,sha256=Cz2E33-Kcc_1_oxNs4Z1OoqJYhonmClsrtoCW1oQmZA,739
|
5
|
-
podflow/main_podcast.py,sha256=
|
5
|
+
podflow/main_podcast.py,sha256=SSFIg73JLu3wS5E3WAo8OAgXG4r_CHsPT-XSga0Vzrg,12386
|
6
6
|
podflow/main_upload.py,sha256=H_T5KQMYzToqzQbjGQ6DWDGziy8iMnpmf7A1qOStJuo,2296
|
7
7
|
podflow/parse_arguments.py,sha256=h3a7EaRZS04kNMFYbxTW9Ch29KgZ7dyS-yqEEt_etQI,2592
|
8
8
|
podflow/basic/__init__.py,sha256=CAfI6mVQtz7KKbAiTIZ9_IbvaTXeAqxR1U7ov9GDoDo,44
|
@@ -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=cRPJe9JvS6FZVumDgQYOzPdpKrLd3gitKetCNVa3TPw,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
|
@@ -62,7 +62,7 @@ podflow/message/get_media_name.py,sha256=5ULPQOQCZ2-lxdkILwlBP-ItzdFEgvEAKxeLtpl
|
|
62
62
|
podflow/message/get_original_rss.py,sha256=Bzy-Fs1vZEjwvQq6D6xp-2IUidliSyaL1P4WtkLJaRg,2450
|
63
63
|
podflow/message/get_video_format.py,sha256=bPetnFwQlhIO9do_nq3B4AwHQRxFn6SDYvFItjwEx0o,5324
|
64
64
|
podflow/message/get_video_format_multithread.py,sha256=tbgQDMpcntulrbmXBbKL4iVr4t_9evGsuMOIZLoLebI,1615
|
65
|
-
podflow/message/get_youtube_and_bilibili_video_format.py,sha256=
|
65
|
+
podflow/message/get_youtube_and_bilibili_video_format.py,sha256=FACn7IYWTzMHvgNcv8DiUs9CrfoRvLz_9EBjrCxT_9A,4911
|
66
66
|
podflow/message/media_format.py,sha256=Q4WoML4UqL0Ry-QN8DHFJqOQ2tXcFN6u5hmhdSLdP1g,7346
|
67
67
|
podflow/message/optimize_download.py,sha256=-6YritASap8Dp0HqDuvn-kyeamAfw8UjnR-_5S0DbYw,1034
|
68
68
|
podflow/message/original_rss_fail_print.py,sha256=7HM5Gwi3GqBIg2dtTTDlN_FRgZZjYv6ejizS3tDiePE,502
|
@@ -98,14 +98,14 @@ podflow/upload/linked_server.py,sha256=h-qSx13fP8_Ny2IKW3wCNPwqRqW6-Iz1pqxD9ga9-
|
|
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=HgnqWA6W1Llonb2wPXxCeIWuZfTte7As1C8qzLSSe5c,3816
|
102
102
|
podflow/upload/upload_server.py,sha256=BFq3QrWE7U97LbC4EQiDhQXbLapEc4R00eRDBH12E6A,565
|
103
103
|
podflow/youtube/__init__.py,sha256=pgXod8gq0IijZxIkPSwgAOcb9JI5rd1mqMomoR7bcJ4,46
|
104
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-20250606.dist-info/METADATA,sha256=zKC-lSx5y_drdcigYN7YXdHvD3QJSNvVCkyIIOiZDfM,14195
|
108
|
+
podflow-20250606.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
109
|
+
podflow-20250606.dist-info/entry_points.txt,sha256=mn7hD_c_dmpKe3XU0KNekheBvD01LhlJ9htY-Df0j2A,131
|
110
|
+
podflow-20250606.dist-info/top_level.txt,sha256=fUujhhz-RrMI8aGvi-3Ey5y7FQnpOOgoFw9OWM3yLCU,8
|
111
|
+
podflow-20250606.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|