File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 2
2
import subprocess
3
3
import datetime
4
4
import re
5
+ import shutil
5
6
6
7
# 获取脚本所在目录
7
8
script_path = os .path .dirname (os .path .abspath (__file__ ))
@@ -44,8 +45,23 @@ def print_current_time(message):
44
45
# 5. 下载文件列表 - 已移至 iptv_download_merge.py
45
46
print ("跳过下载文件步骤,请使用 iptv_download_merge.py 进行文件下载" )
46
47
47
- # 6. 同步文件 - 已移至 iptv_download_merge.py
48
- print ("跳过文件同步步骤,请使用 iptv_download_merge.py 进行文件同步" )
48
+ # 6. 同步文件
49
+ print ("正在同步IPTV文件..." )
50
+ files_to_sync = ['iptv4.txt' , 'iptv4.m3u' , 'iptv6.txt' , 'iptv6.m3u' ]
51
+ source_dir = '/docker/iptv4/'
52
+
53
+ for file_name in files_to_sync :
54
+ source_path = os .path .join (source_dir , file_name )
55
+ target_path = os .path .join (script_path , file_name )
56
+
57
+ if os .path .exists (source_path ):
58
+ try :
59
+ shutil .copy2 (source_path , target_path )
60
+ print (f"成功同步文件: { file_name } 从 { source_dir } 到 { script_path } " )
61
+ except Exception as e :
62
+ print (f"同步文件 { file_name } 时出错: { str (e )} " )
63
+ else :
64
+ print (f"警告:源文件 { source_path } 不存在,跳过同步" )
49
65
50
66
# 7. 合并文件 - 已移至 iptv_download_merge.py
51
67
print ("跳过文件合并步骤,请使用 iptv_download_merge.py 进行文件合并" )
You can’t perform that action at this time.
0 commit comments