diff --git a/README.md b/README.md index f69a9b2..8e0d029 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,8 @@ API에선 직접 비트레이트를 설정할 수 있습니다. 물론 해당 정보가 없으면 null입니다. ## Changelog +v1.3.1 + v1.3.0 * 후처리 기능 추가 이제 비디오 변환이나 오디오 추출이 가능합니다. diff --git a/info.json b/info.json index 570cf32..3c13535 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.3.0", "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.3.1", "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 a39bbdf..0520662 100644 --- a/logic.py +++ b/logic.py @@ -111,28 +111,24 @@ class Logic(object): @staticmethod def get_postprocessor_list(): postprocessor_list = [ - ['', '후처리 안함'], - ['_optgroup', '비디오 변환'], - ['mp4', 'MP4'], - ['flv', 'FLV'], - ['webm', 'WebM'], - ['ogg', 'Ogg'], - ['mkv', 'MKV'], - ['ts', 'TS'], - ['avi', 'AVI'], - ['wmv', 'WMV'], - ['mov', 'MOV'], - ['gif', 'GIF'], - ['_optgroup', ''], - ['_optgroup', '오디오 추출'], - ['mp3', 'MP3'], - ['aac', 'AAC'], - ['flac', 'FLAC'], - ['m4a', 'M4A'], - ['opus', 'Opus'], - ['vorbis', 'Vorbis'], - ['wav', 'WAV'], - ['_optgroup', ''] + ['', '후처리 안함', None], + ['mp4', 'MP4', '비디오 변환'], + ['flv', 'FLV', '비디오 변환'], + ['webm', 'WebM', '비디오 변환'], + ['ogg', 'Ogg', '비디오 변환'], + ['mkv', 'MKV', '비디오 변환'], + ['ts', 'TS', '비디오 변환'], + ['avi', 'AVI', '비디오 변환'], + ['wmv', 'WMV', '비디오 변환'], + ['mov', 'MOV', '비디오 변환'], + ['gif', 'GIF', '비디오 변환'], + ['mp3', 'MP3', '오디오 추출'], + ['aac', 'AAC', '오디오 추출'], + ['flac', 'FLAC', '오디오 추출'], + ['m4a', 'M4A', '오디오 추출'], + ['opus', 'Opus', '오디오 추출'], + ['vorbis', 'Vorbis', '오디오 추출'], + ['wav', 'WAV', '오디오 추출'] ] return postprocessor_list @@ -140,16 +136,10 @@ class Logic(object): def get_postprocessor(): video_convertor = [] extract_audio = [] - optgroup = None for i in Logic.get_postprocessor_list(): - if i[0] == '_optgroup': - if i[1] != '': # optgroup 태그 열기 - optgroup = i[1] - else: # optgroup 태그 닫기 - optgroup = None - elif optgroup == '비디오 변환': + if i[2] == '비디오 변환': video_convertor.append(i[0]) - elif optgroup == '오디오 추출': + elif i[2] == '오디오 추출': extract_audio.append(i[0]) return video_convertor, extract_audio diff --git a/plugin.py b/plugin.py index 3424ab2..dd89be7 100644 --- a/plugin.py +++ b/plugin.py @@ -36,7 +36,7 @@ menu = { } plugin_info = { - 'version': '1.3.0', + 'version': '1.3.1', 'name': 'youtube-dl', 'category_name': 'vod', 'developer': 'joyfuI', diff --git a/templates/youtube-dl_download.html b/templates/youtube-dl_download.html index 1e68430..42d3a7d 100644 --- a/templates/youtube-dl_download.html +++ b/templates/youtube-dl_download.html @@ -1,3 +1,32 @@ +{% macro setting_select2(id, title, options, col='9', desc=None, value=None) %} + {{ macros.setting_top(title) }} +
+ +
+ {{ macros.setting_bottom(desc) }} +{% endmacro %} + {% extends "base.html" %} {% block content %} @@ -6,7 +35,7 @@ {{ macros.setting_input_text('filename', '파일명', value=arg['file_name'], desc='템플릿 규칙은 https://github.com/ytdl-org/youtube-dl/blob/master/README.md#output-template 참고') }} {{ macros.setting_select('preset', '동영상 포맷 프리셋', arg['preset_list'], col='3') }} {{ macros.setting_input_text('format', '동영상 포맷', desc=['포맷 지정은 https://github.com/ytdl-org/youtube-dl/blob/master/README.md#format-selection 참고', '빈칸으로 두면 최고 화질로 다운로드합니다.']) }} - {{ macros.setting_select('postprocessor', '후처리', arg['postprocessor_list'], col='3', desc='다운로드 후 FFmpeg로 후처리합니다.') }} + {{ setting_select2('postprocessor', '후처리', arg['postprocessor_list'], col='3', desc='다운로드 후 FFmpeg로 후처리합니다.') }} {{ macros.setting_button([['download_start', '다운로드']]) }} @@ -15,23 +44,6 @@ var package_name = '{{ arg["package_name"] }}'; $(function () { - // 후처리 목록 - var optgroup = null; - $('#postprocessor > option').map(function () { - var i = $(this); - if (i.val() === '_optgroup') { - if (i.text() !== '') { // optgroup 태그 열기 - optgroup = $(''); - i.before(optgroup).remove(); - } else { // optgroup 태그 닫기 - optgroup = null; - i.remove(); - } - } else if (optgroup !== null) { // optgroup 태그로 이동 - optgroup.append(i); - } - }); - // 프리셋 변경 $('#preset').change(function (e) { if ($(this).val() === '_custom') {