v1.2.5 기본 파일명 설정 추가
기본 파일명 설정 추가 API에서 일부 키를 선택으로 변경
This commit is contained in:
12
README.md
12
README.md
@@ -63,10 +63,10 @@ SJVA에서 "시스템 → 플러그인 → 플러그인 수동 설치" 칸에
|
||||
`plugin` | 플러그인 이름 | O | String
|
||||
`key` | 임의의 키. 이후 다운로드를 제어할 때 이 키가 필요함 | O | String
|
||||
`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
|
||||
`format_code` | 동영상 포맷. 포맷 지정은 https://github.com/ytdl-org/youtube-dl/blob/master/README.md#format-selection 참고. 지정하지 않으면 최고 화질로 다운로드됨 | X | 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
|
||||
`start` | 다운로드 준비 후 바로 다운로드를 시작할지 여부. 기본값: false | X | Boolean
|
||||
#### Response
|
||||
키 | 설명 | 타입
|
||||
@@ -124,6 +124,10 @@ SJVA에서 "시스템 → 플러그인 → 플러그인 수동 설치" 칸에
|
||||
물론 해당 정보가 없으면 null입니다.
|
||||
|
||||
## Changelog
|
||||
v1.2.5
|
||||
* 기본 파일명 설정 추가
|
||||
* API에서 일부 키를 선택으로 변경
|
||||
|
||||
v1.2.4
|
||||
* API Key 기능 추가
|
||||
|
||||
|
||||
@@ -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.2.4", "home": "https://github.com/joyfuI/youtube-dl", "category_name": "vod", "developer": "joyfuI"}
|
||||
{"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.2.5", "home": "https://github.com/joyfuI/youtube-dl", "category_name": "vod", "developer": "joyfuI"}
|
||||
3
logic.py
3
logic.py
@@ -24,7 +24,8 @@ from .my_youtube_dl import Status
|
||||
class Logic(object):
|
||||
db_default = {
|
||||
'temp_path': os.path.join(path_data, 'download_tmp'),
|
||||
'save_path': os.path.join(path_data, 'download')
|
||||
'save_path': os.path.join(path_data, 'download'),
|
||||
'default_filename': '%(title)s-%(id)s.%(ext)s'
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
|
||||
12
plugin.py
12
plugin.py
@@ -36,7 +36,7 @@ menu = {
|
||||
}
|
||||
|
||||
plugin_info = {
|
||||
'version': '1.2.4',
|
||||
'version': '1.2.5',
|
||||
'name': 'youtube-dl',
|
||||
'category_name': 'vod',
|
||||
'developer': 'joyfuI',
|
||||
@@ -71,7 +71,7 @@ def detail(sub):
|
||||
return render_template('%s_setting.html' % package_name, arg=arg)
|
||||
|
||||
elif sub == 'download':
|
||||
arg['file_name'] = '%(title)s-%(id)s.%(ext)s'
|
||||
arg['file_name'] = Logic.get_setting_value('default_filename')
|
||||
arg['preset_list'] = Logic.get_preset_list()
|
||||
return render_template('%s_download.html' % package_name, arg=arg)
|
||||
|
||||
@@ -157,16 +157,16 @@ def api(sub):
|
||||
elif sub == 'download':
|
||||
key = request.form.get('key')
|
||||
url = request.form.get('url')
|
||||
filename = request.form.get('filename')
|
||||
temp_path = request.form.get('temp_path')
|
||||
save_path = request.form.get('save_path')
|
||||
filename = request.form.get('filename', Logic.get_setting_value('default_filename'))
|
||||
temp_path = request.form.get('temp_path', Logic.get_setting_value('temp_path'))
|
||||
save_path = request.form.get('save_path', Logic.get_setting_value('save_path'))
|
||||
format_code = request.form.get('format_code', None)
|
||||
start = request.form.get('start', False)
|
||||
ret = {
|
||||
'errorCode': 0,
|
||||
'index': None
|
||||
}
|
||||
if None in (key, url, filename, temp_path, save_path):
|
||||
if None in (key, url):
|
||||
return Logic.abort(ret, 1) # 필수 요청 변수가 없음
|
||||
if not url.startswith('http'):
|
||||
return Logic.abort(ret, 2) # 잘못된 동영상 주소
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<form id="setting">
|
||||
{{ macros.setting_input_text('temp_path', '임시 폴더', value=arg['temp_path'], placeholder='임시 폴더 경로', desc='다운로드 파일이 임시로 저장될 폴더 입니다.') }}
|
||||
{{ macros.setting_input_text('save_path', '저장 폴더', value=arg['save_path'], placeholder='저장 폴더 경로', desc='정상적으로 완료된 파일이 이동할 폴더 입니다.') }}
|
||||
{{ macros.setting_input_text('default_filename', '기본 파일명', value=arg['default_filename'], placeholder='저장 폴더 경로', desc=['템플릿 규칙은 https://github.com/ytdl-org/youtube-dl/blob/master/README.md#output-template 참고', '기본값은 "%(title)s-%(id)s.%(ext)s"입니다.']) }}
|
||||
{{ macros.setting_button([['setting_save', '저장']]) }}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user