v1.6.4 FFmpeg 경로 설정 추가
FFmpeg 경로 설정 추가 API에서 GET 요청 지원
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
|
||||
// 후처리 변경
|
||||
$('#postprocessor').change(function () {
|
||||
if ($(this).find($('option[value="' + $(this).val() + '"]')).parent().attr('label') === '오디오 추출') {
|
||||
if ($(this).find($(`option[value="${$(this).val()}"]`)).parent().attr('label') === '오디오 추출') {
|
||||
$('#preset').val('bestaudio/best').change();
|
||||
}
|
||||
});
|
||||
@@ -72,7 +72,7 @@
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/download',
|
||||
url: `/${package_name}/ajax/download`,
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
data: {
|
||||
@@ -81,12 +81,15 @@
|
||||
format: $('#format').val(),
|
||||
postprocessor: $('#postprocessor').val()
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function () {
|
||||
$.notify('<strong>분석중..</strong>', {
|
||||
type: 'info'
|
||||
});
|
||||
}
|
||||
dataType: 'json'
|
||||
}).done(function () {
|
||||
$.notify('<strong>분석중..</strong>', {
|
||||
type: 'info'
|
||||
});
|
||||
}).fail(function () {
|
||||
$.notify('<strong>다운로드 요청 실패</strong>', {
|
||||
type: 'danger'
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
const package_name = '{{ arg["package_name"] }}';
|
||||
|
||||
$(function () {
|
||||
let socket = io.connect(location.origin + '/' + package_name);
|
||||
let socket = io.connect(`${location.origin}/${package_name}`);
|
||||
|
||||
socket.on('add', function (data) {
|
||||
$('#list').append(make_item(data));
|
||||
@@ -54,33 +54,31 @@
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/list',
|
||||
url: `/${package_name}/ajax/list`,
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
data: {},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
let str = '';
|
||||
for (let i of data) {
|
||||
str += make_item(i);
|
||||
}
|
||||
$('#list').html(str);
|
||||
dataType: 'json'
|
||||
}).done(function (data) {
|
||||
let str = '';
|
||||
for (let item of data) {
|
||||
str += make_item(item);
|
||||
}
|
||||
$('#list').html(str);
|
||||
});
|
||||
|
||||
$('#list').on('click', '.youtube-dl_stop', function () {
|
||||
let index = $(this).data('index');
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/stop',
|
||||
url: `/${package_name}/ajax/stop`,
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
data: {
|
||||
index: index
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function () {
|
||||
location.reload(); // 새로고침
|
||||
}
|
||||
dataType: 'json'
|
||||
}).done(function () {
|
||||
location.reload();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
@@ -158,8 +156,8 @@
|
||||
}
|
||||
|
||||
function status_html(data) {
|
||||
$('#item_' + data.index).html(get_item(data));
|
||||
$('#detail_' + data.index).html(get_detail(data));
|
||||
$(`#item_${data.index}`).html(get_item(data));
|
||||
$(`#detail_${data.index}`).html(get_detail(data));
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
<div>
|
||||
{{ macros.setting_input_text('youtube_dl_version', 'youtube-dl 버전', value=arg['youtube_dl_version']) }}
|
||||
<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_input_text('proxy', '프록시', value=arg['proxy'], placeholder='프록시 주소', desc=['HTTP/HTTPS/SOCKS를 지원합니다. 예) socks5://127.0.0.1:1080/', '빈칸으로 두면 프록시를 사용하지 않습니다.']) }}
|
||||
{{ 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('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('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_button([['global_setting_save_btn', '저장']]) }}
|
||||
</form>
|
||||
@@ -16,6 +17,33 @@
|
||||
<script>
|
||||
"use strict";
|
||||
const package_name = '{{ arg["package_name"] }}';
|
||||
|
||||
$(function () {
|
||||
$('#youtube_dl_version').prop('readonly', true);
|
||||
|
||||
// FFmpeg 버전확인
|
||||
$('#ffmpeg_version').click(function () {
|
||||
let ffmpeg_path = $('#ffmpeg_path').val()
|
||||
$.ajax({
|
||||
url: `/${package_name}/ajax/ffmpeg_version`,
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
data: {
|
||||
path: ffmpeg_path.length === 0 ? 'ffmpeg' : ffmpeg_path
|
||||
},
|
||||
dataType: 'json'
|
||||
}).done(function (data) {
|
||||
$('#modal_title').html(`${ffmpeg_path} -version`);
|
||||
$('#modal_body').html(data);
|
||||
$('#large_modal').modal();
|
||||
}).fail(function () {
|
||||
$.notify('<strong>버전확인 실패</strong>', {
|
||||
type: 'danger'
|
||||
});
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user