diff --git a/README.md b/README.md index 38d2125..59c9619 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,8 @@ API에선 직접 비트레이트를 설정할 수 있습니다. 물론 해당 정보가 없으면 null입니다. ## Changelog +v1.6.6 + v1.6.5 * info_dict API가 동작하지 않는 문제 수정 diff --git a/info.json b/info.json index c6d4f37..1c4dbad 100644 --- a/info.json +++ b/info.json @@ -1 +1 @@ -{"description": "\uc720\ud29c\ube0c, \ub124\uc774\ubc84TV \ub4f1 \ub3d9\uc601\uc0c1 \uc0ac\uc774\ud2b8\uc5d0\uc11c \ub3d9\uc601\uc0c1 \ub2e4\uc6b4\ub85c\ub4dc", "name": "youtube-dl", "more": "", "version": "1.6.5", "home": "https://github.com/joyfuI/youtube-dl", "category_name": "vod", "developer": "joyfuI"} \ No newline at end of file +{"description": "\uc720\ud29c\ube0c, \ub124\uc774\ubc84TV \ub4f1 \ub3d9\uc601\uc0c1 \uc0ac\uc774\ud2b8\uc5d0\uc11c \ub3d9\uc601\uc0c1 \ub2e4\uc6b4\ub85c\ub4dc", "name": "youtube-dl", "more": "", "version": "1.6.6", "home": "https://github.com/joyfuI/youtube-dl", "category_name": "vod", "developer": "joyfuI"} \ No newline at end of file diff --git a/logic.py b/logic.py index 2143b9d..c5153fe 100644 --- a/logic.py +++ b/logic.py @@ -21,10 +21,10 @@ from .model import ModelSetting class Logic(object): db_default = { 'db_version': '1', - 'ffmpeg_path': 'ffmpeg' if platform.system() != 'Windows' else os.path.join(path_app_root, 'bin', 'Windows', 'ffmpeg.exe'), + 'ffmpeg_path': '' if platform.system() != 'Windows' else os.path.join(path_app_root, 'bin', 'Windows', 'ffmpeg.exe'), 'temp_path': os.path.join(path_data, 'download_tmp'), 'save_path': os.path.join(path_data, 'download'), - 'default_filename': '%(title)s-%(id)s.%(ext)s', + 'default_filename': '', 'proxy': '', 'activate_cors': False } diff --git a/logic_normal.py b/logic_normal.py index 5c46b91..e70b8d1 100644 --- a/logic_normal.py +++ b/logic_normal.py @@ -19,6 +19,10 @@ class LogicNormal(object): def get_youtube_dl_version(): return MyYoutubeDL.get_version() + @staticmethod + def get_default_filename(): + return MyYoutubeDL.DEFAULT_FILENAME + @staticmethod def get_preset_list(): return [ diff --git a/my_youtube_dl.py b/my_youtube_dl.py index 61e1119..25766ef 100644 --- a/my_youtube_dl.py +++ b/my_youtube_dl.py @@ -40,6 +40,8 @@ class Status(Enum): class MyYoutubeDL(object): + DEFAULT_FILENAME = '%(title)s-%(id)s.%(ext)s' + __index = 0 _last_msg = '' diff --git a/plugin.py b/plugin.py index abb3a5a..e273dc1 100644 --- a/plugin.py +++ b/plugin.py @@ -34,7 +34,7 @@ menu = { } plugin_info = { - 'version': '1.6.5', + 'version': '1.6.6', 'name': 'youtube-dl', 'category_name': 'vod', 'developer': 'joyfuI', @@ -68,10 +68,12 @@ def first_menu(sub): if sub == 'setting': arg.update(ModelSetting.to_dict()) arg['youtube_dl_version'] = LogicNormal.get_youtube_dl_version() + arg['DEFAULT_FILENAME'] = LogicNormal.get_default_filename() return render_template('%s_%s.html' % (package_name, sub), arg=arg) elif sub == 'download': - arg['file_name'] = ModelSetting.get('default_filename') + default_filename = ModelSetting.get('default_filename') + arg['file_name'] = default_filename if default_filename else LogicNormal.get_default_filename() arg['preset_list'] = LogicNormal.get_preset_list() arg['postprocessor_list'] = LogicNormal.get_postprocessor_list() return render_template('%s_%s.html' % (package_name, sub), arg=arg) @@ -97,6 +99,8 @@ def ajax(sub): # 공통 요청 if sub == 'setting_save': ret = ModelSetting.setting_save(request) + if request.form['ffmpeg_path'] == 'ffmpeg': + ModelSetting.set('ffmpeg_path', '') return jsonify(ret) # UI 요청 @@ -198,6 +202,8 @@ def api(sub): return LogicNormal.abort(ret, 2) # 잘못된 동영상 주소 if preferredcodec not in (None, 'best', 'mp3', 'aac', 'flac', 'm4a', 'opus', 'vorbis', 'wav'): return LogicNormal.abort(ret, 5) # 허용되지 않은 값이 있음 + if filename: + filename = LogicNormal.get_default_filename() youtube_dl = LogicNormal.download(plugin=plugin, url=url, filename=filename, diff --git a/templates/youtube-dl_download.html b/templates/youtube-dl_download.html index 2d7fa9c..e1b94a7 100644 --- a/templates/youtube-dl_download.html +++ b/templates/youtube-dl_download.html @@ -1,3 +1,5 @@ +{% extends "base.html" %} + {% macro setting_select2(id, title, options, col='9', desc=None, value=None) %} {{ macros.setting_top(title) }}