v1.6.6
This commit is contained in:
@@ -131,6 +131,8 @@ API에선 직접 비트레이트를 설정할 수 있습니다.
|
|||||||
물론 해당 정보가 없으면 null입니다.
|
물론 해당 정보가 없으면 null입니다.
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
v1.6.6
|
||||||
|
|
||||||
v1.6.5
|
v1.6.5
|
||||||
* info_dict API가 동작하지 않는 문제 수정
|
* info_dict API가 동작하지 않는 문제 수정
|
||||||
|
|
||||||
|
|||||||
@@ -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.6.5", "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.6.6", "home": "https://github.com/joyfuI/youtube-dl", "category_name": "vod", "developer": "joyfuI"}
|
||||||
4
logic.py
4
logic.py
@@ -21,10 +21,10 @@ from .model import ModelSetting
|
|||||||
class Logic(object):
|
class Logic(object):
|
||||||
db_default = {
|
db_default = {
|
||||||
'db_version': '1',
|
'db_version': '1',
|
||||||
'ffmpeg_path': 'ffmpeg' if platform.system() != 'Windows' else os.path.join(path_app_root, 'bin', 'Windows', 'ffmpeg.exe'),
|
'ffmpeg_path': '' if platform.system() != 'Windows' else os.path.join(path_app_root, 'bin', 'Windows', 'ffmpeg.exe'),
|
||||||
'temp_path': os.path.join(path_data, 'download_tmp'),
|
'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',
|
'default_filename': '',
|
||||||
'proxy': '',
|
'proxy': '',
|
||||||
'activate_cors': False
|
'activate_cors': False
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ class LogicNormal(object):
|
|||||||
def get_youtube_dl_version():
|
def get_youtube_dl_version():
|
||||||
return MyYoutubeDL.get_version()
|
return MyYoutubeDL.get_version()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_default_filename():
|
||||||
|
return MyYoutubeDL.DEFAULT_FILENAME
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_preset_list():
|
def get_preset_list():
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ class Status(Enum):
|
|||||||
|
|
||||||
|
|
||||||
class MyYoutubeDL(object):
|
class MyYoutubeDL(object):
|
||||||
|
DEFAULT_FILENAME = '%(title)s-%(id)s.%(ext)s'
|
||||||
|
|
||||||
__index = 0
|
__index = 0
|
||||||
_last_msg = ''
|
_last_msg = ''
|
||||||
|
|
||||||
|
|||||||
10
plugin.py
10
plugin.py
@@ -34,7 +34,7 @@ menu = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugin_info = {
|
plugin_info = {
|
||||||
'version': '1.6.5',
|
'version': '1.6.6',
|
||||||
'name': 'youtube-dl',
|
'name': 'youtube-dl',
|
||||||
'category_name': 'vod',
|
'category_name': 'vod',
|
||||||
'developer': 'joyfuI',
|
'developer': 'joyfuI',
|
||||||
@@ -68,10 +68,12 @@ def first_menu(sub):
|
|||||||
if sub == 'setting':
|
if sub == 'setting':
|
||||||
arg.update(ModelSetting.to_dict())
|
arg.update(ModelSetting.to_dict())
|
||||||
arg['youtube_dl_version'] = LogicNormal.get_youtube_dl_version()
|
arg['youtube_dl_version'] = LogicNormal.get_youtube_dl_version()
|
||||||
|
arg['DEFAULT_FILENAME'] = LogicNormal.get_default_filename()
|
||||||
return render_template('%s_%s.html' % (package_name, sub), arg=arg)
|
return render_template('%s_%s.html' % (package_name, sub), arg=arg)
|
||||||
|
|
||||||
elif sub == 'download':
|
elif sub == 'download':
|
||||||
arg['file_name'] = ModelSetting.get('default_filename')
|
default_filename = ModelSetting.get('default_filename')
|
||||||
|
arg['file_name'] = default_filename if default_filename else LogicNormal.get_default_filename()
|
||||||
arg['preset_list'] = LogicNormal.get_preset_list()
|
arg['preset_list'] = LogicNormal.get_preset_list()
|
||||||
arg['postprocessor_list'] = LogicNormal.get_postprocessor_list()
|
arg['postprocessor_list'] = LogicNormal.get_postprocessor_list()
|
||||||
return render_template('%s_%s.html' % (package_name, sub), arg=arg)
|
return render_template('%s_%s.html' % (package_name, sub), arg=arg)
|
||||||
@@ -97,6 +99,8 @@ def ajax(sub):
|
|||||||
# 공통 요청
|
# 공통 요청
|
||||||
if sub == 'setting_save':
|
if sub == 'setting_save':
|
||||||
ret = ModelSetting.setting_save(request)
|
ret = ModelSetting.setting_save(request)
|
||||||
|
if request.form['ffmpeg_path'] == 'ffmpeg':
|
||||||
|
ModelSetting.set('ffmpeg_path', '')
|
||||||
return jsonify(ret)
|
return jsonify(ret)
|
||||||
|
|
||||||
# UI 요청
|
# UI 요청
|
||||||
@@ -198,6 +202,8 @@ def api(sub):
|
|||||||
return LogicNormal.abort(ret, 2) # 잘못된 동영상 주소
|
return LogicNormal.abort(ret, 2) # 잘못된 동영상 주소
|
||||||
if preferredcodec not in (None, 'best', 'mp3', 'aac', 'flac', 'm4a', 'opus', 'vorbis', 'wav'):
|
if preferredcodec not in (None, 'best', 'mp3', 'aac', 'flac', 'm4a', 'opus', 'vorbis', 'wav'):
|
||||||
return LogicNormal.abort(ret, 5) # 허용되지 않은 값이 있음
|
return LogicNormal.abort(ret, 5) # 허용되지 않은 값이 있음
|
||||||
|
if filename:
|
||||||
|
filename = LogicNormal.get_default_filename()
|
||||||
youtube_dl = LogicNormal.download(plugin=plugin,
|
youtube_dl = LogicNormal.download(plugin=plugin,
|
||||||
url=url,
|
url=url,
|
||||||
filename=filename,
|
filename=filename,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% macro setting_select2(id, title, options, col='9', desc=None, value=None) %}
|
{% macro setting_select2(id, title, options, col='9', desc=None, value=None) %}
|
||||||
{{ macros.setting_top(title) }}
|
{{ macros.setting_top(title) }}
|
||||||
<div class="input-group col-sm-{{ col }}">
|
<div class="input-group col-sm-{{ col }}">
|
||||||
@@ -27,7 +29,6 @@
|
|||||||
{{ macros.setting_bottom(desc) }}
|
{{ macros.setting_bottom(desc) }}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% extends "base.html" %}
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
{{ macros.setting_input_text_and_buttons('ffmpeg_path', 'FFmpeg 경로', [['ffmpeg_version', '버전확인']], value=arg['ffmpeg_path'], placeholder='ffmpeg', desc='SJVA에 내장된 버전 말고 원하는 버전을 사용할 수 있습니다.') }}
|
{{ macros.setting_input_text_and_buttons('ffmpeg_path', 'FFmpeg 경로', [['ffmpeg_version', '버전확인']], value=arg['ffmpeg_path'], placeholder='ffmpeg', desc='SJVA에 내장된 버전 말고 원하는 버전을 사용할 수 있습니다.') }}
|
||||||
{{ macros.setting_input_text('temp_path', '임시 폴더', value=arg['temp_path'], desc='다운로드 파일이 임시로 저장될 폴더입니다.') }}
|
{{ macros.setting_input_text('temp_path', '임시 폴더', value=arg['temp_path'], desc='다운로드 파일이 임시로 저장될 폴더입니다.') }}
|
||||||
{{ macros.setting_input_text('save_path', '저장 폴더', value=arg['save_path'], desc='정상적으로 완료된 파일이 이동할 폴더입니다.') }}
|
{{ macros.setting_input_text('save_path', '저장 폴더', value=arg['save_path'], desc='정상적으로 완료된 파일이 이동할 폴더입니다.') }}
|
||||||
{{ macros.setting_input_text('default_filename', '기본 파일명', value=arg['default_filename'], desc=['템플릿 규칙은 https://github.com/ytdl-org/youtube-dl/blob/master/README.md#output-template 참고', '기본값은 "%(title)s-%(id)s.%(ext)s"입니다.']) }}
|
{{ macros.setting_input_text('default_filename', '기본 파일명', value=arg['default_filename'], placeholder=arg['DEFAULT_FILENAME'], desc='템플릿 규칙은 https://github.com/ytdl-org/youtube-dl/blob/master/README.md#output-template 참고') }}
|
||||||
{{ macros.setting_input_text('proxy', '프록시', value=arg['proxy'], desc=['HTTP/HTTPS/SOCKS를 지원합니다. 예) socks5://127.0.0.1:1080/', '빈칸으로 두면 프록시를 사용하지 않습니다.']) }}
|
{{ macros.setting_input_text('proxy', '프록시', value=arg['proxy'], desc=['HTTP/HTTPS/SOCKS를 지원합니다. 예) socks5://127.0.0.1:1080/', '빈칸으로 두면 프록시를 사용하지 않습니다.']) }}
|
||||||
{{ macros.setting_checkbox('activate_cors', 'CORS 허용', value=arg['activate_cors'], desc='API로의 크로스 도메인 요청을 허용합니다. 설정 저장 후 재시작이 필요합니다.') }}
|
{{ macros.setting_checkbox('activate_cors', 'CORS 허용', value=arg['activate_cors'], desc='API로의 크로스 도메인 요청을 허용합니다. 설정 저장 후 재시작이 필요합니다.') }}
|
||||||
{{ macros.setting_button([['global_setting_save_btn', '저장']]) }}
|
{{ macros.setting_button([['global_setting_save_btn', '저장']]) }}
|
||||||
@@ -23,13 +23,16 @@
|
|||||||
|
|
||||||
// FFmpeg 버전확인
|
// FFmpeg 버전확인
|
||||||
$('#ffmpeg_version').click(function () {
|
$('#ffmpeg_version').click(function () {
|
||||||
let ffmpeg_path = $('#ffmpeg_path').val()
|
let ffmpeg_path = $('#ffmpeg_path').val();
|
||||||
|
if (ffmpeg_path.length === 0) {
|
||||||
|
ffmpeg_path = 'ffmpeg';
|
||||||
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: `/${package_name}/ajax/ffmpeg_version`,
|
url: `/${package_name}/ajax/ffmpeg_version`,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
cache: false,
|
cache: false,
|
||||||
data: {
|
data: {
|
||||||
path: ffmpeg_path.length === 0 ? 'ffmpeg' : ffmpeg_path
|
path: ffmpeg_path
|
||||||
},
|
},
|
||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
}).done(function (data) {
|
}).done(function (data) {
|
||||||
@@ -37,7 +40,7 @@
|
|||||||
$('#modal_body').html(data);
|
$('#modal_body').html(data);
|
||||||
$('#large_modal').modal();
|
$('#large_modal').modal();
|
||||||
}).fail(function () {
|
}).fail(function () {
|
||||||
$.notify('<strong>버전확인 실패</strong>', {
|
$.notify(`<strong>버전확인 실패</strong><br>${ffmpeg_path} -version`, {
|
||||||
type: 'danger'
|
type: 'danger'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user