This commit is contained in:
joyfuI
2020-02-14 01:15:44 +09:00
parent 40ce3ece03
commit 1101dad393
3 changed files with 18 additions and 8 deletions

View File

@@ -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 추가
이제 다른 플러그인에서 동영상 정보 가져오기, 다운로드 요청이 가능합니다.

View File

@@ -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"}
{"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"}

View File

@@ -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)