Compare commits
6 Commits
47a6407dfe
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 92771db871 | |||
| 4fef22f3df | |||
| a8138d4a71 | |||
| af3c43128d | |||
| 3b2c92a0e3 | |||
| 2ddda383c5 |
150
logic_anilife.py
150
logic_anilife.py
@@ -112,33 +112,14 @@ class LogicAniLife(LogicModuleBase):
|
||||
default_route_socketio(P, self)
|
||||
|
||||
@staticmethod
|
||||
def get_html(
|
||||
url: str, referer: str = None, stream: bool = False, timeout: int = 5
|
||||
) -> str:
|
||||
def get_html(url: str, referer: str = None, stream: bool = False, timeout: int = 5):
|
||||
data = ""
|
||||
try:
|
||||
print("cloudflare protection bypass ==================")
|
||||
# return LogicAniLife.get_html_cloudflare(url)
|
||||
return LogicAniLife.get_html_selenium(url, referer)
|
||||
# return LogicAniLife.get_html_playwright(url)
|
||||
# import browser_cookie3
|
||||
|
||||
# cj = browser_cookie3.chrome(domain_name="anilife.live")
|
||||
referer = "https://anilife.live/"
|
||||
|
||||
if LogicAniLife.session is None:
|
||||
LogicAniLife.session = requests.session()
|
||||
|
||||
# logger.debug('get_html :%s', url)
|
||||
LogicAniLife.headers["Referer"] = "" if referer is None else referer
|
||||
LogicAniLife.headers[
|
||||
"Cookie"
|
||||
] = "_ga=GA1.1.578607927.1660813724; __gads=ID=10abb8b98b6828ae-2281c943a9d500fd:T=1660813741:RT=1660813741:S=ALNI_MYU_iB2lBgSrEQUBwhKpNsToaqQ8A; sbtsck=javuwDzcOJqUyweM1OQeNGzHbjoHp7Cgw44XnPdM738c3E=; SPSI=e48379959d54a6a62cc7abdcafdb2761; SPSE=h5HfMGLJzLqzNafMD3YaOvHSC9xfh77CcWdKvexp/z5N5OsTkIiYSCudQhFffEfk/0pcOTVf0DpeV0RoNopzig==; anilife_csrf=b93b9f25a12a51cf185805ec4de7cf9d; UTGv2=h46b326af644f4ac5d0eb1502881136b3750; __gpi=UID=000008ba227e99e0:T=1660813741:RT=1660912282:S=ALNI_MaJHIVJIGpQ5nTE9lvypKQxJnn10A; DSR=SXPX8ELcRgh6N/9rNgjpQoNfaX2DRceeKYR0/ul7qTI9gApWQpZxr8jgymf/r0HsUT551vtOv2CMWpIn0Hd26A==; DCSS=89508000A76BBD939F6DDACE5BD9EB902D2212A; DGCC=Wdm; adOtr=7L4Xe58995d; spcsrf=6554fa003bf6a46dd9b7417acfacc20a; _ga_56VYJJ7FTM=GS1.1.1660912281.10.1.1660912576.0.0.0; PRLST=EO"
|
||||
|
||||
page_content = LogicAniLife.session.get(
|
||||
url, headers=headers, timeout=timeout, allow_redirects=True
|
||||
)
|
||||
data = page_content.text
|
||||
except Exception as e:
|
||||
logger.error("Exception:%s", e)
|
||||
logger.error(traceback.format_exc())
|
||||
@@ -638,7 +619,7 @@ class LogicAniLife(LogicModuleBase):
|
||||
|
||||
stealth(
|
||||
driver,
|
||||
languages=["en-US", "en"],
|
||||
languages=["ko-KR", "ko"],
|
||||
vendor="Google Inc.",
|
||||
platform="Win32",
|
||||
webgl_vendor="Intel Inc.",
|
||||
@@ -762,7 +743,7 @@ class LogicAniLife(LogicModuleBase):
|
||||
# print(scraper.get(url, headers=LogicAniLife.headers).content)
|
||||
# print(scraper.get(url).content)
|
||||
# return scraper.get(url, headers=LogicAniLife.headers).content
|
||||
print(LogicAniLife.headers)
|
||||
# print(LogicAniLife.headers)
|
||||
return sess.get(
|
||||
url, headers=LogicAniLife.session.headers, timeout=10, allow_redirects=True
|
||||
).content.decode("utf8", errors="replace")
|
||||
@@ -775,6 +756,8 @@ class LogicAniLife(LogicModuleBase):
|
||||
arg = P.ModelSetting.to_dict()
|
||||
arg["sub"] = self.name
|
||||
if sub in ["setting", "queue", "list", "category", "request"]:
|
||||
if sub == "request" and req.args.get("content_code") is not None:
|
||||
arg["anilife_current_code"] = req.args.get("content_code")
|
||||
if sub == "setting":
|
||||
job_id = "%s_%s" % (self.P.package_name, self.name)
|
||||
arg["scheduler"] = str(scheduler.is_include(job_id))
|
||||
@@ -813,6 +796,37 @@ class LogicAniLife(LogicModuleBase):
|
||||
return jsonify(
|
||||
{"ret": "success", "cate": cate, "page": page, "data": data}
|
||||
)
|
||||
elif sub == "complete_list":
|
||||
data = []
|
||||
|
||||
cate = request.form["type"]
|
||||
logger.debug("cate:: %s", cate)
|
||||
page = request.form["page"]
|
||||
|
||||
data = self.get_anime_info(cate, page)
|
||||
# self.current_data = data
|
||||
return jsonify(
|
||||
{"ret": "success", "cate": cate, "page": page, "data": data}
|
||||
)
|
||||
elif sub == "search":
|
||||
data = []
|
||||
# cate = request.form["type"]
|
||||
# page = request.form["page"]
|
||||
cate = request.form["type"]
|
||||
query = request.form["query"]
|
||||
page = request.form["page"]
|
||||
|
||||
data = self.get_search_result(query, page, cate)
|
||||
# self.current_data = data
|
||||
return jsonify(
|
||||
{
|
||||
"ret": "success",
|
||||
"cate": cate,
|
||||
"page": page,
|
||||
"query": query,
|
||||
"data": data,
|
||||
}
|
||||
)
|
||||
elif sub == "add_queue":
|
||||
logger.debug(f"add_queue routine ===============")
|
||||
ret = {}
|
||||
@@ -851,11 +865,65 @@ class LogicAniLife(LogicModuleBase):
|
||||
return jsonify("")
|
||||
elif sub == "web_list":
|
||||
return jsonify(ModelAniLifeItem.web_list(request))
|
||||
|
||||
elif sub == "db_remove":
|
||||
return jsonify(ModelAniLifeItem.delete_by_id(req.form["id"]))
|
||||
except Exception as e:
|
||||
P.logger.error("Exception:%s", e)
|
||||
P.logger.error(traceback.format_exc())
|
||||
|
||||
@staticmethod
|
||||
def add_whitelist(*args):
|
||||
ret = {}
|
||||
|
||||
logger.debug(f"args: {args}")
|
||||
try:
|
||||
|
||||
if len(args) == 0:
|
||||
code = str(LogicAniLife.current_data["code"])
|
||||
else:
|
||||
code = str(args[0])
|
||||
|
||||
print(code)
|
||||
|
||||
whitelist_program = P.ModelSetting.get("anilife_auto_code_list")
|
||||
# whitelist_programs = [
|
||||
# str(x.strip().replace(" ", ""))
|
||||
# for x in whitelist_program.replace("\n", "|").split("|")
|
||||
# ]
|
||||
whitelist_programs = [
|
||||
str(x.strip()) for x in whitelist_program.replace("\n", "|").split("|")
|
||||
]
|
||||
|
||||
if code not in whitelist_programs:
|
||||
whitelist_programs.append(code)
|
||||
whitelist_programs = filter(
|
||||
lambda x: x != "", whitelist_programs
|
||||
) # remove blank code
|
||||
whitelist_program = "|".join(whitelist_programs)
|
||||
entity = (
|
||||
db.session.query(P.ModelSetting)
|
||||
.filter_by(key="anilife_auto_code_list")
|
||||
.with_for_update()
|
||||
.first()
|
||||
)
|
||||
entity.value = whitelist_program
|
||||
db.session.commit()
|
||||
ret["ret"] = True
|
||||
ret["code"] = code
|
||||
if len(args) == 0:
|
||||
return LogicAniLife.current_data
|
||||
else:
|
||||
return ret
|
||||
else:
|
||||
ret["ret"] = False
|
||||
ret["log"] = "이미 추가되어 있습니다."
|
||||
except Exception as e:
|
||||
logger.error("Exception:%s", e)
|
||||
logger.error(traceback.format_exc())
|
||||
ret["ret"] = False
|
||||
ret["log"] = str(e)
|
||||
return ret
|
||||
|
||||
def setting_save_after(self):
|
||||
if self.queue.get_max_ffmpeg_count() != P.ModelSetting.get_int(
|
||||
"anilife_max_ffmpeg_process_count"
|
||||
@@ -865,7 +933,12 @@ class LogicAniLife(LogicModuleBase):
|
||||
)
|
||||
|
||||
def scheduler_function(self):
|
||||
pass
|
||||
logger.debug(f"ohli24 scheduler_function::=========================")
|
||||
|
||||
content_code_list = P.ModelSetting.get_list("ohli24_auto_code_list", "|")
|
||||
url = f'{P.ModelSetting.get("anilife_url")}/dailyani'
|
||||
if "all" in content_code_list:
|
||||
ret_data = LogicAniLife.get_auto_anime_info(self, url=url)
|
||||
|
||||
def plugin_load(self):
|
||||
self.queue = FfmpegQueue(
|
||||
@@ -901,8 +974,7 @@ class LogicAniLife(LogicModuleBase):
|
||||
.text_content()
|
||||
.strip()
|
||||
)
|
||||
# print(des_items1)
|
||||
# print(len(des_items))
|
||||
|
||||
des = {}
|
||||
des_key = [
|
||||
"_otit",
|
||||
@@ -942,8 +1014,8 @@ class LogicAniLife(LogicModuleBase):
|
||||
"최근 방영일": "_recent_date",
|
||||
"개봉년도": "_release_year",
|
||||
}
|
||||
print(main_title)
|
||||
print(image)
|
||||
# print(main_title)
|
||||
# print(image)
|
||||
# print(des_items)
|
||||
|
||||
list_body_li = tree.xpath('//div[@class="eplister"]/ul/li')
|
||||
@@ -1052,9 +1124,9 @@ class LogicAniLife(LogicModuleBase):
|
||||
logger.info("url:::> %s", url)
|
||||
data = {}
|
||||
response_data = LogicAniLife.get_html(url, timeout=10)
|
||||
print(response_data)
|
||||
# logger.debug(response_data)
|
||||
|
||||
logger.debug(f"wrapper_xath:: {wrapper_xpath}")
|
||||
# logger.debug(f"wrapper_xath:: {wrapper_xpath}")
|
||||
tree = html.fromstring(response_data)
|
||||
tmp_items = tree.xpath(wrapper_xpath)
|
||||
data["anime_count"] = len(tmp_items)
|
||||
@@ -1066,7 +1138,7 @@ class LogicAniLife(LogicModuleBase):
|
||||
# logger.debug(entity["link"])
|
||||
p = re.compile(r"^[http?s://]+[a-zA-Z0-9-]+/[a-zA-Z0-9-_.?=]+$")
|
||||
|
||||
print(p.match(entity["link"]) != None)
|
||||
# print(p.match(entity["link"]) != None)
|
||||
if p.match(entity["link"]) is None:
|
||||
entity["link"] = P.ModelSetting.get("anilife_url") + entity["link"]
|
||||
# real_url = LogicAniLife.get_real_link(url=entity["link"])
|
||||
@@ -1216,7 +1288,7 @@ class AniLifeQueueEntity(FfmpegQueueEntity):
|
||||
match = re.compile(regex).search(text)
|
||||
|
||||
jawcloud_url = None
|
||||
print(match)
|
||||
# print(match)
|
||||
if match:
|
||||
jawcloud_url = match.group("jawcloud_url")
|
||||
|
||||
@@ -1334,6 +1406,10 @@ class ModelAniLifeItem(db.Model):
|
||||
)
|
||||
return ret
|
||||
|
||||
def save(self):
|
||||
db.session.add(self)
|
||||
db.session.commit()
|
||||
|
||||
@classmethod
|
||||
def get_by_id(cls, idx):
|
||||
return db.session.query(cls).filter_by(id=idx).first()
|
||||
@@ -1342,9 +1418,11 @@ class ModelAniLifeItem(db.Model):
|
||||
def get_by_anilife_id(cls, anilife_id):
|
||||
return db.session.query(cls).filter_by(anilife_id=anilife_id).first()
|
||||
|
||||
def save(self):
|
||||
db.session.add(self)
|
||||
@classmethod
|
||||
def delete_by_id(cls, idx):
|
||||
db.session.query(cls).filter_by(id=idx).delete()
|
||||
db.session.commit()
|
||||
return True
|
||||
|
||||
@classmethod
|
||||
def web_list(cls, req):
|
||||
@@ -1389,6 +1467,10 @@ class ModelAniLifeItem(db.Model):
|
||||
)
|
||||
return query
|
||||
|
||||
@classmethod
|
||||
def get_list_uncompleted(cls):
|
||||
return db.session.query(cls).filter(cls.status != "completed").all()
|
||||
|
||||
@classmethod
|
||||
def append(cls, q):
|
||||
item = ModelAniLifeItem()
|
||||
|
||||
@@ -804,7 +804,7 @@ class Ohli24QueueEntity(FfmpegQueueEntity):
|
||||
ourls = parse.urlparse(url)
|
||||
|
||||
headers = {
|
||||
"referer": f"{ourls.scheme}://{ourls.netloc}",
|
||||
"Referer": f"{ourls.scheme}://{ourls.netloc}",
|
||||
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Whale/3.12.129.46 Safari/537.36",
|
||||
}
|
||||
logger.debug("make_episode_info()::url==> %s", url)
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
{% extends "base.html" %} {% block content %}
|
||||
|
||||
<div id="preloader">
|
||||
<div class='demo'>
|
||||
<!-- <div class="loader-inner">-->
|
||||
<div class='circle'>
|
||||
<div class='inner'></div>
|
||||
</div>
|
||||
<div class='circle'>
|
||||
<div class='inner'></div>
|
||||
</div>
|
||||
<div class='circle'>
|
||||
<div class='inner'></div>
|
||||
</div>
|
||||
<div class='circle'>
|
||||
<div class='inner'></div>
|
||||
</div>
|
||||
<div class='circle'>
|
||||
<div class='inner'></div>
|
||||
</div>
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<input
|
||||
id="input_search"
|
||||
@@ -9,7 +29,7 @@
|
||||
aria-label="Search"
|
||||
aria-describedby="search-addon"
|
||||
/>
|
||||
<button id="btn_search" type="button" class="btn btn-outline-primary">
|
||||
<button id="btn_search" type="button" class="btn btn-primary">
|
||||
search
|
||||
</button>
|
||||
</div>
|
||||
@@ -70,6 +90,13 @@
|
||||
enableAutoReload: true // it will reload the new image when validating attributes changes
|
||||
});
|
||||
observer.observe();
|
||||
const loader = document.getElementById("preloader");
|
||||
|
||||
const dismissLoadingScreen = async function () {
|
||||
console.log("Before the delay")
|
||||
// await delay(2.5);
|
||||
loader.style.display = "none";
|
||||
};
|
||||
|
||||
|
||||
const get_anime_list = (type, page) => {
|
||||
@@ -128,6 +155,7 @@
|
||||
div_visible = true
|
||||
console.log(div_visible)
|
||||
}
|
||||
dismissLoadingScreen()
|
||||
next_page = page + 1
|
||||
}
|
||||
})
|
||||
@@ -660,5 +688,126 @@
|
||||
body {
|
||||
background-image: linear-gradient(90deg, #233f48, #6c6fa2, #768dae);
|
||||
}
|
||||
|
||||
.demo {
|
||||
width: 100px;
|
||||
height: 102px;
|
||||
border-radius: 100%;
|
||||
position: absolute;
|
||||
top: 45%;
|
||||
left: calc(50% - 50px);
|
||||
}
|
||||
|
||||
.circle {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.circle .inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 100%;
|
||||
border: 5px solid rgba(0, 255, 170, 0.7);
|
||||
border-right: none;
|
||||
border-top: none;
|
||||
backgroudn-clip: padding;
|
||||
box-shadow: inset 0px 0px 10px rgba(0, 255, 170, 0.15);
|
||||
}
|
||||
|
||||
@-webkit-keyframes spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.circle:nth-of-type(0) {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
.circle:nth-of-type(0) .inner {
|
||||
-webkit-animation: spin 2s infinite linear;
|
||||
animation: spin 2s infinite linear;
|
||||
}
|
||||
|
||||
.circle:nth-of-type(1) {
|
||||
transform: rotate(70deg);
|
||||
}
|
||||
|
||||
.circle:nth-of-type(1) .inner {
|
||||
-webkit-animation: spin 2s infinite linear;
|
||||
animation: spin 2s infinite linear;
|
||||
}
|
||||
|
||||
.circle:nth-of-type(2) {
|
||||
transform: rotate(140deg);
|
||||
}
|
||||
|
||||
.circle:nth-of-type(2) .inner {
|
||||
-webkit-animation: spin 2s infinite linear;
|
||||
animation: spin 2s infinite linear;
|
||||
}
|
||||
|
||||
.demo {
|
||||
-webkit-animation: spin 5s infinite linear;
|
||||
animation: spin 5s infinite linear;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
background: radial-gradient(#222, #000);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
/*position: fixed;*/
|
||||
right: 0;
|
||||
/*top: 0;*/
|
||||
z-index: 99999;
|
||||
opacity: 0.5;
|
||||
margin: 0 auto;
|
||||
transform: translate(-50%, -50%);
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
|
||||
}
|
||||
|
||||
.loader-inner {
|
||||
bottom: 0;
|
||||
height: 60px;
|
||||
left: 0;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
#preloader {
|
||||
/*background-color: green;*/
|
||||
/*color: white;*/
|
||||
/*height: 100vh;*/
|
||||
/*width: 100%;*/
|
||||
/*position: fixed;*/
|
||||
/*z-index: 100;*/
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
background: radial-gradient(#222, #000);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 99999;
|
||||
opacity: 0.5;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
<div>
|
||||
<div id="loader" class="loader">
|
||||
<div id="preloader" class="loader">
|
||||
<div class="loader-inner">
|
||||
<div class="loader-line-wrap">
|
||||
<div class="loader-line"></div>
|
||||
@@ -24,7 +24,7 @@
|
||||
<form id="program_list">
|
||||
{{ macros.setting_input_text_and_buttons('code', '작품 Code',
|
||||
[['analysis_btn', '분석'], ['go_anilife_btn', 'Go 애니라이프']], desc='예)
|
||||
"https://anilife.live/g/l?id=f6e83ec6-bd25-4d6c-9428-c10522687604" 이나 "f6e83ec6-bd25-4d6c-9428-c10522687604"')
|
||||
"https://anilife.live/detail/id/101 예> 원피스 코드: 101"')
|
||||
}}
|
||||
</form>
|
||||
<form id="program_auto_form">
|
||||
@@ -55,9 +55,48 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
const loader = document.getElementById("preloader");
|
||||
|
||||
const dismissLoadingScreen = async function () {
|
||||
console.log("Before the delay")
|
||||
// await delay(2.5);
|
||||
loader.style.display = "none";
|
||||
};
|
||||
|
||||
const wait_seconds = function () {
|
||||
// REFERENCE: https://www.w3schools.com/jsref/met_win_settimeout.asp
|
||||
let result = setTimeout(dismissLoadingScreen, 2500);
|
||||
console.log(result)
|
||||
};
|
||||
const init = function () {
|
||||
|
||||
}
|
||||
|
||||
function delay(n) {
|
||||
return new Promise(function (resolve) {
|
||||
setTimeout(resolve, n * 1000);
|
||||
});
|
||||
}
|
||||
|
||||
async function myAsyncFunction() {
|
||||
//Do what you want here
|
||||
console.log("Before the delay")
|
||||
|
||||
await delay(2.5);
|
||||
|
||||
console.log("After the delay")
|
||||
//Do what you want here too
|
||||
|
||||
}
|
||||
|
||||
// myAsyncFunction();
|
||||
// window.addEventListener("DOMContentLoaded", dismissLoadingScreen);
|
||||
|
||||
// window.addEventListener("DOMContentLoaded", wait_seconds);
|
||||
|
||||
function analyze(wr_id, bo_table) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation()
|
||||
// e.preventDefault();
|
||||
// e.stopPropagation()
|
||||
// e.preventDefault();
|
||||
const code = document.getElementById("code").value
|
||||
console.log(code)
|
||||
@@ -184,6 +223,7 @@
|
||||
$("#loader").css("display", 'none')
|
||||
// console.log('wr_id::', params.wr_id)
|
||||
|
||||
|
||||
});
|
||||
|
||||
$("#analysis_btn").unbind("click").bind('click', function (e) {
|
||||
@@ -203,7 +243,9 @@
|
||||
if (ret.ret === 'success' && ret.data != null) {
|
||||
// {#console.log(ret.code)#}
|
||||
console.log(ret.data)
|
||||
|
||||
make_program(ret.data)
|
||||
dismissLoadingScreen()
|
||||
} else {
|
||||
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
||||
}
|
||||
@@ -393,6 +435,25 @@
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#preloader {
|
||||
/*background-color: green;*/
|
||||
/*color: white;*/
|
||||
/*height: 100vh;*/
|
||||
/*width: 100%;*/
|
||||
/*position: fixed;*/
|
||||
/*z-index: 100;*/
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
background: radial-gradient(#222, #000);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 99999;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.loader {
|
||||
background: rgb(0, 0, 0, 0.8);
|
||||
background: radial-gradient(#222, #000);
|
||||
|
||||
@@ -1,4 +1,24 @@
|
||||
{% extends "base.html" %} {% block content %}
|
||||
<!--<div id="preloader"></div>-->
|
||||
<div id="preloader" class="loader">
|
||||
<div class="loader-inner">
|
||||
<div class="loader-line-wrap">
|
||||
<div class="loader-line"></div>
|
||||
</div>
|
||||
<div class="loader-line-wrap">
|
||||
<div class="loader-line"></div>
|
||||
</div>
|
||||
<div class="loader-line-wrap">
|
||||
<div class="loader-line"></div>
|
||||
</div>
|
||||
<div class="loader-line-wrap">
|
||||
<div class="loader-line"></div>
|
||||
</div>
|
||||
<div class="loader-line-wrap">
|
||||
<div class="loader-line"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="yommi_wrapper">
|
||||
<div class="input-group mb-2">
|
||||
<input
|
||||
@@ -62,6 +82,21 @@
|
||||
let current_cate = ''
|
||||
let current_query = ''
|
||||
|
||||
const loader = document.getElementById("preloader");
|
||||
|
||||
const dismissLoadingScreen = function () {
|
||||
loader.style.display = "none";
|
||||
};
|
||||
|
||||
const wait3seconds = function () {
|
||||
// REFERENCE: https://www.w3schools.com/jsref/met_win_settimeout.asp
|
||||
const result = setTimeout(dismissLoadingScreen, 2000);
|
||||
};
|
||||
|
||||
window.addEventListener("load", wait3seconds);
|
||||
// window.addEventListener("load", dismissLoadingScreen);
|
||||
|
||||
|
||||
const observer = lozad('.lozad', {
|
||||
rootMargin: '10px 0px', // syntax similar to that of CSS Margin
|
||||
threshold: 0.1, // ratio of element convergence
|
||||
@@ -751,6 +786,137 @@
|
||||
background-image: linear-gradient(90deg, #233f48, #6c6fa2, #768dae);
|
||||
}
|
||||
|
||||
#preloader {
|
||||
/*background-color: green;*/
|
||||
/*color: white;*/
|
||||
/*height: 100vh;*/
|
||||
/*width: 100%;*/
|
||||
/*position: fixed;*/
|
||||
/*z-index: 100;*/
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
background: radial-gradient(#222, #000);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 99999;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/*.loader {*/
|
||||
/* background: rgb(0, 0, 0, 0.8);*/
|
||||
/* background: radial-gradient(#222, #000);*/
|
||||
/* bottom: 0;*/
|
||||
/* left: 0;*/
|
||||
/* overflow: hidden;*/
|
||||
/* position: fixed;*/
|
||||
/* right: 0;*/
|
||||
/* top: 0;*/
|
||||
/* z-index: 99999;*/
|
||||
/*}*/
|
||||
|
||||
.loader-inner {
|
||||
bottom: 0;
|
||||
height: 60px;
|
||||
left: 0;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.loader-line-wrap {
|
||||
animation: spin 2000ms cubic-bezier(.175, .885, .32, 1.275) infinite;
|
||||
box-sizing: border-box;
|
||||
height: 50px;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
transform-origin: 50% 100%;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.loader-line {
|
||||
border: 4px solid transparent;
|
||||
border-radius: 100%;
|
||||
box-sizing: border-box;
|
||||
height: 100px;
|
||||
left: 0;
|
||||
margin: 0 auto;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.loader-line-wrap:nth-child(1) {
|
||||
animation-delay: -50ms;
|
||||
}
|
||||
|
||||
.loader-line-wrap:nth-child(2) {
|
||||
animation-delay: -100ms;
|
||||
}
|
||||
|
||||
.loader-line-wrap:nth-child(3) {
|
||||
animation-delay: -150ms;
|
||||
}
|
||||
|
||||
.loader-line-wrap:nth-child(4) {
|
||||
animation-delay: -200ms;
|
||||
}
|
||||
|
||||
.loader-line-wrap:nth-child(5) {
|
||||
animation-delay: -250ms;
|
||||
}
|
||||
|
||||
.loader-line-wrap:nth-child(1) .loader-line {
|
||||
border-color: hsl(0, 80%, 60%);
|
||||
height: 90px;
|
||||
width: 90px;
|
||||
top: 7px;
|
||||
}
|
||||
|
||||
.loader-line-wrap:nth-child(2) .loader-line {
|
||||
border-color: hsl(60, 80%, 60%);
|
||||
height: 76px;
|
||||
width: 76px;
|
||||
top: 14px;
|
||||
}
|
||||
|
||||
.loader-line-wrap:nth-child(3) .loader-line {
|
||||
border-color: hsl(120, 80%, 60%);
|
||||
height: 62px;
|
||||
width: 62px;
|
||||
top: 21px;
|
||||
}
|
||||
|
||||
.loader-line-wrap:nth-child(4) .loader-line {
|
||||
border-color: hsl(180, 80%, 60%);
|
||||
height: 48px;
|
||||
width: 48px;
|
||||
top: 28px;
|
||||
}
|
||||
|
||||
.loader-line-wrap:nth-child(5) .loader-line {
|
||||
border-color: hsl(240, 80%, 60%);
|
||||
height: 34px;
|
||||
width: 34px;
|
||||
top: 35px;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0%, 15% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.1/font/bootstrap-icons.css">
|
||||
|
||||
@@ -1,5 +1,25 @@
|
||||
{% extends "base.html" %} {% block content %}
|
||||
|
||||
<div id="preloader">
|
||||
<div class='demo'>
|
||||
<!-- <div class="loader-inner">-->
|
||||
<div class='circle'>
|
||||
<div class='inner'></div>
|
||||
</div>
|
||||
<div class='circle'>
|
||||
<div class='inner'></div>
|
||||
</div>
|
||||
<div class='circle'>
|
||||
<div class='inner'></div>
|
||||
</div>
|
||||
<div class='circle'>
|
||||
<div class='inner'></div>
|
||||
</div>
|
||||
<div class='circle'>
|
||||
<div class='inner'></div>
|
||||
</div>
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<form id="program_list">
|
||||
{{ macros.setting_input_text_and_buttons('code', '작품 Code',
|
||||
@@ -22,6 +42,19 @@
|
||||
get: (searchParams, prop) => searchParams.get(prop),
|
||||
})
|
||||
|
||||
const loader = document.getElementById("preloader");
|
||||
|
||||
const dismissLoadingScreen = function () {
|
||||
loader.style.display = "none";
|
||||
$('.demo').css("display", "none")
|
||||
};
|
||||
|
||||
const wait3seconds = function () {
|
||||
// REFERENCE: https://www.w3schools.com/jsref/met_win_settimeout.asp
|
||||
const result = setTimeout(dismissLoadingScreen, 2000);
|
||||
};
|
||||
|
||||
window.addEventListener("load", wait3seconds);
|
||||
|
||||
|
||||
function findGetParameter(parameterName) {
|
||||
@@ -85,10 +118,9 @@
|
||||
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.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 ? data.des._total_chapter : '') + m_row_end();
|
||||
tmp += m_row_start(2) + m_col(3, '상영시간', 'right') + m_col(9, data.des._show_time ? data.des._show_time : '') + m_row_end();
|
||||
@@ -98,21 +130,22 @@
|
||||
|
||||
str += m_hr_black();
|
||||
for (i in data.episode) {
|
||||
str += m_row_start(); tmp = '';
|
||||
str += m_row_start();
|
||||
tmp = '';
|
||||
if (data.episode[i].thumbnail)
|
||||
tmp = '<img src="'+ data.episode[i].thumbnail + '" class="img-fluid">'
|
||||
tmp = '<img src="' + data.episode[i].thumbnail + '" class="img-fluid">'
|
||||
str += m_col(3, tmp)
|
||||
tmp = '<strong>' + data.episode[i].title+ '</strong>';
|
||||
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 += '<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);
|
||||
if (i != data.length - 1) str += m_hr(0);
|
||||
}
|
||||
document.getElementById("episode_list").innerHTML = str;
|
||||
$('input[id^="checkbox_"]').bootstrapToggle()
|
||||
@@ -129,12 +162,12 @@
|
||||
// {#document.getElementById("analysis_btn").click();#}
|
||||
}
|
||||
|
||||
if ( "{{arg['ohli24_current_code']}}" !== "") {
|
||||
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 === '') {
|
||||
} else if (params.code === '') {
|
||||
document.getElementById("code").value = "{{arg['ohli24_current_code']}}";
|
||||
} else {
|
||||
|
||||
@@ -154,13 +187,13 @@
|
||||
|
||||
})
|
||||
|
||||
$(document).ready(function(){
|
||||
$(document).ready(function () {
|
||||
|
||||
console.log('wr_id::', params.wr_id)
|
||||
|
||||
});
|
||||
|
||||
$("#analysis_btn").unbind("click").bind('click', function(e){
|
||||
$("#analysis_btn").unbind("click").bind('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation()
|
||||
const code = document.getElementById("code").value
|
||||
@@ -169,7 +202,7 @@
|
||||
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {code:code},
|
||||
data: {code: code},
|
||||
dataType: "json",
|
||||
success: function (ret) {
|
||||
if (ret.ret === 'success' && ret.data != null) {
|
||||
@@ -184,22 +217,22 @@
|
||||
});
|
||||
|
||||
|
||||
$("body").on('click', '#go_ohli24_btn', function(e){
|
||||
$("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){
|
||||
$("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){
|
||||
$("body").on('click', '#all_check_off_btn', function (e) {
|
||||
e.preventDefault();
|
||||
$('input[id^="checkbox_"]').bootstrapToggle('off')
|
||||
});
|
||||
|
||||
$("body").on('click', '#add_queue_btn', function(e){
|
||||
$("body").on('click', '#add_queue_btn', function (e) {
|
||||
e.preventDefault();
|
||||
data = current_data.episode[$(this).data('idx')];
|
||||
console.log('data:::>', data)
|
||||
@@ -207,7 +240,7 @@
|
||||
url: '/' + package_name + '/ajax/' + sub + '/add_queue',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {data:JSON.stringify(data)},
|
||||
data: {data: JSON.stringify(data)},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
console.log('#add_queue_btn::data >>', data)
|
||||
@@ -225,7 +258,7 @@
|
||||
|
||||
});
|
||||
|
||||
$("body").on('click', '#check_download_btn', function(e){
|
||||
$("body").on('click', '#check_download_btn', function (e) {
|
||||
e.preventDefault();
|
||||
all = $('input[id^="checkbox_"]');
|
||||
let data = [];
|
||||
@@ -244,7 +277,7 @@
|
||||
url: '/' + package_name + '/ajax/' + sub + '/add_queue_checked_list',
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {data:JSON.stringify(data)},
|
||||
data: {data: JSON.stringify(data)},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
$.notify('<strong>백그라운드로 작업을 추가합니다.</strong>', {type: 'success'});
|
||||
@@ -256,6 +289,7 @@
|
||||
button.code-button {
|
||||
min-width: 82px !important;
|
||||
}
|
||||
|
||||
.tooltip {
|
||||
position: relative;
|
||||
display: block;
|
||||
@@ -304,6 +338,7 @@
|
||||
left: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
[data-tooltip-text]:hover {
|
||||
position: relative;
|
||||
}
|
||||
@@ -362,5 +397,151 @@
|
||||
#screen_movie_list {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/*@import url(https://fonts.googleapis.com/css?family=Lato);*/
|
||||
/*a {*/
|
||||
/* position: fixed;*/
|
||||
/* bottom: 2%;*/
|
||||
/* display: block;*/
|
||||
/* text-align: center;*/
|
||||
/* color: #0fa;*/
|
||||
/* font-family: "Lato", sans-serif;*/
|
||||
/* text-decoration: none !important;*/
|
||||
/* width: 100%;*/
|
||||
/*}*/
|
||||
|
||||
/*body, html {*/
|
||||
/* width: 100%;*/
|
||||
/* height: 100%;*/
|
||||
/* overflow: hidden;*/
|
||||
/*}*/
|
||||
|
||||
/*body {*/
|
||||
/* background: linear-gradient(90deg, #00b377, #00d68f);*/
|
||||
/* box-shadow: inset 0px 0px 90px rgba(0, 0, 0, 0.5);*/
|
||||
/* margin: 0px;*/
|
||||
/* padding: 0px;*/
|
||||
/*}*/
|
||||
|
||||
.demo {
|
||||
width: 100px;
|
||||
height: 102px;
|
||||
border-radius: 100%;
|
||||
position: absolute;
|
||||
top: 45%;
|
||||
left: calc(50% - 50px);
|
||||
}
|
||||
|
||||
.circle {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.circle .inner {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 100%;
|
||||
border: 5px solid rgba(0, 255, 170, 0.7);
|
||||
border-right: none;
|
||||
border-top: none;
|
||||
backgroudn-clip: padding;
|
||||
box-shadow: inset 0px 0px 10px rgba(0, 255, 170, 0.15);
|
||||
}
|
||||
|
||||
@-webkit-keyframes spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.circle:nth-of-type(0) {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
.circle:nth-of-type(0) .inner {
|
||||
-webkit-animation: spin 2s infinite linear;
|
||||
animation: spin 2s infinite linear;
|
||||
}
|
||||
|
||||
.circle:nth-of-type(1) {
|
||||
transform: rotate(70deg);
|
||||
}
|
||||
|
||||
.circle:nth-of-type(1) .inner {
|
||||
-webkit-animation: spin 2s infinite linear;
|
||||
animation: spin 2s infinite linear;
|
||||
}
|
||||
|
||||
.circle:nth-of-type(2) {
|
||||
transform: rotate(140deg);
|
||||
}
|
||||
|
||||
.circle:nth-of-type(2) .inner {
|
||||
-webkit-animation: spin 2s infinite linear;
|
||||
animation: spin 2s infinite linear;
|
||||
}
|
||||
|
||||
.demo {
|
||||
-webkit-animation: spin 5s infinite linear;
|
||||
animation: spin 5s infinite linear;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
background: radial-gradient(#222, #000);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
/*position: fixed;*/
|
||||
right: 0;
|
||||
/*top: 0;*/
|
||||
z-index: 99999;
|
||||
opacity: 0.5;
|
||||
margin: 0 auto;
|
||||
transform: translate(-50%, -50%);
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
|
||||
}
|
||||
|
||||
.loader-inner {
|
||||
bottom: 0;
|
||||
height: 60px;
|
||||
left: 0;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
#preloader {
|
||||
/*background-color: green;*/
|
||||
/*color: white;*/
|
||||
/*height: 100vh;*/
|
||||
/*width: 100%;*/
|
||||
/*position: fixed;*/
|
||||
/*z-index: 100;*/
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
background: radial-gradient(#222, #000);
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 99999;
|
||||
opacity: 0.5;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user