2020-02-05 20:54:30 +09:00
{% extends "base.html" %}
{% block content %}
2021-02-05 21:35:49 +09:00
< form id = "setting" >
{{ macros.setting_radio('youtube_dl_package', 'youtube-dl', arg['package_list'], value=arg['youtube_dl_package'], desc='사용할 youtube-dl 패키지를 선택합니다. 설정 저장 후 재시작이 필요합니다.') }}
{{ macros.setting_input_text('youtube_dl_version', 'youtube-dl 버전', value=arg['youtube_dl_version'], disabled=True) }}
{{ macros.setting_input_text_and_buttons('ffmpeg_path', 'FFmpeg 경로', [['ffmpeg_version_btn', '버전확인']], 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'], placeholder=arg['DEFAULT_FILENAME'], desc='템플릿 규칙은 https://github.com/ytdl-org/youtube-dl/#output-template 참고') }}
{{ 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 >
2020-02-05 20:54:30 +09:00
2020-10-05 18:02:43 +09:00
< script >
"use strict" ;
const package _name = '{{ arg["package_name"] }}' ;
2020-07-25 03:06:03 +09:00
2021-02-05 21:35:49 +09:00
// FFmpeg 버전확인
const ffmpeg _version _btn = document . getElementById ( 'ffmpeg_version_btn' ) ;
ffmpeg _version _btn . addEventListener ( 'click' , ( event ) => {
event . preventDefault ( ) ;
let ffmpeg _path = document . getElementById ( 'ffmpeg_path' ) . value ;
if ( ffmpeg _path . length === 0 ) {
ffmpeg _path = 'ffmpeg' ;
}
fetch ( ` / ${ package _name } /ajax/ffmpeg_version ` , {
method : 'POST' ,
cache : 'no-cache' ,
headers : {
'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'
} ,
body : new URLSearchParams ( {
path : ffmpeg _path
} )
} ) . then ( response => response . json ( ) ) . then ( ( data ) => {
document . getElementById ( 'modal_title' ) . innerHTML = ` ${ ffmpeg _path } -version ` ;
document . getElementById ( 'modal_body' ) . innerHTML = data ;
$ ( '#large_modal' ) . modal ( ) ;
} ) . catch ( ( ) => {
notify ( '버전확인 실패' , 'danger' ) ;
2020-07-25 03:06:03 +09:00
} ) ;
} ) ;
2020-10-05 18:02:43 +09:00
< / script >
2020-02-05 20:54:30 +09:00
2020-07-23 23:00:02 +09:00
{% endblock %}