From 1101dad3939853936325788a9a920f6ee0c4f0e4 Mon Sep 17 00:00:00 2001 From: joyfuI Date: Fri, 14 Feb 2020 01:15:44 +0900 Subject: [PATCH] v1.2.1 --- README.md | 12 +++++++++--- info.json | 2 +- plugin.py | 12 ++++++++---- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d735c29..afaf89f 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ SJVA에서 "시스템 → 플러그인 → 플러그인 수동 설치" 칸에 `url` | 동영상 주소 | O | String `filename` | 파일명. 템플릿 규칙은 https://github.com/ytdl-org/youtube-dl/blob/master/README.md#output-template 참고 | O | String `temp_path` | 임시 폴더 경로 | O | String -`save_path` | 저장 폴더 경로 | O | String +`save_path` | 저장 폴더 경로 | O | String `format_code` | 동영상 포맷. 포맷 지정은 https://github.com/ytdl-org/youtube-dl/blob/master/README.md#format-selection 참고. 지정하지 않으면 최고 화질로 다운로드됨 | X | String `start` | 다운로드 준비 후 바로 다운로드를 시작할지 여부. 기본값: false | X | Boolean #### Response @@ -114,10 +114,16 @@ SJVA에서 "시스템 → 플러그인 → 플러그인 수동 설치" 칸에 --- | --- | --- `errorCode` | 에러 코드 | Integer `status` | 요청을 받았을 당시의 상태 | Status -`start_time` | 다운로드 시작 시간 | Boolean -`end_time` | 다운로드 종료 시간 | Status or null +`start_time` | 다운로드 시작 시간 | String +`end_time` | 다운로드 종료 시간 | String +`temp_path` | 임시 폴더 경로 | String +`save_path` | 저장 폴더 경로 | String +`start_time` 키와 `end_time` 키에 들어있는 시간은 "년 월 일 시 분 초" 형식으로 공백으로 분리된 숫자들이 모여있는 문자열입니다. +물론 해당 정보가 없으면 null입니다. ## Changelog +v1.2.1 + v1.2.0 * API 추가 이제 다른 플러그인에서 동영상 정보 가져오기, 다운로드 요청이 가능합니다. diff --git a/info.json b/info.json index f224e8d..245d003 100644 --- a/info.json +++ b/info.json @@ -1 +1 @@ -{"more": "", "version": "1.2.0", "name": "youtube-dl", "developer": "joyfuI", "home": "https://github.com/joyfuI/youtube-dl", "description": "\uc720\ud29c\ube0c, \ub124\uc774\ubc84TV \ub4f1 \ub3d9\uc601\uc0c1 \uc0ac\uc774\ud2b8\uc5d0\uc11c \ub3d9\uc601\uc0c1 \ub2e4\uc6b4\ub85c\ub4dc", "icon": "", "category_name": "vod"} \ No newline at end of file +{"more": "", "version": "1.2.1", "name": "youtube-dl", "developer": "joyfuI", "home": "https://github.com/joyfuI/youtube-dl", "description": "\uc720\ud29c\ube0c, \ub124\uc774\ubc84TV \ub4f1 \ub3d9\uc601\uc0c1 \uc0ac\uc774\ud2b8\uc5d0\uc11c \ub3d9\uc601\uc0c1 \ub2e4\uc6b4\ub85c\ub4dc", "icon": "", "category_name": "vod"} \ No newline at end of file diff --git a/plugin.py b/plugin.py index 0abf30f..3f36010 100644 --- a/plugin.py +++ b/plugin.py @@ -33,7 +33,7 @@ def plugin_unload(): Logic.plugin_unload() plugin_info = { - 'version': '1.2.0', + 'version': '1.2.1', 'name': 'youtube-dl', 'category_name': 'vod', 'icon': '', @@ -231,7 +231,9 @@ def api(sub): 'errorCode': 0, 'status': None, 'start_time': None, - 'end_time': None + 'end_time': None, + 'temp_path': None, + 'save_path': None } if None in (index, key): return Logic.abort(ret, 1) # 필수 요청 변수가 없음 @@ -242,8 +244,10 @@ def api(sub): if youtube_dl._key != key: return Logic.abort(ret, 4) # 키가 일치하지 않음 ret['status'] = youtube_dl.status.name - ret['start_time'] = youtube_dl.start_time - ret['end_time'] = youtube_dl.end_time + ret['start_time'] = youtube_dl.start_time.strftime('%Y %m %d %H %M %S') if youtube_dl.start_time is not None else None + ret['end_time'] = youtube_dl.end_time.strftime('%Y %m %d %H %M %S') if youtube_dl.end_time is not None else None + ret['temp_path'] = youtube_dl.temp_path + ret['save_path'] = youtube_dl.save_path return jsonify(ret) except Exception as e: logger.error('Exception:%s', e)