anime-downloader bug fix 21.
add search routine check download fix
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
aria-label="Basic example"
|
aria-label="Basic example"
|
||||||
>
|
>
|
||||||
<button id="ing" type="button" class="btn btn-success">방영중</button>
|
<button id="ing" type="button" class="btn btn-success">방영중</button>
|
||||||
<button id="movie" type="button" class="btn btn-primary">극장판</button>
|
<button id="theater" type="button" class="btn btn-primary">극장판</button>
|
||||||
<button id="complete_anilist" type="button" class="btn btn-dark">
|
<button id="complete_anilist" type="button" class="btn btn-dark">
|
||||||
완결
|
완결
|
||||||
</button>
|
</button>
|
||||||
@@ -53,13 +53,16 @@
|
|||||||
const sub = "{{arg['sub'] }}";
|
const sub = "{{arg['sub'] }}";
|
||||||
const ohli24_url = "{{arg['ohli24_url']}}";
|
const ohli24_url = "{{arg['ohli24_url']}}";
|
||||||
let current_data = null;
|
let current_data = null;
|
||||||
|
let page = 1;
|
||||||
|
let next_page = Number
|
||||||
|
let current_cate = ''
|
||||||
|
|
||||||
const observer = lozad('.lozad', {
|
const observer = lozad('.lozad', {
|
||||||
rootMargin: '10px 0px', // syntax similar to that of CSS Margin
|
rootMargin: '10px 0px', // syntax similar to that of CSS Margin
|
||||||
threshold: 0.1, // ratio of element convergence
|
threshold: 0.1, // ratio of element convergence
|
||||||
enableAutoReload: true // it will reload the new image when validating attributes changes
|
enableAutoReload: true // it will reload the new image when validating attributes changes
|
||||||
});
|
});
|
||||||
observer.observe();
|
observer.observe();
|
||||||
|
|
||||||
|
|
||||||
const get_anime_list = (type, page) => {
|
const get_anime_list = (type, page) => {
|
||||||
@@ -70,12 +73,19 @@
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case 'ing':
|
case 'ing':
|
||||||
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
||||||
|
current_cate = 'ing'
|
||||||
break;
|
break;
|
||||||
case 'movie':
|
case 'movie':
|
||||||
url = '/' + package_name + '/ajax/'+sub+'screen_movie_list'
|
url = '/' + package_name + '/ajax/'+sub+'/screen_movie_list'
|
||||||
|
current_cate = 'movie'
|
||||||
break;
|
break;
|
||||||
case 'complete':
|
case 'theater':
|
||||||
url = '/' + package_name + '/ajax/'+sub+'screen_movie_list'
|
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
||||||
|
current_cate = 'theater'
|
||||||
|
break;
|
||||||
|
case 'fin':
|
||||||
|
url = '/' + package_name + '/ajax/'+sub+'/complete_list'
|
||||||
|
current_cate = 'fin'
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -93,13 +103,16 @@
|
|||||||
|
|
||||||
if (current_screen_movie_data !== '') {
|
if (current_screen_movie_data !== '') {
|
||||||
if (type === "ing") {
|
if (type === "ing") {
|
||||||
make_airing_list(ret.data, page)
|
make_airing_list(ret.data, page)
|
||||||
// setTimeout(() => {
|
observer.observe();
|
||||||
// observer.observe();
|
} else if (type === "fin") {
|
||||||
// }, 1000);
|
make_screen_movie_list(ret.data, page)
|
||||||
observer.observe();
|
observer.observe();
|
||||||
|
} else if (type === "theater") {
|
||||||
|
make_screen_movie_list(ret.data, page)
|
||||||
|
observer.observe();
|
||||||
} else {
|
} else {
|
||||||
make_screen_movie_list(ret, page)
|
make_screen_movie_list(ret.data, page)
|
||||||
}
|
}
|
||||||
div_visible = true
|
div_visible = true
|
||||||
console.log(div_visible)
|
console.log(div_visible)
|
||||||
@@ -165,6 +178,14 @@
|
|||||||
str += '</div>';
|
str += '</div>';
|
||||||
str += '<div id="inner_screen_movie" class="row infinite-scroll">';
|
str += '<div id="inner_screen_movie" class="row infinite-scroll">';
|
||||||
for (let i in data.anime_list) {
|
for (let i in data.anime_list) {
|
||||||
|
if (data.anime_list[i].wr_id !== '') {
|
||||||
|
const re = /bo_table=([^&]+)/
|
||||||
|
const bo_table = data.anime_list[i].link.match(re)
|
||||||
|
// console.log(bo_table)
|
||||||
|
request_url = './request?code=' + data.anime_list[i].code + '&wr_id='+ data.anime_list[i].wr_id + '&bo_table='+bo_table[1]
|
||||||
|
} else {
|
||||||
|
request_url = './request?code=' + data.anime_list[i].code
|
||||||
|
}
|
||||||
|
|
||||||
tmp = '<div class="col-sm-4">';
|
tmp = '<div class="col-sm-4">';
|
||||||
tmp += '<div class="card">';
|
tmp += '<div class="card">';
|
||||||
@@ -174,7 +195,7 @@
|
|||||||
// {# '<span data-tooltip-text="'+data.episode[i].title+'">' + data.episode[i].code + '</span></button></div>';#}
|
// {# '<span data-tooltip-text="'+data.episode[i].title+'">' + data.episode[i].code + '</span></button></div>';#}
|
||||||
tmp += '<h5 class="card-title">' + data.anime_list[i].title + '</h5>';
|
tmp += '<h5 class="card-title">' + data.anime_list[i].title + '</h5>';
|
||||||
tmp += '<p class="card-text">' + data.anime_list[i].code + '</p>';
|
tmp += '<p class="card-text">' + data.anime_list[i].code + '</p>';
|
||||||
tmp += '<a href="./request?code=' + data.anime_list[i].code + '" class="btn btn-primary cut-text">' + data.anime_list[i].title + '</a>';
|
tmp += '<a href="'+request_url+'" class="btn btn-primary cut-text">' + data.anime_list[i].title + '</a>';
|
||||||
tmp += '</div>';
|
tmp += '</div>';
|
||||||
tmp += '</div>';
|
tmp += '</div>';
|
||||||
tmp += '</div>';
|
tmp += '</div>';
|
||||||
@@ -215,11 +236,9 @@
|
|||||||
tmp += '<div class="card">';
|
tmp += '<div class="card">';
|
||||||
tmp += '<img class="card-img-top" src="' + data.anime_list[i].image_link + '" />';
|
tmp += '<img class="card-img-top" src="' + data.anime_list[i].image_link + '" />';
|
||||||
tmp += '<div class="card-body">'
|
tmp += '<div class="card-body">'
|
||||||
{#tmp += '<button id="code_button" data-code="' + data.episode[i].code + '" type="button" class="btn btn-primary code-button bootstrap-tooltip" data-toggle="button" data-tooltip="true" aria-pressed="true" autocomplete="off" data-placement="top">' +#}
|
|
||||||
// {# '<span data-tooltip-text="'+data.episode[i].title+'">' + data.episode[i].code + '</span></button></div>';#}
|
|
||||||
tmp += '<h5 class="card-title">' + data.anime_list[i].title + '</h5>';
|
tmp += '<h5 class="card-title">' + data.anime_list[i].title + '</h5>';
|
||||||
tmp += '<p class="card-text">' + data.anime_list[i].code + '</p>';
|
tmp += '<p class="card-text">' + data.anime_list[i].code + '</p>';
|
||||||
tmp += '<a href="./request?code=' + data.anime_list[i].code + '" class="btn btn-primary cut-text">' + data.episode[i].title + '</a>';
|
tmp += '<a href="./request?code=' + data.anime_list[i].code + '" class="btn btn-primary cut-text">' + data.anime_list[i].title + '</a>';
|
||||||
tmp += '</div>';
|
tmp += '</div>';
|
||||||
tmp += '</div>';
|
tmp += '</div>';
|
||||||
tmp += '</div>';
|
tmp += '</div>';
|
||||||
@@ -299,10 +318,24 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#anime_category #ing').on("click", function() {
|
$('#anime_category #ing').on("click", function() {
|
||||||
|
// {#console.log(this.id)#}
|
||||||
|
let spinner = document.getElementById('spinner');
|
||||||
|
spinner.style.visibility = 'visible';
|
||||||
|
get_anime_list("ing", 1)
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#anime_category #complete_anilist').on("click", function() {
|
||||||
// {#console.log(this.id)#}
|
// {#console.log(this.id)#}
|
||||||
let spinner = document.getElementById('spinner');
|
let spinner = document.getElementById('spinner');
|
||||||
spinner.style.visibility = 'visible';
|
spinner.style.visibility = 'visible';
|
||||||
get_anime_list("ing", 1)
|
get_anime_list("fin", 1)
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#anime_category #theater').on("click", function() {
|
||||||
|
// {#console.log(this.id)#}
|
||||||
|
let spinner = document.getElementById('spinner');
|
||||||
|
spinner.style.visibility = 'visible';
|
||||||
|
get_anime_list("theater", 1)
|
||||||
})
|
})
|
||||||
|
|
||||||
// 분석 버튼 클릭시 호출
|
// 분석 버튼 클릭시 호출
|
||||||
@@ -368,14 +401,77 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
// const observer = lozad();
|
// const observer = lozad();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// const el = document.querySelector('img');
|
// const el = document.querySelector('img');
|
||||||
// const observer = lozad(el); // passing a `NodeList` (e.g. `document.querySelectorAll()`) is also valid
|
// const observer = lozad(el); // passing a `NodeList` (e.g. `document.querySelectorAll()`) is also valid
|
||||||
// observer.observe();
|
// observer.observe();
|
||||||
|
const loadNextAnimes = (cate, page) => {
|
||||||
|
spinner.style.display = "block";
|
||||||
|
const data = { type: cate, page: String(page) };
|
||||||
|
let url = ''
|
||||||
|
switch (cate) {
|
||||||
|
case 'ing':
|
||||||
|
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
||||||
|
current_cate = 'ing'
|
||||||
|
break;
|
||||||
|
case 'movie':
|
||||||
|
url = '/' + package_name + '/ajax/'+sub+'/screen_movie_list'
|
||||||
|
current_cate = 'movie'
|
||||||
|
break;
|
||||||
|
case 'theater':
|
||||||
|
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
||||||
|
current_cate = 'theater'
|
||||||
|
break;
|
||||||
|
case 'fin':
|
||||||
|
url = '/' + package_name + '/ajax/'+sub+'/complete_list'
|
||||||
|
current_cate = 'fin'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch(url, {
|
||||||
|
method: "POST",
|
||||||
|
cache: "no-cache",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
|
},
|
||||||
|
body: new URLSearchParams(data),
|
||||||
|
})
|
||||||
|
.then((res) => res.json())
|
||||||
|
.then((response) => {
|
||||||
|
console.log("Success:", JSON.stringify(response));
|
||||||
|
// {#imagesContainer.appendChild()#}
|
||||||
|
console.log("return page:::> ", response.page);
|
||||||
|
// {#page = response.page#}
|
||||||
|
make_screen_movie_list(response.data, response.page);
|
||||||
|
page++;
|
||||||
|
next_page++;
|
||||||
|
})
|
||||||
|
.catch((error) => console.error("Error:", error));
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const onScroll = (e) => {
|
||||||
|
console.dir(e.target.scrollingElement.scrollHeight);
|
||||||
|
const { scrollTop, scrollHeight, clientHeight } = e.target.scrollingElement;
|
||||||
|
if (Math.round(scrollHeight - scrollTop) <= clientHeight) {
|
||||||
|
document.getElementById("spinner").style.display = "block";
|
||||||
|
console.log("loading");
|
||||||
|
console.log("now page::> ", page);
|
||||||
|
console.log("next_page::> ", next_page);
|
||||||
|
loadNextAnimes(current_cate, next_page);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const debounce = (func, delay) => {
|
||||||
|
let timeoutId = null;
|
||||||
|
return (...args) => {
|
||||||
|
clearTimeout(timeoutId);
|
||||||
|
timeoutId = setTimeout(func.bind(null, ...args), delay);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener("scroll", debounce(onScroll, 300));
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
button.code-button {
|
button.code-button {
|
||||||
|
|||||||
@@ -1,368 +1,365 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %} {% block content %}
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<form id='program_list'>
|
<form id="program_list">
|
||||||
{{ macros.setting_input_text_and_buttons('code', '작품 Code', [['analysis_btn', '분석'], ['go_ohli24_btn', 'Go OHLI24']], desc='예) "https://ohli24.net/c/녹을 먹는 비스코" 이나 "녹을 먹는 비스코"') }}
|
{{ macros.setting_input_text_and_buttons('code', '작품 Code',
|
||||||
|
[['analysis_btn', '분석'], ['go_ohli24_btn', 'Go OHLI24']], desc='예)
|
||||||
|
"https://ohli24.net/c/녹을 먹는 비스코" 이나 "녹을 먹는 비스코"') }}
|
||||||
</form>
|
</form>
|
||||||
<form id="program_auto_form">
|
<form id="program_auto_form">
|
||||||
<div id='episode_list'></div>
|
<div id="episode_list"></div>
|
||||||
</form>
|
</form>
|
||||||
</div> <!--전체-->
|
</div>
|
||||||
|
<!--전체-->
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const package_name = "{{arg['package_name'] }}";
|
const package_name = "{{arg['package_name'] }}";
|
||||||
const sub = "{{arg['sub'] }}";
|
const sub = "{{arg['sub'] }}";
|
||||||
const ohli24_url = "{{arg['ohli24_url']}}";
|
const ohli24_url = "{{arg['ohli24_url']}}";
|
||||||
let current_data = null;
|
let current_data = null;
|
||||||
|
|
||||||
const params = new Proxy(new URLSearchParams(window.location.search), {
|
const params = new Proxy(new URLSearchParams(window.location.search), {
|
||||||
get: (searchParams, prop) => searchParams.get(prop),
|
get: (searchParams, prop) => searchParams.get(prop),
|
||||||
})
|
})
|
||||||
|
|
||||||
function findGetParameter(parameterName) {
|
|
||||||
let result = null,
|
|
||||||
tmp = [];
|
|
||||||
const items = location.search.substr(1).split("&");
|
|
||||||
for (let index = 0; index < items.length; index++) {
|
|
||||||
tmp = items[index].split("=");
|
|
||||||
if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function analyze() {
|
|
||||||
// e.preventDefault();
|
|
||||||
const code = document.getElementById("code").value
|
|
||||||
console.log(code)
|
|
||||||
$.ajax({
|
|
||||||
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
|
||||||
type: "POST",
|
|
||||||
cache: false,
|
|
||||||
data: {code:code},
|
|
||||||
dataType: "json",
|
|
||||||
success: function (ret) {
|
|
||||||
if (ret.ret === 'success' && ret.data != null) {
|
|
||||||
// {#console.log(ret.code)#}
|
|
||||||
console.log(ret.data)
|
|
||||||
make_program(ret.data)
|
|
||||||
} else {
|
|
||||||
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function make_program(data) {
|
|
||||||
current_data = data;
|
|
||||||
console.log("current_data::", current_data)
|
|
||||||
str = '';
|
|
||||||
tmp = '<div class="form-inline">'
|
|
||||||
tmp += m_button('check_download_btn', '선택 다운로드 추가', []);
|
|
||||||
tmp += m_button('all_check_on_btn', '전체 선택', []);
|
|
||||||
tmp += m_button('all_check_off_btn', '전체 해제', []);
|
|
||||||
/*
|
|
||||||
tmp += ' <input id="new_title" name="new_title" class="form-control form-control-sm" value="'+data.title+'">'
|
|
||||||
tmp += '</div>'
|
|
||||||
tmp += m_button('apply_new_title_btn', '저장폴더명, 파일명 제목 변경', []);
|
|
||||||
tmp += m_button('search_tvdb_btn', 'TVDB', []);
|
|
||||||
tmp = m_button_group(tmp)
|
|
||||||
*/
|
|
||||||
str += tmp
|
|
||||||
// program
|
|
||||||
str += m_hr_black();
|
|
||||||
str += m_row_start(0);
|
|
||||||
tmp = ''
|
|
||||||
if (data.image != null)
|
|
||||||
tmp = '<img src="' + data.image + '" class="img-fluid">';
|
|
||||||
str += m_col(3, tmp)
|
|
||||||
tmp = ''
|
|
||||||
tmp += m_row_start(2) + m_col(3, '제목', 'right') + m_col(9, data.title) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '원제', 'right') + m_col(9, data.des._otit) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '감독', 'right') + m_col(9, data.des._dir) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '제작사', 'right') + m_col(9, data.des._pub) + m_row_end();
|
|
||||||
{#tmp += m_row_start(2) + m_col(3, '장르', 'right') + m_col(9, data.des._tag.join(' | ')) + m_row_end();#}
|
|
||||||
tmp += m_row_start(2) + m_col(3, '장르', 'right') + m_col(9, data.des._tag) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '분류', 'right') + m_col(9, data.des._classifi) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '방영일', 'right') + m_col(9, data.date+'('+data.day+')') + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '등급', 'right') + m_col(9, data.des._grade) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '총화수', 'right') + m_col(9, data.des._total_chapter) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '상영시간', 'right') + m_col(9, data.des._show_time) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '줄거리', 'right') + m_col(9, data.ser_description) + m_row_end();
|
|
||||||
str += m_col(9, tmp)
|
|
||||||
str += m_row_end();
|
|
||||||
|
|
||||||
str += m_hr_black();
|
|
||||||
for (i in data.episode) {
|
|
||||||
str += m_row_start(); tmp = '';
|
|
||||||
if (data.episode[i].thumbnail)
|
|
||||||
tmp = '<img src="'+ data.episode[i].thumbnail + '" class="img-fluid">'
|
|
||||||
str += m_col(3, tmp)
|
|
||||||
tmp = '<strong>' + data.episode[i].title+ '</strong>';
|
|
||||||
tmp += '<br>';
|
|
||||||
tmp += data.episode[i].date + '<br>';
|
|
||||||
|
|
||||||
tmp += '<div class="form-inline">'
|
|
||||||
tmp += '<input id="checkbox_'+i+'" name="checkbox_'+i+'" type="checkbox" checked data-toggle="toggle" data-on="선 택" data-off="-" data-onstyle="success" data-offstyle="danger" data-size="small"> '
|
|
||||||
tmp += m_button('add_queue_btn', '다운로드 추가', [{'key':'idx', 'value':i}])
|
|
||||||
tmp += '</div>'
|
|
||||||
str += m_col(9, tmp)
|
|
||||||
str += m_row_end();
|
|
||||||
if (i != data.length -1) str += m_hr(0);
|
|
||||||
}
|
|
||||||
document.getElementById("episode_list").innerHTML = str;
|
|
||||||
$('input[id^="checkbox_"]').bootstrapToggle()
|
|
||||||
}
|
|
||||||
|
|
||||||
$(function () {
|
|
||||||
console.log(params.code)
|
|
||||||
if (params.code === '') {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
document.getElementById("code").value = params.code
|
|
||||||
// {#document.getElementById("analysis_btn").click();#}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( "{{arg['ohli24_current_code']}}" !== "") {
|
|
||||||
if (params.code === null) {
|
|
||||||
console.log('params.code === null')
|
|
||||||
document.getElementById("code").value = "{{arg['ohli24_current_code']}}";
|
|
||||||
|
|
||||||
} else if(params.code === '') {
|
|
||||||
document.getElementById("code").value = "{{arg['ohli24_current_code']}}";
|
|
||||||
} else {
|
|
||||||
|
|
||||||
console.log('params code exist')
|
|
||||||
console.log(params.code)
|
|
||||||
document.getElementById("code").value = params.code
|
|
||||||
analyze()
|
|
||||||
// document.getElementById("analysis_btn").click();
|
|
||||||
// $('#analysis_btn').trigger('click')
|
|
||||||
}
|
|
||||||
// 값이 공백이 아니면 분석 버튼 계속 누름
|
|
||||||
// {#document.getElementById("analysis_btn").click();#}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// $('#analysis_btn').unbind("click").bind('click', function (e) {
|
|
||||||
// e.preventDefault();
|
|
||||||
// e.stopPropagation()
|
|
||||||
// console.log('test')
|
|
||||||
// const code = document.getElementById("code").value
|
|
||||||
// console.log(code)
|
|
||||||
// })
|
|
||||||
|
|
||||||
// $("body").unbind('click', '#analysis_btn')
|
function findGetParameter(parameterName) {
|
||||||
// 분석 버튼 클릭시 호출
|
let result = null,
|
||||||
// $("body").on('click', '#analysis_btn', function(e){
|
tmp = [];
|
||||||
$("#analysis_btn").unbind("click").bind('click', function(e){
|
const items = location.search.substr(1).split("&");
|
||||||
e.preventDefault();
|
for (let index = 0; index < items.length; index++) {
|
||||||
e.stopPropagation()
|
tmp = items[index].split("=");
|
||||||
const code = document.getElementById("code").value
|
if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
|
||||||
console.log(code)
|
}
|
||||||
$.ajax({
|
return result;
|
||||||
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
}
|
||||||
type: "POST",
|
|
||||||
cache: false,
|
|
||||||
data: {code:code},
|
|
||||||
dataType: "json",
|
|
||||||
success: function (ret) {
|
|
||||||
if (ret.ret === 'success' && ret.data != null) {
|
|
||||||
// {#console.log(ret.code)#}
|
|
||||||
console.log(ret.data)
|
|
||||||
make_program(ret.data)
|
|
||||||
} else {
|
|
||||||
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
function analyze(wr_id, bo_table) {
|
||||||
$("body").on('click', '#go_ohli24_btn', function(e){
|
// e.preventDefault();
|
||||||
e.preventDefault();
|
const code = document.getElementById("code").value
|
||||||
window.open("{{arg['ohli24_url']}}", "_blank");
|
console.log(code)
|
||||||
});
|
$.ajax({
|
||||||
|
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
||||||
$("body").on('click', '#all_check_on_btn', function(e){
|
type: "POST",
|
||||||
e.preventDefault();
|
cache: false,
|
||||||
$('input[id^="checkbox_"]').bootstrapToggle('on')
|
data: {code: code, wr_id: wr_id, bo_table: bo_table},
|
||||||
});
|
dataType: "json",
|
||||||
|
success: function (ret) {
|
||||||
$("body").on('click', '#all_check_off_btn', function(e){
|
if (ret.ret === 'success' && ret.data != null) {
|
||||||
e.preventDefault();
|
// {#console.log(ret.code)#}
|
||||||
$('input[id^="checkbox_"]').bootstrapToggle('off')
|
console.log(ret.data)
|
||||||
});
|
make_program(ret.data)
|
||||||
|
} else {
|
||||||
$("body").on('click', '#add_queue_btn', function(e){
|
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
||||||
e.preventDefault();
|
}
|
||||||
data = current_data.episode[$(this).data('idx')];
|
|
||||||
console.log('data:::>', data)
|
|
||||||
$.ajax({
|
|
||||||
url: '/' + package_name + '/ajax/' + sub + '/add_queue',
|
|
||||||
type: "POST",
|
|
||||||
cache: false,
|
|
||||||
data: {data:JSON.stringify(data)},
|
|
||||||
dataType: "json",
|
|
||||||
success: function (data) {
|
|
||||||
if (data.ret == 'enqueue_db_append' || data.ret == 'enqueue_db_exist') {
|
|
||||||
$.notify('<strong>다운로드 작업을 추가 하였습니다.</strong>', {type: 'success'});
|
|
||||||
} else if (data.ret == 'queue_exist') {
|
|
||||||
$.notify('<strong>이미 큐에 있습니다. 삭제 후 추가하세요.</strong>', {type: 'warning'});
|
|
||||||
} else if (data.ret == 'db_completed') {
|
|
||||||
$.notify('<strong>DB에 완료 기록이 있습니다.</strong>', {type: 'warning'});
|
|
||||||
} else {
|
|
||||||
$.notify('<strong>추가 실패</strong><br>' + ret.log, {type: 'warning'});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$("body").on('click', '#check_download_btn', function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
all = $('input[id^="checkbox_"]');
|
|
||||||
let data = [];
|
|
||||||
let idx;
|
|
||||||
for (let i in all) {
|
|
||||||
if (all[i].checked) {
|
|
||||||
idx = parseInt(all[i].id.split('_')[1])
|
|
||||||
data.push(current_data.episode[idx]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (data.length == 0) {
|
|
||||||
$.notify('<strong>선택하세요.</strong>', {type: 'warning'});
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function make_program(data) {
|
||||||
|
current_data = data;
|
||||||
|
console.log("current_data::", current_data)
|
||||||
|
str = '';
|
||||||
|
tmp = '<div class="form-inline">'
|
||||||
|
tmp += m_button('check_download_btn', '선택 다운로드 추가', []);
|
||||||
|
tmp += m_button('all_check_on_btn', '전체 선택', []);
|
||||||
|
tmp += m_button('all_check_off_btn', '전체 해제', []);
|
||||||
|
/*
|
||||||
|
tmp += ' <input id="new_title" name="new_title" class="form-control form-control-sm" value="'+data.title+'">'
|
||||||
|
tmp += '</div>'
|
||||||
|
tmp += m_button('apply_new_title_btn', '저장폴더명, 파일명 제목 변경', []);
|
||||||
|
tmp += m_button('search_tvdb_btn', 'TVDB', []);
|
||||||
|
tmp = m_button_group(tmp)
|
||||||
|
*/
|
||||||
|
str += tmp
|
||||||
|
// program
|
||||||
|
str += m_hr_black();
|
||||||
|
str += m_row_start(0);
|
||||||
|
tmp = ''
|
||||||
|
if (data.image != null)
|
||||||
|
tmp = '<img src="' + data.image + '" class="img-fluid">';
|
||||||
|
str += m_col(3, tmp)
|
||||||
|
tmp = ''
|
||||||
|
tmp += m_row_start(2) + m_col(3, '제목', 'right') + m_col(9, data.title) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '원제', 'right') + m_col(9, data.des._otit) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '감독', 'right') + m_col(9, data.des._dir) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '제작사', 'right') + m_col(9, data.des._pub) + m_row_end();
|
||||||
|
{#tmp += m_row_start(2) + m_col(3, '장르', 'right') + m_col(9, data.des._tag.join(' | ')) + m_row_end();#}
|
||||||
|
tmp += m_row_start(2) + m_col(3, '장르', 'right') + m_col(9, data.des._tag) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '분류', 'right') + m_col(9, data.des._classifi) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '방영일', 'right') + m_col(9, data.date+'('+data.day+')') + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '등급', 'right') + m_col(9, data.des._grade) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '총화수', 'right') + m_col(9, data.des._total_chapter) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '상영시간', 'right') + m_col(9, data.des._show_time) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '줄거리', 'right') + m_col(9, data.ser_description) + m_row_end();
|
||||||
|
str += m_col(9, tmp)
|
||||||
|
str += m_row_end();
|
||||||
|
|
||||||
|
str += m_hr_black();
|
||||||
|
for (i in data.episode) {
|
||||||
|
str += m_row_start(); tmp = '';
|
||||||
|
if (data.episode[i].thumbnail)
|
||||||
|
tmp = '<img src="'+ data.episode[i].thumbnail + '" class="img-fluid">'
|
||||||
|
str += m_col(3, tmp)
|
||||||
|
tmp = '<strong>' + data.episode[i].title+ '</strong>';
|
||||||
|
tmp += '<br>';
|
||||||
|
tmp += data.episode[i].date + '<br>';
|
||||||
|
|
||||||
|
tmp += '<div class="form-inline">'
|
||||||
|
tmp += '<input id="checkbox_'+i+'" name="checkbox_'+i+'" type="checkbox" checked data-toggle="toggle" data-on="선 택" data-off="-" data-onstyle="success" data-offstyle="danger" data-size="small"> '
|
||||||
|
tmp += m_button('add_queue_btn', '다운로드 추가', [{'key':'idx', 'value':i}])
|
||||||
|
tmp += '</div>'
|
||||||
|
str += m_col(9, tmp)
|
||||||
|
str += m_row_end();
|
||||||
|
if (i != data.length -1) str += m_hr(0);
|
||||||
|
}
|
||||||
|
document.getElementById("episode_list").innerHTML = str;
|
||||||
|
$('input[id^="checkbox_"]').bootstrapToggle()
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
console.log(params.wr_id)
|
||||||
|
console.log(findGetParameter('wr_id'))
|
||||||
|
console.log(params.code)
|
||||||
|
if (params.code === '') {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
document.getElementById("code").value = params.code
|
||||||
|
// {#document.getElementById("analysis_btn").click();#}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( "{{arg['ohli24_current_code']}}" !== "") {
|
||||||
|
if (params.code === null) {
|
||||||
|
console.log('params.code === null')
|
||||||
|
document.getElementById("code").value = "{{arg['ohli24_current_code']}}";
|
||||||
|
|
||||||
|
} else if(params.code === '') {
|
||||||
|
document.getElementById("code").value = "{{arg['ohli24_current_code']}}";
|
||||||
|
} else {
|
||||||
|
|
||||||
|
console.log('params code exist')
|
||||||
|
console.log(params.code)
|
||||||
|
document.getElementById("code").value = params.code
|
||||||
|
|
||||||
|
analyze(params.wr_id, params.bo_table)
|
||||||
|
// document.getElementById("analysis_btn").click();
|
||||||
|
// $('#analysis_btn').trigger('click')
|
||||||
|
}
|
||||||
|
// 값이 공백이 아니면 분석 버튼 계속 누름
|
||||||
|
// {#document.getElementById("analysis_btn").click();#}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
console.log('wr_id::', params.wr_id)
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#analysis_btn").unbind("click").bind('click', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation()
|
||||||
|
const code = document.getElementById("code").value
|
||||||
|
console.log(code)
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/' + package_name + '/ajax/' + sub + '/add_queue_checked_list',
|
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
||||||
type: "POST",
|
type: "POST",
|
||||||
cache: false,
|
cache: false,
|
||||||
data: {data:JSON.stringify(data)},
|
data: {code:code},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (data) {
|
success: function (ret) {
|
||||||
$.notify('<strong>백그라운드로 작업을 추가합니다.</strong>', {type: 'success'});
|
if (ret.ret === 'success' && ret.data != null) {
|
||||||
}
|
// {#console.log(ret.code)#}
|
||||||
|
console.log(ret.data)
|
||||||
|
make_program(ret.data)
|
||||||
|
} else {
|
||||||
|
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("body").on('click', '#go_ohli24_btn', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
window.open("{{arg['ohli24_url']}}", "_blank");
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").on('click', '#all_check_on_btn', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
$('input[id^="checkbox_"]').bootstrapToggle('on')
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").on('click', '#all_check_off_btn', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
$('input[id^="checkbox_"]').bootstrapToggle('off')
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").on('click', '#add_queue_btn', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
data = current_data.episode[$(this).data('idx')];
|
||||||
|
console.log('data:::>', data)
|
||||||
|
$.ajax({
|
||||||
|
url: '/' + package_name + '/ajax/' + sub + '/add_queue',
|
||||||
|
type: "POST",
|
||||||
|
cache: false,
|
||||||
|
data: {data:JSON.stringify(data)},
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
if (data.ret == 'enqueue_db_append' || data.ret == 'enqueue_db_exist') {
|
||||||
|
$.notify('<strong>다운로드 작업을 추가 하였습니다.</strong>', {type: 'success'});
|
||||||
|
} else if (data.ret == 'queue_exist') {
|
||||||
|
$.notify('<strong>이미 큐에 있습니다. 삭제 후 추가하세요.</strong>', {type: 'warning'});
|
||||||
|
} else if (data.ret == 'db_completed') {
|
||||||
|
$.notify('<strong>DB에 완료 기록이 있습니다.</strong>', {type: 'warning'});
|
||||||
|
} else {
|
||||||
|
$.notify('<strong>추가 실패</strong><br>' + ret.log, {type: 'warning'});
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").on('click', '#check_download_btn', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
all = $('input[id^="checkbox_"]');
|
||||||
|
let data = [];
|
||||||
|
let idx;
|
||||||
|
for (let i in all) {
|
||||||
|
if (all[i].checked) {
|
||||||
|
idx = parseInt(all[i].id.split('_')[1])
|
||||||
|
data.push(current_data.episode[idx]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (data.length == 0) {
|
||||||
|
$.notify('<strong>선택하세요.</strong>', {type: 'warning'});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$.ajax({
|
||||||
|
url: '/' + package_name + '/ajax/' + sub + '/add_queue_checked_list',
|
||||||
|
type: "POST",
|
||||||
|
cache: false,
|
||||||
|
data: {data:JSON.stringify(data)},
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
$.notify('<strong>백그라운드로 작업을 추가합니다.</strong>', {type: 'success'});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
button.code-button { min-width: 82px!important;}
|
button.code-button {
|
||||||
.tooltip {
|
min-width: 82px !important;
|
||||||
position: relative;
|
}
|
||||||
display: block;
|
.tooltip {
|
||||||
}
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
[data-tooltip-text]:hover {
|
[data-tooltip-text]:hover {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-tooltip-text]:after {
|
[data-tooltip-text]:after {
|
||||||
-webkit-transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
|
-webkit-transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||||
-moz-transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
|
-moz-transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||||
transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
|
transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||||
|
|
||||||
background-color: rgba(0, 0, 0, 0.8);
|
background-color: rgba(0, 0, 0, 0.8);
|
||||||
|
|
||||||
-webkit-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
-webkit-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||||
-moz-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
-moz-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||||
box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||||
|
|
||||||
-webkit-border-radius: 5px;
|
-webkit-border-radius: 5px;
|
||||||
-moz-border-radius: 5px;
|
-moz-border-radius: 5px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|
||||||
color: #FFFFFF;
|
color: #ffffff;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
padding: 7px 12px;
|
padding: 7px 12px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: auto;
|
width: auto;
|
||||||
min-width: 50px;
|
min-width: 50px;
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
left: -9999px;
|
left: -9999px;
|
||||||
top: 90%;
|
top: 90%;
|
||||||
|
|
||||||
content: attr(data-tooltip-text);
|
content: attr(data-tooltip-text);
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-tooltip-text]:hover:after {
|
[data-tooltip-text]:hover:after {
|
||||||
top: 230%;
|
top: 230%;
|
||||||
left: 0;
|
left: 0;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}[data-tooltip-text]:hover {
|
}
|
||||||
position: relative;
|
[data-tooltip-text]:hover {
|
||||||
}
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
[data-tooltip-text]:after {
|
[data-tooltip-text]:after {
|
||||||
-webkit-transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
|
-webkit-transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||||
-moz-transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
|
-moz-transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||||
transition: bottom .3s ease-in-out, opacity .3s ease-in-out;
|
transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||||
|
|
||||||
background-color: rgba(0, 0, 0, 0.8);
|
background-color: rgba(0, 0, 0, 0.8);
|
||||||
|
|
||||||
-webkit-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
-webkit-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||||
-moz-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
-moz-box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||||
box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||||
|
|
||||||
-webkit-border-radius: 5px;
|
-webkit-border-radius: 5px;
|
||||||
-moz-border-radius: 5px;
|
-moz-border-radius: 5px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|
||||||
color: #FFFFFF;
|
color: #ffffff;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
padding: 7px 12px;
|
padding: 7px 12px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: auto;
|
width: auto;
|
||||||
min-width: 50px;
|
min-width: 50px;
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
left: -9999px;
|
left: -9999px;
|
||||||
top: -210%!important;
|
top: -210% !important;
|
||||||
|
|
||||||
content: attr(data-tooltip-text);
|
content: attr(data-tooltip-text);
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-tooltip-text]:hover:after {
|
[data-tooltip-text]:hover:after {
|
||||||
top: 130%;
|
top: 130%;
|
||||||
left: 0;
|
left: 0;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#airing_list {
|
#airing_list {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cut-text {
|
.cut-text {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#screen_movie_list {
|
|
||||||
margin-top: 10px
|
|
||||||
}
|
|
||||||
|
|
||||||
|
#screen_movie_list {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user