2022.01.31 anilife 버그 픽스 (.01)
This commit is contained in:
112
logic_anilife.py
112
logic_anilife.py
@@ -178,43 +178,59 @@ class LogicAniLife(LogicModuleBase):
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
cookie = None
|
cookie = None
|
||||||
|
# browser_args = [
|
||||||
|
# "--window-size=1300,570",
|
||||||
|
# "--window-position=000,000",
|
||||||
|
# "--disable-dev-shm-usage",
|
||||||
|
# "--no-sandbox",
|
||||||
|
# "--disable-web-security",
|
||||||
|
# "--disable-features=site-per-process",
|
||||||
|
# "--disable-setuid-sandbox",
|
||||||
|
# "--disable-accelerated-2d-canvas",
|
||||||
|
# "--no-first-run",
|
||||||
|
# "--no-zygote",
|
||||||
|
# # '--single-process',
|
||||||
|
# "--disable-gpu",
|
||||||
|
# # "--use-gl=egl",
|
||||||
|
# "--disable-blink-features=AutomationControlled",
|
||||||
|
# # "--disable-background-networking",
|
||||||
|
# # "--enable-features=NetworkService,NetworkServiceInProcess",
|
||||||
|
# "--disable-background-timer-throttling",
|
||||||
|
# "--disable-backgrounding-occluded-windows",
|
||||||
|
# "--disable-breakpad",
|
||||||
|
# "--disable-client-side-phishing-detection",
|
||||||
|
# "--disable-component-extensions-with-background-pages",
|
||||||
|
# "--disable-default-apps",
|
||||||
|
# "--disable-extensions",
|
||||||
|
# "--disable-features=Translate",
|
||||||
|
# "--disable-hang-monitor",
|
||||||
|
# "--disable-ipc-flooding-protection",
|
||||||
|
# "--disable-popup-blocking",
|
||||||
|
# "--disable-prompt-on-repost",
|
||||||
|
# # "--disable-renderer-backgrounding",
|
||||||
|
# "--disable-sync",
|
||||||
|
# "--force-color-profile=srgb",
|
||||||
|
# # "--metrics-recording-only",
|
||||||
|
# # "--enable-automation",
|
||||||
|
# "--password-store=basic",
|
||||||
|
# # "--use-mock-keychain",
|
||||||
|
# # "--hide-scrollbars",
|
||||||
|
# "--mute-audio",
|
||||||
|
# ]
|
||||||
browser_args = [
|
browser_args = [
|
||||||
"--window-size=1300,570",
|
"--window-size=1300,570",
|
||||||
"--window-position=000,000",
|
"--window-position=0,0",
|
||||||
"--disable-dev-shm-usage",
|
# "--disable-dev-shm-usage",
|
||||||
"--no-sandbox",
|
"--no-sandbox",
|
||||||
"--disable-web-security",
|
# "--disable-web-security",
|
||||||
"--disable-features=site-per-process",
|
# "--disable-features=site-per-process",
|
||||||
"--disable-setuid-sandbox",
|
# "--disable-setuid-sandbox",
|
||||||
"--disable-accelerated-2d-canvas",
|
# "--disable-accelerated-2d-canvas",
|
||||||
"--no-first-run",
|
# "--no-first-run",
|
||||||
"--no-zygote",
|
# "--no-zygote",
|
||||||
# '--single-process',
|
# "--single-process",
|
||||||
"--disable-gpu",
|
"--disable-gpu",
|
||||||
"--use-gl=egl",
|
# "--use-gl=egl",
|
||||||
"--disable-blink-features=AutomationControlled",
|
|
||||||
"--disable-background-networking",
|
|
||||||
"--enable-features=NetworkService,NetworkServiceInProcess",
|
|
||||||
"--disable-background-timer-throttling",
|
|
||||||
"--disable-backgrounding-occluded-windows",
|
|
||||||
"--disable-breakpad",
|
|
||||||
"--disable-client-side-phishing-detection",
|
|
||||||
"--disable-component-extensions-with-background-pages",
|
|
||||||
"--disable-default-apps",
|
|
||||||
"--disable-extensions",
|
|
||||||
"--disable-features=Translate",
|
|
||||||
"--disable-hang-monitor",
|
|
||||||
"--disable-ipc-flooding-protection",
|
|
||||||
"--disable-popup-blocking",
|
|
||||||
"--disable-prompt-on-repost",
|
|
||||||
"--disable-renderer-backgrounding",
|
|
||||||
"--disable-sync",
|
|
||||||
"--force-color-profile=srgb",
|
|
||||||
"--metrics-recording-only",
|
|
||||||
"--enable-automation",
|
|
||||||
"--password-store=basic",
|
|
||||||
"--use-mock-keychain",
|
|
||||||
"--hide-scrollbars",
|
|
||||||
"--mute-audio",
|
"--mute-audio",
|
||||||
]
|
]
|
||||||
# scraper = cloudscraper.create_scraper(
|
# scraper = cloudscraper.create_scraper(
|
||||||
@@ -302,7 +318,8 @@ class LogicAniLife(LogicModuleBase):
|
|||||||
url, wait_until="load", referer=LogicAniLife.headers["Referer"]
|
url, wait_until="load", referer=LogicAniLife.headers["Referer"]
|
||||||
)
|
)
|
||||||
# page.wait_for_timeout(10000)
|
# page.wait_for_timeout(10000)
|
||||||
await asyncio.sleep(2.9)
|
# await asyncio.sleep(2.9)
|
||||||
|
await asyncio.sleep(1)
|
||||||
|
|
||||||
# await page.reload()
|
# await page.reload()
|
||||||
|
|
||||||
@@ -313,11 +330,13 @@ class LogicAniLife(LogicModuleBase):
|
|||||||
print(f"page.url:: {page.url}")
|
print(f"page.url:: {page.url}")
|
||||||
LogicAniLife.origin_url = page.url
|
LogicAniLife.origin_url = page.url
|
||||||
|
|
||||||
# print(page.content())
|
temp_content = await page.content()
|
||||||
|
#
|
||||||
|
# print(temp_content)
|
||||||
|
|
||||||
print(f"run at {time.time() - start} sec")
|
print(f"run at {time.time() - start} sec")
|
||||||
|
|
||||||
return await page.content()
|
return temp_content
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Exception:%s", e)
|
logger.error("Exception:%s", e)
|
||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
@@ -922,8 +941,25 @@ class LogicAniLife(LogicModuleBase):
|
|||||||
return jsonify(ModelAniLifeItem.web_list(request))
|
return jsonify(ModelAniLifeItem.web_list(request))
|
||||||
elif sub == "db_remove":
|
elif sub == "db_remove":
|
||||||
return jsonify(ModelAniLifeItem.delete_by_id(req.form["id"]))
|
return jsonify(ModelAniLifeItem.delete_by_id(req.form["id"]))
|
||||||
|
elif sub == "add_whitelist":
|
||||||
|
try:
|
||||||
|
# params = request.get_data()
|
||||||
|
# logger.debug(f"params: {params}")
|
||||||
|
# data_code = request.args.get("data_code")
|
||||||
|
params = request.get_json()
|
||||||
|
logger.debug(f"params:: {params}")
|
||||||
|
if params is not None:
|
||||||
|
code = params["data_code"]
|
||||||
|
logger.debug(f"params: {code}")
|
||||||
|
ret = LogicOhli24.add_whitelist(code)
|
||||||
|
else:
|
||||||
|
ret = LogicOhli24.add_whitelist()
|
||||||
|
return jsonify(ret)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error("Exception:%s", e)
|
||||||
|
logger.error(traceback.format_exc())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
P.logger.error("Exception:%s", e)
|
P.logger.error(f"Exception: {str(e)}")
|
||||||
P.logger.error(traceback.format_exc())
|
P.logger.error(traceback.format_exc())
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -1268,7 +1304,7 @@ class AniLifeQueueEntity(FfmpegQueueEntity):
|
|||||||
db_entity = ModelAniLifeItem.get_by_anilife_id(self.info["_id"])
|
db_entity = ModelAniLifeItem.get_by_anilife_id(self.info["_id"])
|
||||||
if db_entity is not None:
|
if db_entity is not None:
|
||||||
db_entity.status = "completed"
|
db_entity.status = "completed"
|
||||||
db_entity.complated_time = datetime.now()
|
db_entity.completed_time = datetime.now()
|
||||||
db_entity.save()
|
db_entity.save()
|
||||||
|
|
||||||
def make_episode_info(self):
|
def make_episode_info(self):
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,10 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<form id="form_search" class="form-inline" style="text-align:left">
|
<form id="form_search" class="form-inline" style="text-align:left">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row show-grid">
|
<div class="row show-grid">
|
||||||
<span class="col-md-4">
|
<span class="col-md-4">
|
||||||
<select id="order" name="order" class="form-control form-control-sm">
|
<select id="order" name="order" class="form-control form-control-sm">
|
||||||
<option value="desc">최근순</option>
|
<option value="desc">최근순</option>
|
||||||
@@ -15,158 +15,191 @@
|
|||||||
<option value="completed">완료</option>
|
<option value="completed">완료</option>
|
||||||
</select>
|
</select>
|
||||||
</span>
|
</span>
|
||||||
<span class="col-md-8">
|
<span class="col-md-8">
|
||||||
<input id="search_word" name="search_word" class="form-control form-control-sm w-75" type="text" placeholder="" aria-label="Search">
|
<input id="search_word" name="search_word" class="form-control form-control-sm w-75" type="text"
|
||||||
|
placeholder="" aria-label="Search">
|
||||||
<button id="search" class="btn btn-sm btn-outline-success">검색</button>
|
<button id="search" class="btn btn-sm btn-outline-success">검색</button>
|
||||||
<button id="reset_btn" class="btn btn-sm btn-outline-success">리셋</button>
|
<button id="reset_btn" class="btn btn-sm btn-outline-success">리셋</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div id='page1'></div>
|
<div id='page1'></div>
|
||||||
{{ macros.m_hr_head_top() }}
|
{{ macros.m_hr_head_top() }}
|
||||||
{{ macros.m_row_start('0') }}
|
{{ macros.m_row_start('0') }}
|
||||||
{{ macros.m_col(2, macros.m_strong('Poster')) }}
|
{{ macros.m_col(2, macros.m_strong('Poster')) }}
|
||||||
{{ macros.m_col(10, macros.m_strong('Info')) }}
|
{{ macros.m_col(10, macros.m_strong('Info')) }}
|
||||||
{{ macros.m_row_end() }}
|
{{ macros.m_row_end() }}
|
||||||
{{ macros.m_hr_head_bottom() }}
|
{{ macros.m_hr_head_bottom() }}
|
||||||
<div id="list_div"></div>
|
<div id="list_div"></div>
|
||||||
<div id='page2'></div>
|
<div id='page2'></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var package_name = "{{arg['package_name']}}";
|
var package_name = "{{arg['package_name']}}";
|
||||||
var sub = "{{arg['sub']}}";
|
var sub = "{{arg['sub']}}";
|
||||||
var current_data = null;
|
var current_data = null;
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function () {
|
||||||
global_sub_request_search('1');
|
global_sub_request_search('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#search").click(function(e) {
|
$("#search").click(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
global_sub_request_search('1');
|
global_sub_request_search('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
$("body").on('click', '#page', function(e){
|
$("body").on('click', '#page', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
global_sub_request_search($(this).data('page'));
|
global_sub_request_search($(this).data('page'));
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#reset_btn").click(function(e) {
|
$("#reset_btn").click(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
document.getElementById("order").value = 'desc';
|
document.getElementById("order").value = 'desc';
|
||||||
document.getElementById("option").value = 'all';
|
document.getElementById("option").value = 'all';
|
||||||
document.getElementById("search_word").value = '';
|
document.getElementById("search_word").value = '';
|
||||||
global_sub_request_search('1')
|
global_sub_request_search('1')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$("body").on('click', '#json_btn', function(e){
|
$("body").on('click', '#json_btn', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var id = $(this).data('id');
|
var id = $(this).data('id');
|
||||||
for (i in current_data.list) {
|
for (i in current_data.list) {
|
||||||
if (current_data.list[i].id == id) {
|
if (current_data.list[i].id == id) {
|
||||||
m_modal(current_data.list[i])
|
m_modal(current_data.list[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("body").on('click', '#self_search_btn', function(e){
|
$("body").on('click', '#self_search_btn', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var search_word = $(this).data('title');
|
var search_word = $(this).data('title');
|
||||||
document.getElementById("search_word").value = search_word;
|
document.getElementById("search_word").value = search_word;
|
||||||
global_sub_request_search('1')
|
global_sub_request_search('1')
|
||||||
});
|
});
|
||||||
|
|
||||||
$("body").on('click', '#remove_btn', function(e) {
|
$("body").on('click', '#remove_btn', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
id = $(this).data('id');
|
id = $(this).data('id');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/'+package_name+'/ajax/'+sub+ '/db_remove',
|
url: '/' + package_name + '/ajax/' + sub + '/db_remove',
|
||||||
type: "POST",
|
type: "POST",
|
||||||
cache: false,
|
cache: false,
|
||||||
data: {id:id},
|
data: {id: id},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$.notify('<strong>삭제되었습니다.</strong>', {
|
$.notify('<strong>삭제되었습니다.</strong>', {
|
||||||
type: 'success'
|
type: 'success'
|
||||||
|
});
|
||||||
|
global_sub_request_search(current_data.paging.current_page, false)
|
||||||
|
} else {
|
||||||
|
$.notify('<strong>삭제 실패</strong>', {
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
global_sub_request_search(current_data.paging.current_page, false)
|
});
|
||||||
} else {
|
|
||||||
$.notify('<strong>삭제 실패</strong>', {
|
$("body").on('click', '#request_btn', function (e) {
|
||||||
type: 'warning'
|
e.preventDefault();
|
||||||
});
|
var content_code = $(this).data('content_code');
|
||||||
}
|
$(location).attr('href', '/' + package_name + '/' + sub + '/request?content_code=' + content_code)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function make_list(data) {
|
||||||
|
//console.log(data)
|
||||||
|
str = '';
|
||||||
|
for (i in data) {
|
||||||
|
//console.log(data[i])
|
||||||
|
str += m_row_start();
|
||||||
|
str += m_col(1, data[i].id);
|
||||||
|
tmp = (data[i].status == 'completed') ? '완료' : '미완료';
|
||||||
|
str += m_col(1, tmp);
|
||||||
|
tmp = data[i].created_time + '(추가)';
|
||||||
|
if (data[i].completed_time != null)
|
||||||
|
tmp += data[i].completed_time + '(완료)';
|
||||||
|
str += m_col(3, tmp)
|
||||||
|
tmp = data[i].savepath + '<br>' + data[i].filename + '<br><br>';
|
||||||
|
tmp2 = m_button('json_btn', 'JSON', [{'key': 'id', 'value': data[i].id}]);
|
||||||
|
tmp2 += m_button('request_btn', '작품 검색', [{'key': 'content_code', 'value': data[i].content_code}]);
|
||||||
|
tmp2 += m_button('self_search_btn', '목록 검색', [{'key': 'title', 'value': data[i].title}]);
|
||||||
|
tmp2 += m_button('remove_btn', '삭제', [{'key': 'id', 'value': data[i].id}]);
|
||||||
|
tmp += m_button_group(tmp2)
|
||||||
|
str += m_col(7, tmp)
|
||||||
|
str += m_row_end();
|
||||||
|
if (i != data.length - 1) str += m_hr();
|
||||||
|
}
|
||||||
|
document.getElementById("list_div").innerHTML = str;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$("body").on('click', '#request_btn', function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
var content_code = $(this).data('content_code');
|
|
||||||
$(location).attr('href', '/' + package_name + '/' + sub + '/request?content_code=' + content_code)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function make_list(data) {
|
|
||||||
//console.log(data)
|
|
||||||
str = '';
|
|
||||||
for (i in data) {
|
|
||||||
//console.log(data[i])
|
|
||||||
str += m_row_start();
|
|
||||||
str += m_col(1, data[i].id);
|
|
||||||
tmp = (data[i].status == 'completed') ? '완료' : '미완료';
|
|
||||||
str += m_col(1, tmp);
|
|
||||||
tmp = data[i].created_time + '(추가)';
|
|
||||||
if (data[i].completed_time != null)
|
|
||||||
tmp += data[i].completed_time + '(완료)';
|
|
||||||
str += m_col(3, tmp)
|
|
||||||
tmp = data[i].savepath + '<br>' + data[i].filename + '<br><br>';
|
|
||||||
tmp2 = m_button('json_btn', 'JSON', [{'key':'id', 'value':data[i].id}]);
|
|
||||||
tmp2 += m_button('request_btn', '작품 검색', [{'key':'content_code', 'value':data[i].content_code}]);
|
|
||||||
tmp2 += m_button('self_search_btn', '목록 검색', [{'key':'title', 'value':data[i].title}]);
|
|
||||||
tmp2 += m_button('remove_btn', '삭제', [{'key':'id', 'value':data[i].id}]);
|
|
||||||
tmp += m_button_group(tmp2)
|
|
||||||
str += m_col(7, tmp)
|
|
||||||
str += m_row_end();
|
|
||||||
if (i != data.length -1) str += m_hr();
|
|
||||||
}
|
|
||||||
document.getElementById("list_div").innerHTML = str;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/*height: 100vh;*/
|
/*height: 100vh;*/
|
||||||
/*display: flex;*/
|
/*display: flex;*/
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
background-size: 300% 300%;
|
background-size: 300% 300%;
|
||||||
background-image: linear-gradient(
|
background-image: linear-gradient(
|
||||||
-45deg,
|
-45deg,
|
||||||
rgba(59,173,227,1) 0%,
|
rgba(59, 173, 227, 1) 0%,
|
||||||
rgba(87,111,230,1) 25%,
|
rgba(87, 111, 230, 1) 25%,
|
||||||
rgba(152,68,183,1) 51%,
|
rgba(152, 68, 183, 1) 51%,
|
||||||
rgba(255,53,127,1) 100%
|
rgba(255, 53, 127, 1) 100%
|
||||||
);
|
);
|
||||||
animation: AnimateBG 20s ease infinite;
|
animation: AnimateBG 20s ease infinite;
|
||||||
}
|
}
|
||||||
#main_container {
|
|
||||||
background-color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes AnimateBG {
|
#main_container {
|
||||||
0%{background-position:0% 50%}
|
background-color: white;
|
||||||
50%{background-position:100% 50%}
|
}
|
||||||
100%{background-position:0% 50%}
|
|
||||||
}
|
@keyframes AnimateBG {
|
||||||
|
0% {
|
||||||
|
background-position: 0% 50%
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
background-position: 100% 50%
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
background-position: 0% 50%
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 576px) {
|
||||||
|
.container {
|
||||||
|
max-width: 540px;
|
||||||
|
min-height: 1080px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.container {
|
||||||
|
max-width: 720px;
|
||||||
|
min-height: 1080px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 992px) {
|
||||||
|
.container {
|
||||||
|
max-width: 960px;
|
||||||
|
min-height: 1080px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1200px) {
|
||||||
|
.container {
|
||||||
|
max-width: 1140px;
|
||||||
|
min-height: 1080px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user