From 5d43fdffe2e279ee6c32777de89651361a51750a Mon Sep 17 00:00:00 2001 From: joyfuI Date: Mon, 29 Jun 2020 21:03:41 +0900 Subject: [PATCH] =?UTF-8?q?v1.6.0=20API=EC=97=90=20format=5Fcode=EB=A5=BC?= =?UTF-8?q?=20format=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API에 format_code를 format로 변경 API에 temp_path 삭제 --- README.md | 7 +++++-- info.json | 2 +- plugin.py | 22 ++++++++++++++-------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index cc94f47..fb6ae5b 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,8 @@ API에선 직접 비트레이트를 설정할 수 있습니다. `key` | 임의의 키. 이후 다운로드를 제어할 때 이 키가 필요함 | O | String `url` | 동영상 주소 | O | String `filename` | 파일명. 템플릿 규칙은 https://github.com/ytdl-org/youtube-dl/blob/master/README.md#output-template 참고. 미지정 시 사용자 설정 | X | String -`temp_path` | 임시 폴더 경로. 미지정 시 사용자 설정 | X | String `save_path` | 저장 폴더 경로. 미지정 시 사용자 설정 | X | String -`format_code` | 동영상 포맷. 포맷 지정은 https://github.com/ytdl-org/youtube-dl/blob/master/README.md#format-selection 참고. 미지정 시 최고 화질 | X | String +`format` | 동영상 포맷. 포맷 지정은 https://github.com/ytdl-org/youtube-dl/blob/master/README.md#format-selection 참고. 미지정 시 최고 화질 | X | String `preferedformat` | 변환할 비디오 포맷. 가능한 포맷은 https://ffmpeg.org/general.html#File-Formats 참고. 미지정 시 변환하지 않음 | X | String `preferredcodec` | 추출할 오디오 코덱. 가능한 값은 `"best"`, `"mp3"`, `"aac"`, `"flac"`, `"m4a"`, `"opus"`, `"vorbis"`, `"wav"`. 미지정 시 추출하지 않음 | X | String `preferredquality` | 추출한 오디오의 비트레이트. 0 ~ 9 사이의 VBR 퀄리티 값(0에 가까울수록 좋음) 혹은 특정 비트레이트 값. `preferredcodec` 키가 있을 때만 유효. 기본값: `192` | X | Integer @@ -132,6 +131,10 @@ API에선 직접 비트레이트를 설정할 수 있습니다. 물론 해당 정보가 없으면 null입니다. ## Changelog +v1.6.0 +* API에 format_code를 format로 변경 +* API에 temp_path 삭제 + v1.5.1 v1.5.0 diff --git a/info.json b/info.json index b7973ba..480948b 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.5.1", "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.0", "home": "https://github.com/joyfuI/youtube-dl", "category_name": "vod", "developer": "joyfuI"} \ No newline at end of file diff --git a/plugin.py b/plugin.py index ea501aa..c06c8be 100644 --- a/plugin.py +++ b/plugin.py @@ -34,7 +34,7 @@ menu = { } plugin_info = { - 'version': '1.5.1', + 'version': '1.6.0', 'name': 'youtube-dl', 'category_name': 'vod', 'developer': 'joyfuI', @@ -105,7 +105,7 @@ def ajax(sub): filename = request.form['filename'] temp_path = ModelSetting.get('temp_path') save_path = ModelSetting.get('save_path') - format_code = request.form['format'] if request.form['format'] else None + format = request.form['format'] if request.form['format'] else None postprocessor = request.form['postprocessor'] if request.form['postprocessor'] else None video_convertor, extract_audio = LogicNormal.get_postprocessor() if postprocessor in video_convertor: @@ -120,7 +120,7 @@ def ajax(sub): 'preferredquality': '192' }] opts = { - 'format': format_code, + 'format': format, 'postprocessors': postprocessor, 'proxy': ModelSetting.get('proxy') } @@ -180,9 +180,8 @@ def api(sub): key = request.form.get('key') url = request.form.get('url') filename = request.form.get('filename', ModelSetting.get('default_filename')) - temp_path = request.form.get('temp_path', ModelSetting.get('temp_path')) save_path = request.form.get('save_path', ModelSetting.get('save_path')) - format_code = request.form.get('format_code', None) + format = request.form.get('format', None) preferedformat = request.form.get('preferedformat', None) preferredcodec = request.form.get('preferredcodec', None) preferredquality = request.form.get('preferredquality', 192) @@ -211,12 +210,12 @@ def api(sub): 'preferredquality': str(preferredquality) }) opts = { - 'format': format_code, + 'format': format, 'postprocessors': postprocessor, 'proxy': ModelSetting.get('proxy'), 'download_archive': archive } - youtube_dl = Youtube_dl(plugin, url, filename, temp_path, save_path, opts) + youtube_dl = Youtube_dl(plugin, url, filename, ModelSetting.get('temp_path'), save_path, opts) youtube_dl.key = key LogicNormal.youtube_dl_list.append(youtube_dl) # 리스트 추가 ret['index'] = youtube_dl.index @@ -271,7 +270,14 @@ def api(sub): elif sub == 'status': index = request.form.get('index') key = request.form.get('key') - ret = {'errorCode': 0} + ret = { + 'errorCode': 0, + 'status': None, + 'start_time': None, + 'end_time': None, + 'temp_path': None, + 'save_path': None + } if None in (index, key): return LogicNormal.abort(ret, 1) # 필수 요청 변수가 없음 index = int(index)