diff --git a/.gitignore b/.gitignore index 6cf5abe..abde62a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,7 @@ -Media/* +config/config.yaml +strm/* +media/* +__pycache__/* + +*bak +test-* \ No newline at end of file diff --git a/README.md b/README.md index 1437a60..5a7f860 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **一个为Emby、Jellyfin服务器提供直链播放的小项目** # 说明文档 -详情见[Akimio的博客](https://blog.akimio.top/posts/1031/#使用教程) +详情见[AutoFilm说明文档](https://blog.akimio.top/posts/1031/) # 优点 - [x] 轻量化Emby服务器,降低Emby服务器的性能需求以及硬盘需求 @@ -12,9 +12,16 @@ # TODO LIST - [x] 从config文件中读取多个参数 -- [ ] 优化程序运行效率 +- [x] 优化程序运行效率(多线程处理) +- [ ] 增加Docker镜像 +- [ ] Strm模式/媒体库模式 +- [ ] 监控模式 - [ ] 对接TMDB实现分类、重命名、刮削等功能 +# 更新日志 +- 2024.2.1: v1.0.0,完全重构AutoFilm,不再兼容v0.1,实现多线程,大幅度提升任务处理速度 +- 2024.1.28:v0.1.1,初始版本持续迭代 + # 开源许可证 **本项目采用 GNU Affero General Public License(GNU AGPL)开源许可证。** diff --git a/autofilm-actions.py b/autofilm-actions.py deleted file mode 100644 index 4fa3ab7..0000000 --- a/autofilm-actions.py +++ /dev/null @@ -1,61 +0,0 @@ -import argparse,configparser,os - -def read_config_file(config_file_path): - """ - 读取配置文件,返回一个字典 - """ - config = configparser.ConfigParser() - config.read(config_file_path, encoding='utf-8') - - default_params = config['Default'] - default_webdav_url = default_params.get('webdav_url') - default_username = default_params.get('username') - default_password = default_params.get('password') - default_output_path = default_params.get('output_path') - - params = [] - for section_name in config.sections(): - if section_name == 'Default': - continue - section_params = config[section_name] - webdav_url = section_params.get('webdav_url', default_webdav_url) - username = section_params.get('username', default_username) - password = section_params.get('password', default_password) - output_path = section_params.get('output_path', default_output_path) - subtitle = section_params.getboolean('subtitle', fallback=False) - nfo = section_params.getboolean('nfo', fallback=False) - img = section_params.getboolean('img', fallback=False) - params.append({ - 'webdav_url': webdav_url, - 'username': username, - 'password': password, - 'output_path': output_path, - 'subtitle': subtitle, - 'nfo': nfo, - 'img': img - }) - return params - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('--path', required=True, help='config文件的地址') - args = parser.parse_args() - - config_file_path = args.path - if not os.path.isfile(config_file_path): - print(f'找不到配置文件 {config_file_path}') - return - - params_list = read_config_file(config_file_path) - for params in params_list: - command = 'python3 autofilm.py' - for key, value in params.items(): - if key == 'subtitle' or key == 'nfo' or key == 'img': - if value: - command += f' --{key}' - else: - command += f' --{key} "{value}"' - os.system(command) - -if __name__ == '__main__': - main() diff --git a/autofilm.py b/autofilm.py index 38a8818..9aa4d1c 100644 --- a/autofilm.py +++ b/autofilm.py @@ -1,154 +1,144 @@ +import os +import queue +import threading +import requests +import yaml +import time from webdav3.client import Client -import argparse, os, requests, time - -from version import APP_VERSION - -''' -遍历Webdav服务器函数 -如果depth为None,则会递归遍历整个WebDAV服务器 -如果depth为正整数,则会递归遍历到指定深度 -如果depth为0,则只会遍历当前文件夹中的文件和文件夹,不会继续递归遍历下一级文件夹。 -''' -def list_files(webdav_url, username, password, show_path, depth=None, path='', count=0, proxies=None): - options = { - 'webdav_hostname': webdav_url, - 'webdav_login': username, - 'webdav_password': password, - 'proxies': proxies - } - - client = Client(options) - directory = [] - files = [] - q = 1 - while q < 15: - try: - items = client.list() - except: - print(f'第{q}次连接失败,{q+1}秒后重试...') - q += 1 - time.sleep(q) - else: - if q > 1: - print('重连成功...') - break - - if q == 15: - print('连接失败,请检查网络设置!') - exit() - - for item in items[1:]: - if item[-1] == '/': - if depth is None or depth > 0: - subdirectory, subfiles, count = list_files(webdav_url + item, username, password, depth=None if depth is None else depth - 1, path=path+item, count=count) - directory += [item + subitem for subitem in subdirectory] - files += [item + subitem for subitem in subfiles] + +def list_files(username: str, password: str, urls_queue:queue.Queue, files_queue:queue.Queue): + while not urls_queue.empty(): + url = urls_queue.get() + print(f"{threading.current_thread().name}——正在处理:{url},剩余{urls_queue.qsize()}个URL待处理") + options = { + "webdav_hostname": url, + "webdav_login": username, + "webdav_password": password + } + client = Client(options) + + try_number = 1 + try_max = 15 + + while try_number < try_max: + try: + items = client.list() + except Exception as e: + print(f"{threading.current_thread().name}遇到错误,第{try_number}尝试失败;错误信息:{str(e)},传入URL:{url},") + time.sleep(try_number) + try_number += 1 else: - directory.append(item) - else: - files.append(item) - count += 1 - if show_path and path: - print(f'当前文件夹路径:{path}') - return directory, files, count - -''' -下载函数 -用于'ASS', 'SRT', 'SSA','NFO','JPG', 'PNG'文件的下载 -''' -def download_file(url, local_path, filename, total_count): - p = 1 - while p < 10: + if try_number > 1: + print(f"{url}重连成功") + break + for item in items[1:]: + if item.endswith("/"): + urls_queue.put(url + item) + else: + files_queue.put(url + item) + print(f"{threading.current_thread().name}处理完毕") + +def strm_file(url: str, output_path: str, filename: str): + strm_filename = filename.rsplit(".", 1)[0] + ".strm" + local_path = os.path.join(output_path, strm_filename) + if not os.path.exists(local_path): + try: + print(f"正在下载:{filename}") + os.makedirs(os.path.dirname(local_path), exist_ok=True) + with open(local_path, "wb") as file: + file.write((url.replace("/dav", "/d") + filename).encode()) + print(f"{filename}处理成功") + except Exception as e: + print(f"{filename}处理失败,错误信息:{str(e)}") + else: + print(f"{filename}已存在,跳过处理") + +def download_file(url:str, output_path:str, filename:str): + local_path = os.path.join(output_path, filename) + if not os.path.exists(local_path): try: - print('正在下载:' + filename) - r = requests.get(url.replace('/dav', '/d'), proxies=proxies) + print(f"正在下载:{filename}") os.makedirs(os.path.dirname(local_path), exist_ok=True) - with open(local_path, 'wb') as f: - f.write(r.content) - f.close() - except: - print(f'第{p}次下载失败,{p + 1}秒后重试...') - p += 1 - time.sleep(p) + response = requests.get(url.replace("/dav", "/d") + filename) + with open(local_path, "wb") as file: + file.write(response.content) + except Exception as e: + print(f"{filename}下载失败,错误信息:{str(e)}") + else: + print(f"{filename}已存在,跳过下载") + +def processing_file(output_path:str, url_base:str, files_queue:queue.Queue, subtitle:bool, img:bool, nfo:bool): + video_format = ["mp4", "mkv", "flv", "avi", "wmv", "ts", "rmvb", "webm"] + subtitle_format = ["ass", "srt", "ssa", "sub"] + img_format = ["png", "jpg"] + + waite_number = 0 + waite_max = 10 + waite_time = 5 + + while waite_number < waite_max: + if not files_queue.empty(): + file_url = files_queue.get() + print(f"{threading.current_thread().name}——正在处理:{file_url},剩余{files_queue.qsize()}个文件待处理") + filename = file_url.replace(url_base, "") + if filename.lower().endswith(tuple(video_format)): + strm_file(url_base, output_path, filename) + elif filename.lower().endswith(tuple(subtitle_format)) & subtitle: + download_file(url_base, output_path, filename) + elif filename.lower().endswith(tuple(img_format)) & img: + download_file(url_base, output_path, filename) + elif filename.lower().endswith("nfo") & nfo: + download_file(url_base, output_path, filename) else: - if p > 1: - print('重新下载成功!') - print(filename + '下载成功!') - break - progress = int((p / 10) * 100) - print(f'已完成 {progress}%,共 {total_count} 个文件') - - -if __name__ == '__main__': - parser = argparse.ArgumentParser(description='Autofilm script') - parser.add_argument('--webdav_url', type=str, help='WebDAV服务器地址', required=True) - parser.add_argument('--username', type=str, help='WebDAV账号', required=True) - parser.add_argument('--password', type=str, help='WebDAV密码', required=True) - parser.add_argument('--output_path', type=str, help='输出文件目录', default='./Media/') - parser.add_argument('--subtitle', type=str, help='是否下载字幕文件', choices=['true', 'false'], default='true') - parser.add_argument('--nfo', type=str, help='是否下载NFO文件', choices=['true', 'false'], default='false') - parser.add_argument('--img', type=str, help='是否下载JPG和PNG文件', choices=['true', 'false'], default='false') - parser.add_argument('--show_path', type=str, help='遍历时是否显示文件夹路径', choices=['true', 'false'], default='false') - parser.add_argument('--proxy', type=str, help='HTTP代理服务器,格式为IP:端口号') - args = parser.parse_args() - - print(f"当前的APP版本是:{APP_VERSION}") - - print('启动参数:') - print(f'Webdav服务器地址:{args.webdav_url}') - print(f'Webdav登入用户名:{args.username}') - print(f'Webdav登入密码:{args.password}') - print(f'文件输出路径:{args.output_path}') - print(f'是否下载字幕:{args.subtitle}') - print(f'是否下载电影信息:{args.nfo}') - print(f'是否下载图片:{args.img}') - print(f'遍历时是否显示文件夹路径:{args.show_path}') - - proxies = None - if args.proxy: - proxies = { - 'http': f'http://{args.proxy}', - 'https': f'http://{args.proxy}' - } - - directory, files, count = list_files(args.webdav_url, args.username, args.password, args.show_path, depth=None, path='', count=0, proxies=proxies) - - urls = [args.webdav_url + item for item in directory + files] - - download_count = 0 - - for url in urls: - if url[-1] == '/': - continue - filename = os.path.basename(url) - local_path = os.path.join(args.output_path, url.replace(args.webdav_url, '').lstrip('/')) - file_ext = filename[-3:].upper() - - valid_extensions = ['mp4', 'mkv', 'flv', 'avi', 'wmv', 'ts', 'rmvb', 'webm'] - if filename.lower().endswith(tuple(valid_extensions)): - new_filename = filename.rsplit('.', 1)[0] + '.strm' - if not os.path.exists(os.path.join(args.output_path, new_filename)): - print('正在处理:' + filename) - try: - os.makedirs(os.path.dirname(local_path), exist_ok=True) - with open(os.path.join(local_path.rsplit('.', 1)[0] + '.strm'), "w", encoding='utf-8') as f: - f.write(url.replace('/dav', '/d')) - except: - print(filename + '处理失败,文件名包含特殊符号,建议重命名!') - elif args.subtitle == 'true' and file_ext in ['ASS', 'SRT', 'SSA', 'SUB']: - if not os.path.exists(local_path): - download_file(url, local_path, filename, count) - download_count += 1 - elif args.nfo == 'true' and file_ext == 'NFO': - if not os.path.exists(local_path): - download_file(url, local_path, filename, count) - download_count += 1 - elif args.img == 'true' and file_ext in ['JPG', 'PNG']: - if not os.path.exists(local_path): - download_file(url, local_path, filename, count) - download_count += 1 - - progress = int((download_count / count) * 100) - print(f'已完成 {progress}%,共 {count} 个文件') - - print('处理完毕!') \ No newline at end of file + waite_number += 1 + print(f"files_queue列表为空,当前尝试次数:{waite_number},共尝试{waite_max}次,{waite_time}秒后重试") + time.sleep(waite_time) + print(f"{threading.current_thread().name}处理完毕") + +def main(config_path:str): + with open(config_path, "r", encoding="utf-8") as file: + config_data = yaml.safe_load(file) + output_path = config_data["setting"]["output_path"] + l_threads = config_data["setting"]["l_threads"] + p_threads = config_data["setting"]["p_threads"] + + print(f"{'='*65}\n输出目录:{output_path}\nlist_files线程数:{l_threads}\nprocessing_file线程数:{p_threads}\n{'='*65}") + subtitle = config_data["setting"]["subtitle"] + img = config_data["setting"]["img"] + nfo = config_data["setting"]["nfo"] + + webdav_data = config_data["webdav"] + print(f"一共读取到{len(webdav_data)}个Webdav配置") + + round = 1 + for key, value in webdav_data.items(): + print(f"开始生成{key}Webdav服务器的Strm文件\n剩余{(len(webdav_data) - round)}个Webdav服务器未进行") + url = value["url"] + username = value["username"] + password = value["password"] + + urls_queue = queue.Queue() + files_queue = queue.Queue() + urls_queue.put(url) + + list_files_interval = 10 + lp_interval = 10 + processing_file_interval = 10 + + for thread in range(l_threads): + print(f"list_files线程{thread}启动中") + t = threading.Thread(target=list_files, args=(username, password, urls_queue, files_queue), name=f"list_files线程{thread}") + t.start() + print(f"list_files线程{thread}已启动,{list_files_interval}秒后启动下一个线程") + time.sleep(list_files_interval) + + time.sleep(lp_interval) + + for thread in range(p_threads): + print(f"processing_file线程{thread}启动中") + t = threading.Thread(target=processing_file, args=(output_path, url, files_queue,subtitle, img, nfo), name=f"processing_file线程{thread}") + t.start() + print(f"processing_file线程{thread}已启动,{processing_file_interval}秒后启动下一个线程") + time.sleep(processing_file_interval) + + round += 1 \ No newline at end of file diff --git a/config/anime.config b/config/anime.config deleted file mode 100644 index 9855e6f..0000000 --- a/config/anime.config +++ /dev/null @@ -1,85 +0,0 @@ -# 动漫 -## 七米蓝 -[Default] -webdav_url = https://al.chirmyram.com/dav/ani/ -username = alist -password = alist -output_path = Media/动漫/ - -[A] -webdav_url = https://al.chirmyram.com/dav/ani/A/ - -[B] -webdav_url = https://al.chirmyram.com/dav/ani/B/ - -[C] -webdav_url = https://al.chirmyram.com/dav/ani/C/ - -[D] -webdav_url = https://al.chirmyram.com/dav/ani/D/ - -[E] -webdav_url = https://al.chirmyram.com/dav/ani/E/ - -[F] -webdav_url = https://al.chirmyram.com/dav/ani/F/ - -[G] -webdav_url = https://al.chirmyram.com/dav/ani/G/ - -[H] -webdav_url = https://al.chirmyram.com/dav/ani/H/ - -[I] -webdav_url = https://al.chirmyram.com/dav/ani/I/ - -[J] -webdav_url = https://al.chirmyram.com/dav/ani/J/ - -[K] -webdav_url = https://al.chirmyram.com/dav/ani/K/ - -[L] -webdav_url = https://al.chirmyram.com/dav/ani/L/ - -[M] -webdav_url = https://al.chirmyram.com/dav/ani/M/ - -[N] -webdav_url = https://al.chirmyram.com/dav/ani/N/ - -[O] -webdav_url = https://al.chirmyram.com/dav/ani/O/ - -[P] -webdav_url = https://al.chirmyram.com/dav/ani/P/ - -[Q] -webdav_url = https://al.chirmyram.com/dav/ani/Q/ - -[R] -webdav_url = https://al.chirmyram.com/dav/ani/R/ - -[S] -webdav_url = https://al.chirmyram.com/dav/ani/S/ - -[T] -webdav_url = https://al.chirmyram.com/dav/ani/T/ - -[U] -webdav_url = https://al.chirmyram.com/dav/ani/U/ - -[V] -webdav_url = https://al.chirmyram.com/dav/ani/V/ - -[W] -webdav_url = https://al.chirmyram.com/dav/ani/W/ - -[X] -webdav_url = https://al.chirmyram.com/dav/ani/X/ - -[Y] -webdav_url = https://al.chirmyram.com/dav/ani/Y/ - -[Z] -webdav_url = https://al.chirmyram.com/dav/ani/Z/ \ No newline at end of file diff --git a/config/config.yaml.example b/config/config.yaml.example new file mode 100644 index 0000000..83acb5f --- /dev/null +++ b/config/config.yaml.example @@ -0,0 +1,24 @@ +setting: + output_path: ./media/ # 输出路径 + l_threads: 3 # list_files线程数 + p_threads: 8 # processing_file线程数 + subtitle: True # 是否下载字幕 + img: False # 是否下载图片 + nfo: True # 是否下载视频信息文件 +webdav: + 动漫A: # 任意字符,用于标识Webdav服务器 + url: https://al.chirmyram.com/dav/ani/A/ # Webdav服务器URL + username: alist # Webdav账号 + password: alist # Webdav密码 + 动漫B: + url: https://al.chirmyram.com/dav/ani/B/ + username: alist + password: alist + 电影A: + url: https://al.chirmyram.com/dav/mov/电影/A + username: alist + password: alist + 我的Alist: + url: http://192.168.1.1:5244/dav/阿里云/ + username: admin + password: adminadmin \ No newline at end of file diff --git a/config/documentary.config b/config/documentary.config deleted file mode 100644 index fe603d1..0000000 --- a/config/documentary.config +++ /dev/null @@ -1,93 +0,0 @@ -# 纪录片 -## 七米蓝 -[Default] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/ -username = alist -password = alist -output_path = Meida/纪录片/BBC/ - -[BBC-A] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/A/ - -[BBC-B] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/B/ - -[BBC-C] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/C/ - -[BBC-D] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/D/ - -[BBC-E] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/E/ - -[BBC-F] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/F/ - -[BBC-G] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/G/ - -[BBC-H] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/H/ - -[BBC-I] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/I/ - -[BBC-J] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/J/ - -[BBC-K] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/K/ - -[BBC-L] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/L/ - -[BBC-M] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/M/ - -[BBC-N] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/N/ - -[BBC-O] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/O/ - -[BBC-P] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/P/ - -[BBC-Q] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/Q/ - -[BBC-R] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/R/ - -[BBC-S] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/S/ - -[BBC-T] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/T/ - -[BBC-U] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/U/ - -[BBC-V] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/V/ - -[BBC-W] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/W/ - -[BBC-X] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/X/ - -[BBC-Y] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/Y/ - -[BBC-Z] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/BBC/Z/ - -[国产] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/国产/ -output_path = Meida/纪录片/国产/ - -[其他] -webdav_url = https://al.chirmyram.com/dav/mov/纪录片/其他/ -output_path = Meida/纪录片/其他/ \ No newline at end of file diff --git a/config/movie.config b/config/movie.config deleted file mode 100644 index 8ea4f72..0000000 --- a/config/movie.config +++ /dev/null @@ -1,89 +0,0 @@ -# 电影 -## 七米蓝 -[Default] -webdav_url = https://al.chirmyram.com/dav/mov/电影/ -username = alist -password = alist -output_path = Mdiad/电影/ - -[A] -webdav_url = https://al.chirmyram.com/dav/mov/电影/A/ - -[B] -webdav_url = https://al.chirmyram.com/dav/mov/电影/B/ - -[C] -webdav_url = https://al.chirmyram.com/dav/mov/电影/C/ - -[D] -webdav_url = https://al.chirmyram.com/dav/mov/电影/D/ - -[E] -webdav_url = https://al.chirmyram.com/dav/mov/电影/E/ - -[F] -webdav_url = https://al.chirmyram.com/dav/mov/电影/F/ - -[G] -webdav_url = https://al.chirmyram.com/dav/mov/电影/G/ - -[H] -webdav_url = https://al.chirmyram.com/dav/mov/电影/H/ - -[I] -webdav_url = https://al.chirmyram.com/dav/mov/电影/I/ - -[J] -webdav_url = https://al.chirmyram.com/dav/mov/电影/J/ - -[K] -webdav_url = https://al.chirmyram.com/dav/mov/电影/K/ - -[L] -webdav_url = https://al.chirmyram.com/dav/mov/电影/L/ - -[M] -webdav_url = https://al.chirmyram.com/dav/mov/电影/M/ - -[N] -webdav_url = https://al.chirmyram.com/dav/mov/电影/N/ - -[O] -webdav_url = https://al.chirmyram.com/dav/mov/电影/O/ - -[P] -webdav_url = https://al.chirmyram.com/dav/mov/电影/P/ - -[Q] -webdav_url = https://al.chirmyram.com/dav/mov/电影/Q/ - -[R] -webdav_url = https://al.chirmyram.com/dav/mov/电影/R/ - -[S] -webdav_url = https://al.chirmyram.com/dav/mov/电影/S/ - -[T] -webdav_url = https://al.chirmyram.com/dav/mov/电影/T/ - -[U] -webdav_url = https://al.chirmyram.com/dav/mov/电影/U/ - -[V] -webdav_url = https://al.chirmyram.com/dav/mov/电影/V/ - -[W] -webdav_url = https://al.chirmyram.com/dav/mov/电影/W/ - -[X] -webdav_url = https://al.chirmyram.com/dav/mov/电影/X/ - -[Y] -webdav_url = https://al.chirmyram.com/dav/mov/电影/Y/ - -[Z] -webdav_url = https://al.chirmyram.com/dav/mov/电影/Z/ - -[合集] -webdav_url = https://al.chirmyram.com/dav/mov/电影/合集/ -output_path = AutoFilm/电影/合集/ \ No newline at end of file diff --git a/config/tv.config b/config/tv.config deleted file mode 100644 index 1fd9efd..0000000 --- a/config/tv.config +++ /dev/null @@ -1,13 +0,0 @@ -# 电视剧 -## 七米蓝 -[Default] -webdav_url = https://al.chirmyram.com/dav/tlv1/ -username = alist -password = alist -output_path = Meida/电视剧/ - -[tlv1] -webdav_url = https://al.chirmyram.com/dav/tlv1/ - -[tlv2] -webdav_url = https://al.chirmyram.com/dav/tlv2/ diff --git a/main.py b/main.py new file mode 100644 index 0000000..3118b20 --- /dev/null +++ b/main.py @@ -0,0 +1,20 @@ +import argparse +import time + +import autofilm +from version import APP_VERSION + + +if __name__ == '__main__': + + parser = argparse.ArgumentParser(description='Autofilm参数配置') + parser.add_argument('--config_path', type=str, help='配置文件路径', default='./config/config.yaml') + args = parser.parse_args() + + print(f"当前的APP版本是:{APP_VERSION}") + print(f'配置文件路径:{args.config_path}') + + autofilm.main(args.config_path) + + print("10秒后程序自动退出") + time.sleep(10) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c24cf09 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +webdavclient3 == 3.14.6 +requests == 2.31.0 +PyYAML == 6.0.1 \ No newline at end of file diff --git a/version.py b/version.py index ea0a26b..401c7b2 100644 --- a/version.py +++ b/version.py @@ -1 +1 @@ -APP_VERSION = 'v0.1.1' \ No newline at end of file +APP_VERSION = 'v1.0.0' \ No newline at end of file