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
|
||||
|
||||
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 = [
|
||||
"--window-size=1300,570",
|
||||
"--window-position=000,000",
|
||||
"--disable-dev-shm-usage",
|
||||
"--window-position=0,0",
|
||||
# "--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-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",
|
||||
# "--use-gl=egl",
|
||||
"--mute-audio",
|
||||
]
|
||||
# scraper = cloudscraper.create_scraper(
|
||||
@@ -302,7 +318,8 @@ class LogicAniLife(LogicModuleBase):
|
||||
url, wait_until="load", referer=LogicAniLife.headers["Referer"]
|
||||
)
|
||||
# page.wait_for_timeout(10000)
|
||||
await asyncio.sleep(2.9)
|
||||
# await asyncio.sleep(2.9)
|
||||
await asyncio.sleep(1)
|
||||
|
||||
# await page.reload()
|
||||
|
||||
@@ -313,11 +330,13 @@ class LogicAniLife(LogicModuleBase):
|
||||
print(f"page.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")
|
||||
|
||||
return await page.content()
|
||||
return temp_content
|
||||
except Exception as e:
|
||||
logger.error("Exception:%s", e)
|
||||
logger.error(traceback.format_exc())
|
||||
@@ -922,8 +941,25 @@ class LogicAniLife(LogicModuleBase):
|
||||
return jsonify(ModelAniLifeItem.web_list(request))
|
||||
elif sub == "db_remove":
|
||||
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:
|
||||
P.logger.error("Exception:%s", e)
|
||||
P.logger.error(f"Exception: {str(e)}")
|
||||
P.logger.error(traceback.format_exc())
|
||||
|
||||
@staticmethod
|
||||
@@ -1268,7 +1304,7 @@ class AniLifeQueueEntity(FfmpegQueueEntity):
|
||||
db_entity = ModelAniLifeItem.get_by_anilife_id(self.info["_id"])
|
||||
if db_entity is not None:
|
||||
db_entity.status = "completed"
|
||||
db_entity.complated_time = datetime.now()
|
||||
db_entity.completed_time = datetime.now()
|
||||
db_entity.save()
|
||||
|
||||
def make_episode_info(self):
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,9 +2,9 @@
|
||||
{% block content %}
|
||||
|
||||
<div>
|
||||
<form id="form_search" class="form-inline" style="text-align:left">
|
||||
<div class="container-fluid">
|
||||
<div class="row show-grid">
|
||||
<form id="form_search" class="form-inline" style="text-align:left">
|
||||
<div class="container-fluid">
|
||||
<div class="row show-grid">
|
||||
<span class="col-md-4">
|
||||
<select id="order" name="order" class="form-control form-control-sm">
|
||||
<option value="desc">최근순</option>
|
||||
@@ -15,158 +15,191 @@
|
||||
<option value="completed">완료</option>
|
||||
</select>
|
||||
</span>
|
||||
<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">
|
||||
<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">
|
||||
<button id="search" class="btn btn-sm btn-outline-success">검색</button>
|
||||
<button id="reset_btn" class="btn btn-sm btn-outline-success">리셋</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div id='page1'></div>
|
||||
{{ macros.m_hr_head_top() }}
|
||||
{{ macros.m_row_start('0') }}
|
||||
{{ macros.m_col(2, macros.m_strong('Poster')) }}
|
||||
{{ macros.m_col(10, macros.m_strong('Info')) }}
|
||||
{{ macros.m_row_end() }}
|
||||
{{ macros.m_hr_head_bottom() }}
|
||||
<div id="list_div"></div>
|
||||
<div id='page2'></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div id='page1'></div>
|
||||
{{ macros.m_hr_head_top() }}
|
||||
{{ macros.m_row_start('0') }}
|
||||
{{ macros.m_col(2, macros.m_strong('Poster')) }}
|
||||
{{ macros.m_col(10, macros.m_strong('Info')) }}
|
||||
{{ macros.m_row_end() }}
|
||||
{{ macros.m_hr_head_bottom() }}
|
||||
<div id="list_div"></div>
|
||||
<div id='page2'></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var package_name = "{{arg['package_name']}}";
|
||||
var sub = "{{arg['sub']}}";
|
||||
var current_data = null;
|
||||
var package_name = "{{arg['package_name']}}";
|
||||
var sub = "{{arg['sub']}}";
|
||||
var current_data = null;
|
||||
|
||||
$(document).ready(function(){
|
||||
global_sub_request_search('1');
|
||||
});
|
||||
$(document).ready(function () {
|
||||
global_sub_request_search('1');
|
||||
});
|
||||
|
||||
$("#search").click(function(e) {
|
||||
e.preventDefault();
|
||||
global_sub_request_search('1');
|
||||
});
|
||||
$("#search").click(function (e) {
|
||||
e.preventDefault();
|
||||
global_sub_request_search('1');
|
||||
});
|
||||
|
||||
$("body").on('click', '#page', function(e){
|
||||
e.preventDefault();
|
||||
global_sub_request_search($(this).data('page'));
|
||||
});
|
||||
$("body").on('click', '#page', function (e) {
|
||||
e.preventDefault();
|
||||
global_sub_request_search($(this).data('page'));
|
||||
});
|
||||
|
||||
$("#reset_btn").click(function(e) {
|
||||
e.preventDefault();
|
||||
document.getElementById("order").value = 'desc';
|
||||
document.getElementById("option").value = 'all';
|
||||
document.getElementById("search_word").value = '';
|
||||
global_sub_request_search('1')
|
||||
});
|
||||
$("#reset_btn").click(function (e) {
|
||||
e.preventDefault();
|
||||
document.getElementById("order").value = 'desc';
|
||||
document.getElementById("option").value = 'all';
|
||||
document.getElementById("search_word").value = '';
|
||||
global_sub_request_search('1')
|
||||
});
|
||||
|
||||
|
||||
$("body").on('click', '#json_btn', function(e){
|
||||
e.preventDefault();
|
||||
var id = $(this).data('id');
|
||||
for (i in current_data.list) {
|
||||
if (current_data.list[i].id == id) {
|
||||
m_modal(current_data.list[i])
|
||||
}
|
||||
}
|
||||
});
|
||||
$("body").on('click', '#json_btn', function (e) {
|
||||
e.preventDefault();
|
||||
var id = $(this).data('id');
|
||||
for (i in current_data.list) {
|
||||
if (current_data.list[i].id == id) {
|
||||
m_modal(current_data.list[i])
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("body").on('click', '#self_search_btn', function(e){
|
||||
e.preventDefault();
|
||||
var search_word = $(this).data('title');
|
||||
document.getElementById("search_word").value = search_word;
|
||||
global_sub_request_search('1')
|
||||
});
|
||||
$("body").on('click', '#self_search_btn', function (e) {
|
||||
e.preventDefault();
|
||||
var search_word = $(this).data('title');
|
||||
document.getElementById("search_word").value = search_word;
|
||||
global_sub_request_search('1')
|
||||
});
|
||||
|
||||
$("body").on('click', '#remove_btn', function(e) {
|
||||
e.preventDefault();
|
||||
id = $(this).data('id');
|
||||
$.ajax({
|
||||
url: '/'+package_name+'/ajax/'+sub+ '/db_remove',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {id:id},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data) {
|
||||
$.notify('<strong>삭제되었습니다.</strong>', {
|
||||
type: 'success'
|
||||
$("body").on('click', '#remove_btn', function (e) {
|
||||
e.preventDefault();
|
||||
id = $(this).data('id');
|
||||
$.ajax({
|
||||
url: '/' + package_name + '/ajax/' + sub + '/db_remove',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {id: id},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data) {
|
||||
$.notify('<strong>삭제되었습니다.</strong>', {
|
||||
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>', {
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("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;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("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>
|
||||
<style>
|
||||
body {
|
||||
width: 100%;
|
||||
/*height: 100vh;*/
|
||||
/*display: flex;*/
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-size: 300% 300%;
|
||||
background-image: linear-gradient(
|
||||
-45deg,
|
||||
rgba(59,173,227,1) 0%,
|
||||
rgba(87,111,230,1) 25%,
|
||||
rgba(152,68,183,1) 51%,
|
||||
rgba(255,53,127,1) 100%
|
||||
);
|
||||
animation: AnimateBG 20s ease infinite;
|
||||
}
|
||||
#main_container {
|
||||
background-color: white;
|
||||
}
|
||||
body {
|
||||
width: 100%;
|
||||
/*height: 100vh;*/
|
||||
/*display: flex;*/
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-size: 300% 300%;
|
||||
background-image: linear-gradient(
|
||||
-45deg,
|
||||
rgba(59, 173, 227, 1) 0%,
|
||||
rgba(87, 111, 230, 1) 25%,
|
||||
rgba(152, 68, 183, 1) 51%,
|
||||
rgba(255, 53, 127, 1) 100%
|
||||
);
|
||||
animation: AnimateBG 20s ease infinite;
|
||||
}
|
||||
|
||||
@keyframes AnimateBG {
|
||||
0%{background-position:0% 50%}
|
||||
50%{background-position:100% 50%}
|
||||
100%{background-position:0% 50%}
|
||||
}
|
||||
#main_container {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
@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>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user