2022.10.30 (03. 링크 애니 요청 페이지 일부 수정)
This commit is contained in:
368
mod_linkkf.py
368
mod_linkkf.py
@@ -5,33 +5,34 @@
|
|||||||
# @Site :
|
# @Site :
|
||||||
# @File : logic_linkkf
|
# @File : logic_linkkf
|
||||||
# @Software: PyCharm
|
# @Software: PyCharm
|
||||||
import os, sys, traceback, re, json, threading
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
import traceback
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import copy
|
|
||||||
|
|
||||||
|
import PIL.Image
|
||||||
# third-party
|
# third-party
|
||||||
import requests
|
import requests
|
||||||
from lxml import html
|
from bs4 import BeautifulSoup
|
||||||
from urllib import parse
|
|
||||||
|
|
||||||
# third-party
|
# third-party
|
||||||
from flask import request, render_template, jsonify
|
from flask import jsonify, render_template, request
|
||||||
from sqlalchemy import or_, and_, func, not_, desc
|
|
||||||
|
|
||||||
# sjva 공용
|
# sjva 공용
|
||||||
from framework import db, scheduler, path_data, socketio
|
from framework import db, path_data, scheduler
|
||||||
from framework.util import Util
|
from lxml import html
|
||||||
from framework import F
|
from plugin import PluginModuleBase
|
||||||
from plugin import (
|
|
||||||
PluginModuleBase
|
from anime_downloader.lib.util import Util
|
||||||
)
|
# 패키지
|
||||||
from flaskfarm.lib.plugin._ffmpeg_queue import FfmpegQueueEntity, FfmpegQueue
|
# from .plugin import P
|
||||||
|
from anime_downloader.setup import *
|
||||||
|
|
||||||
|
# from linkkf.model import ModelLinkkfProgram
|
||||||
|
|
||||||
|
# from linkkf.model import ModelLinkkfProgram
|
||||||
|
|
||||||
# from tool_base import d
|
# from tool_base import d
|
||||||
|
|
||||||
# 패키지
|
|
||||||
# from .plugin import P
|
|
||||||
from .setup import *
|
|
||||||
|
|
||||||
logger = P.logger
|
logger = P.logger
|
||||||
|
|
||||||
@@ -58,6 +59,7 @@ class LogicLinkkf(PluginModuleBase):
|
|||||||
}
|
}
|
||||||
current_headers = None
|
current_headers = None
|
||||||
current_data = None
|
current_data = None
|
||||||
|
referer = None
|
||||||
|
|
||||||
session = requests.Session()
|
session = requests.Session()
|
||||||
headers = {
|
headers = {
|
||||||
@@ -107,8 +109,8 @@ class LogicLinkkf(PluginModuleBase):
|
|||||||
data = []
|
data = []
|
||||||
# print(code)
|
# print(code)
|
||||||
# logger.info("code::: %s", code)
|
# logger.info("code::: %s", code)
|
||||||
P.ModelSetting.set("ohli24_current_code", code)
|
P.ModelSetting.set("linkkf_current_code", code)
|
||||||
data = self.get_series_info(code, wr_id, bo_table)
|
data = self.get_series_info(code)
|
||||||
self.current_data = data
|
self.current_data = data
|
||||||
return jsonify({"ret": "success", "data": data, "code": code})
|
return jsonify({"ret": "success", "data": data, "code": code})
|
||||||
elif sub == "anime_list":
|
elif sub == "anime_list":
|
||||||
@@ -164,58 +166,270 @@ class LogicLinkkf(PluginModuleBase):
|
|||||||
def get_anime_info(self, cate, page):
|
def get_anime_info(self, cate, page):
|
||||||
try:
|
try:
|
||||||
if cate == "ing":
|
if cate == "ing":
|
||||||
url = (
|
url = f"{P.ModelSetting.get('linkkf_url')}/airing/page/{page}"
|
||||||
P.ModelSetting.get("ohli24_url")
|
items_xpath = '//div[@class="myui-vodlist__box"]'
|
||||||
+ "/bbs/board.php?bo_table="
|
title_xpath = './/a[@class="text-fff"]//text()'
|
||||||
+ cate
|
|
||||||
+ "&page="
|
|
||||||
+ page
|
|
||||||
)
|
|
||||||
elif cate == "movie":
|
elif cate == "movie":
|
||||||
url = (
|
url = f"{P.ModelSetting.get('linkkf_url')}/ani/page/{page}"
|
||||||
P.ModelSetting.get("ohli24_url")
|
items_xpath = '//div[@class="myui-vodlist__box"]'
|
||||||
+ "/bbs/board.php?bo_table="
|
title_xpath = './/a[@class="text-fff"]//text()'
|
||||||
+ cate
|
elif cate == "complete":
|
||||||
+ "&page="
|
url = f"{P.ModelSetting.get('linkkf_url')}/anime-list/page/{page}"
|
||||||
+ page
|
items_xpath = '//div[@class="myui-vodlist__box"]'
|
||||||
)
|
title_xpath = './/a[@class="text-fff"]//text()'
|
||||||
else:
|
elif cate == "top_view":
|
||||||
url = (
|
url = f"{P.ModelSetting.get('linkkf_url')}/topview/page/{page}"
|
||||||
P.ModelSetting.get("ohli24_url")
|
items_xpath = '//div[@class="myui-vodlist__box"]'
|
||||||
+ "/bbs/board.php?bo_table="
|
title_xpath = './/a[@class="text-fff"]//text()'
|
||||||
+ cate
|
|
||||||
+ "&page="
|
|
||||||
+ page
|
|
||||||
)
|
|
||||||
# cate == "complete":
|
|
||||||
logger.info("url:::> %s", url)
|
logger.info("url:::> %s", url)
|
||||||
data = {}
|
logger.info("test..........................")
|
||||||
response_data = LogicOhli24.get_html(url, timeout=10)
|
logger.info("test..........................")
|
||||||
|
if self.referer is None:
|
||||||
|
self.referer = "https://linkkf.app"
|
||||||
|
|
||||||
|
data = {"ret": "success", "page": page}
|
||||||
|
response_data = LogicLinkkf.get_html(url, timeout=10)
|
||||||
|
# P.logger.debug(response_data)
|
||||||
|
P.logger.debug("debug.....................")
|
||||||
tree = html.fromstring(response_data)
|
tree = html.fromstring(response_data)
|
||||||
tmp_items = tree.xpath('//div[@class="list-row"]')
|
tmp_items = tree.xpath(items_xpath)
|
||||||
data["anime_count"] = len(tmp_items)
|
|
||||||
data["anime_list"] = []
|
if tree.xpath('//div[@id="wp_page"]//text()'):
|
||||||
|
data["total_page"] = tree.xpath('//div[@id="wp_page"]//text()')[-1]
|
||||||
|
else:
|
||||||
|
data["total_page"] = 0
|
||||||
|
data["episode_count"] = len(tmp_items)
|
||||||
|
data["episode"] = []
|
||||||
|
|
||||||
for item in tmp_items:
|
for item in tmp_items:
|
||||||
entity = {}
|
entity = dict()
|
||||||
entity["link"] = item.xpath(".//a/@href")[0]
|
entity["link"] = item.xpath(".//a/@href")[0]
|
||||||
entity["code"] = entity["link"].split("/")[-1]
|
entity["code"] = re.search(r"[0-9]+", entity["link"]).group()
|
||||||
entity["title"] = item.xpath(".//div[@class='post-title']/text()")[
|
entity["title"] = item.xpath(title_xpath)[0].strip()
|
||||||
0
|
entity["image_link"] = item.xpath("./a/@data-original")[0]
|
||||||
].strip()
|
entity["chapter"] = (
|
||||||
entity["image_link"] = item.xpath(".//div[@class='img-item']/img/@src")[
|
item.xpath("./a/span//text()")[0].strip()
|
||||||
0
|
if len(item.xpath("./a/span//text()")) > 0
|
||||||
].replace("..", P.ModelSetting.get("ohli24_url"))
|
else ""
|
||||||
data["ret"] = "success"
|
)
|
||||||
data["anime_list"].append(entity)
|
# logger.info('entity:::', entity['title'])
|
||||||
|
data["episode"].append(entity)
|
||||||
|
|
||||||
|
# logger.debug(data)
|
||||||
|
|
||||||
return data
|
return data
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
P.logger.error("Exception:%s", e)
|
P.logger.error("Exception:%s", e)
|
||||||
P.logger.error(traceback.format_exc())
|
P.logger.error(traceback.format_exc())
|
||||||
return {"ret": "exception", "log": str(e)}
|
return {"ret": "exception", "log": str(e)}
|
||||||
|
|
||||||
|
def get_series_info(self, code):
|
||||||
|
data = {"code": code, "ret": False}
|
||||||
|
try:
|
||||||
|
# 이전 데이터가 있다면, 리턴 (# If you have previous data, return)
|
||||||
|
if (
|
||||||
|
LogicLinkkf.current_data is not None
|
||||||
|
and LogicLinkkf.current_data["code"] == code
|
||||||
|
and LogicLinkkf.current_data["ret"]
|
||||||
|
):
|
||||||
|
return LogicLinkkf.current_data
|
||||||
|
url = "%s/%s" % (P.ModelSetting.get("linkkf_url"), code)
|
||||||
|
logger.info(url)
|
||||||
|
|
||||||
|
logger.debug(LogicLinkkf.headers)
|
||||||
|
html_content = LogicLinkkf.get_html(url, cached=False)
|
||||||
|
# html_content = LogicLinkkf.get_html_playwright(url)
|
||||||
|
# html_content = LogicLinkkf.get_html_cloudflare(url, cached=False)
|
||||||
|
|
||||||
|
sys.setrecursionlimit(10 ** 7)
|
||||||
|
# logger.info(html_content)
|
||||||
|
tree = html.fromstring(html_content)
|
||||||
|
# tree = etree.fromstring(
|
||||||
|
# html_content, parser=etree.XMLParser(huge_tree=True)
|
||||||
|
# )
|
||||||
|
# tree1 = BeautifulSoup(html_content, "lxml")
|
||||||
|
|
||||||
|
soup = BeautifulSoup(html_content, "html.parser")
|
||||||
|
# tree = etree.HTML(str(soup))
|
||||||
|
# logger.info(tree)
|
||||||
|
|
||||||
|
tmp2 = soup.select("ul > a")
|
||||||
|
if len(tmp2) == 0:
|
||||||
|
tmp = soup.select("u > a")
|
||||||
|
else:
|
||||||
|
tmp = soup.select("ul > a")
|
||||||
|
|
||||||
|
# logger.debug(f"tmp1 size:=> {str(len(tmp))}")
|
||||||
|
|
||||||
|
try:
|
||||||
|
tmp = (
|
||||||
|
tree.xpath('//div[@class="hrecipe"]/article/center/strong')[0]
|
||||||
|
.text_content()
|
||||||
|
.strip()
|
||||||
|
)
|
||||||
|
except IndexError:
|
||||||
|
tmp = tree.xpath("//article/center/strong")[0].text_content().strip()
|
||||||
|
|
||||||
|
# logger.info(tmp)
|
||||||
|
match = re.compile(r"(?P<season>\d+)기").search(tmp)
|
||||||
|
if match:
|
||||||
|
data["season"] = match.group("season")
|
||||||
|
else:
|
||||||
|
data["season"] = "1"
|
||||||
|
|
||||||
|
data["_id"] = str(code)
|
||||||
|
data["title"] = tmp.replace(data["season"] + "기", "").strip()
|
||||||
|
data["title"] = data["title"].replace("()", "").strip()
|
||||||
|
data["title"] = (
|
||||||
|
Util.change_text_for_use_filename(data["title"])
|
||||||
|
.replace("OVA", "")
|
||||||
|
.strip()
|
||||||
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
data["poster_url"] = tree.xpath(
|
||||||
|
'//div[@class="myui-content__thumb"]/a/@data-original'
|
||||||
|
)
|
||||||
|
# print(tree.xpath('//div[@class="myui-content__detail"]/text()'))
|
||||||
|
if len(tree.xpath('//div[@class="myui-content__detail"]/text()')) > 3:
|
||||||
|
data["detail"] = [
|
||||||
|
{
|
||||||
|
"info": str(tree.xpath(
|
||||||
|
"//div[@class='myui-content__detail']/text()"
|
||||||
|
)[3])
|
||||||
|
}
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
data["detail"] = [{"정보없음": ""}]
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(e)
|
||||||
|
data["detail"] = [{"정보없음": ""}]
|
||||||
|
data["poster_url"] = None
|
||||||
|
|
||||||
|
data["rate"] = tree.xpath('span[@class="tag-score"]')
|
||||||
|
|
||||||
|
tag_score = tree.xpath('//span[@class="taq-score"]')[0].text_content()
|
||||||
|
# logger.debug(tag_score)
|
||||||
|
tag_count = (
|
||||||
|
tree.xpath('//span[contains(@class, "taq-count")]')[0]
|
||||||
|
.text_content()
|
||||||
|
.strip()
|
||||||
|
)
|
||||||
|
data_rate = tree.xpath('//div[@class="rating"]/div/@data-rate')
|
||||||
|
|
||||||
|
tmp2 = soup.select("ul > a")
|
||||||
|
if len(tmp) == 0:
|
||||||
|
tmp = soup.select("u > a")
|
||||||
|
else:
|
||||||
|
tmp = soup.select("ul > a")
|
||||||
|
|
||||||
|
if tmp is not None:
|
||||||
|
data["episode_count"] = str(len(tmp))
|
||||||
|
else:
|
||||||
|
data["episode_count"] = "0"
|
||||||
|
|
||||||
|
data["episode"] = []
|
||||||
|
# tags = tree.xpath(
|
||||||
|
# '//*[@id="syno-nsc-ext-gen3"]/article/div[1]/article/a')
|
||||||
|
# tags = tree.xpath("//ul/a")
|
||||||
|
tags = soup.select("ul > u > a")
|
||||||
|
if len(tags) > 0:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
tags = soup.select("ul > a")
|
||||||
|
|
||||||
|
logger.debug(len(tags))
|
||||||
|
|
||||||
|
# logger.info("tags", tags)
|
||||||
|
# re1 = re.compile(r'\/(?P<code>\d+)')
|
||||||
|
re1 = re.compile(r"\-([^-])+\.")
|
||||||
|
|
||||||
|
data["save_folder"] = data["title"]
|
||||||
|
# logger.debug(f"save_folder::> {data['save_folder']}")
|
||||||
|
|
||||||
|
# program = (
|
||||||
|
# db.session.query(ModelLinkkfProgram).filter_by(programcode=code).first()
|
||||||
|
# )
|
||||||
|
|
||||||
|
idx = 1
|
||||||
|
for t in tags:
|
||||||
|
entity = {
|
||||||
|
"_id": data["code"],
|
||||||
|
"program_code": data["code"],
|
||||||
|
"program_title": data["title"],
|
||||||
|
"save_folder": Util.change_text_for_use_filename(
|
||||||
|
data["save_folder"]
|
||||||
|
),
|
||||||
|
"title": t.text.strip(),
|
||||||
|
# "title": t.text_content().strip(),
|
||||||
|
}
|
||||||
|
# entity['code'] = re1.search(t.attrib['href']).group('code')
|
||||||
|
|
||||||
|
# logger.debug(f"title ::>{entity['title']}")
|
||||||
|
|
||||||
|
# 고유id임을 알수 없는 말도 안됨..
|
||||||
|
# 에피소드 코드가 고유해야 상태값 갱신이 제대로 된 값에 넣어짐
|
||||||
|
p = re.compile(r"([0-9]+)화?")
|
||||||
|
m_obj = p.match(entity["title"])
|
||||||
|
# logger.info(m_obj.group())
|
||||||
|
# entity['code'] = data['code'] + '_' +str(idx)
|
||||||
|
|
||||||
|
episode_code = None
|
||||||
|
# logger.debug(f"m_obj::> {m_obj}")
|
||||||
|
if m_obj is not None:
|
||||||
|
episode_code = m_obj.group(1)
|
||||||
|
entity["code"] = data["code"] + episode_code.zfill(4)
|
||||||
|
else:
|
||||||
|
entity["code"] = data["code"]
|
||||||
|
|
||||||
|
aa = t["href"]
|
||||||
|
if "/player" in aa:
|
||||||
|
entity["url"] = "https://linkkf.app" + t["href"]
|
||||||
|
else:
|
||||||
|
entity["url"] = t["href"]
|
||||||
|
entity["season"] = data["season"]
|
||||||
|
|
||||||
|
# 저장 경로 저장
|
||||||
|
# Todo: db
|
||||||
|
tmp_save_path = P.ModelSetting.get(f"linkkf_download_path")
|
||||||
|
if P.ModelSetting.get("linkkf_auto_make_folder") == "True":
|
||||||
|
program_path = os.path.join(tmp_save_path, entity["save_folder"])
|
||||||
|
entity["save_path"] = program_path
|
||||||
|
if P.ModelSetting.get("linkkf_auto_make_season_folder"):
|
||||||
|
entity["save_path"] = os.path.join(
|
||||||
|
entity["save_path"], "Season %s" % int(entity["season"])
|
||||||
|
)
|
||||||
|
|
||||||
|
entity["image"] = data["poster_url"]
|
||||||
|
|
||||||
|
entity["filename"] = LogicLinkkf.get_filename(
|
||||||
|
data["save_folder"], data["season"], entity["title"]
|
||||||
|
)
|
||||||
|
data["episode"].append(entity)
|
||||||
|
idx = idx + 1
|
||||||
|
|
||||||
|
data["ret"] = True
|
||||||
|
# logger.info('data', data)
|
||||||
|
self.current_data = data
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
logger.error("Exception:%s", e)
|
||||||
|
logger.error(traceback.format_exc())
|
||||||
|
data["log"] = str(e)
|
||||||
|
data["ret"] = "error"
|
||||||
|
return data
|
||||||
|
except IndexError as e:
|
||||||
|
logger.error("Exception:%s", e)
|
||||||
|
logger.error(traceback.format_exc())
|
||||||
|
data["log"] = str(e)
|
||||||
|
data["ret"] = "error"
|
||||||
|
return data
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_html(url, referer=None, stream=False, timeout=5):
|
def get_html(url: str, referer: str = None, cached: bool = False, stream: bool = False, timeout: int = 5):
|
||||||
data = ""
|
data = ""
|
||||||
headers = {
|
headers = {
|
||||||
"referer": f"https://linkkf.app",
|
"referer": f"https://linkkf.app",
|
||||||
@@ -241,6 +455,42 @@ class LogicLinkkf(PluginModuleBase):
|
|||||||
logger.error("Exception:%s", e)
|
logger.error("Exception:%s", e)
|
||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_filename(maintitle, season, title):
|
||||||
|
try:
|
||||||
|
# logger.debug("get_filename()===")
|
||||||
|
# logger.info("title:: %s", title)
|
||||||
|
# logger.info("maintitle:: %s", maintitle)
|
||||||
|
match = re.compile(
|
||||||
|
r"(?P<title>.*?)\s?((?P<season>\d+)기)?\s?((?P<epi_no>\d+)화?)"
|
||||||
|
).search(title)
|
||||||
|
if match:
|
||||||
|
epi_no = int(match.group("epi_no"))
|
||||||
|
if epi_no < 10:
|
||||||
|
epi_no = "0%s" % epi_no
|
||||||
|
else:
|
||||||
|
epi_no = "%s" % epi_no
|
||||||
|
|
||||||
|
if int(season) < 10:
|
||||||
|
season = "0%s" % season
|
||||||
|
else:
|
||||||
|
season = "%s" % season
|
||||||
|
|
||||||
|
# title_part = match.group('title').strip()
|
||||||
|
# ret = '%s.S%sE%s%s.720p-SA.mp4' % (maintitle, season, epi_no, date_str)
|
||||||
|
ret = "%s.S%sE%s.720p-LK.mp4" % (maintitle, season, epi_no)
|
||||||
|
else:
|
||||||
|
logger.debug("NOT MATCH")
|
||||||
|
ret = "%s.720p-SA.mp4" % maintitle
|
||||||
|
|
||||||
|
return Util.change_text_for_use_filename(ret)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error("Exception:%s", e)
|
||||||
|
logger.error(traceback.format_exc())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ModelLinkkfItem(db.Model):
|
class ModelLinkkfItem(db.Model):
|
||||||
__tablename__ = "{package_name}_linkkf_item".format(package_name=P.package_name)
|
__tablename__ = "{package_name}_linkkf_item".format(package_name=P.package_name)
|
||||||
__table_args__ = {"mysql_collate": "utf8_general_ci"}
|
__table_args__ = {"mysql_collate": "utf8_general_ci"}
|
||||||
|
|||||||
575
templates/anime_downloader_linkkf_request.html
Normal file
575
templates/anime_downloader_linkkf_request.html
Normal file
@@ -0,0 +1,575 @@
|
|||||||
|
{% 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',
|
||||||
|
[['analysis_btn', '분석'], ['go_ohli24_btn', 'Go OHLI24']], desc='예)
|
||||||
|
"https://ohli24.net/c/녹을 먹는 비스코" 이나 "녹을 먹는 비스코"') }}
|
||||||
|
</form>
|
||||||
|
<form id="program_auto_form">
|
||||||
|
<div id="episode_list"></div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<!--전체-->
|
||||||
|
<script src="{{ url_for('.static', filename='js/sjva_ui14.js') }}"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
const package_name = "{{arg['package_name'] }}";
|
||||||
|
const sub = "{{arg['sub'] }}";
|
||||||
|
const ohli24_url = "{{arg['ohli24_url']}}";
|
||||||
|
{#let current_data = '';#}
|
||||||
|
|
||||||
|
const params = new Proxy(new URLSearchParams(window.location.search), {
|
||||||
|
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) {
|
||||||
|
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(wr_id, bo_table) {
|
||||||
|
// 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, wr_id: wr_id, bo_table: bo_table},
|
||||||
|
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:: ', data)
|
||||||
|
str = "";
|
||||||
|
tmp = '<div class="form-inline w-100">';
|
||||||
|
tmp += m_button("check_download_btn", "선택 다운로드 추가", []);
|
||||||
|
tmp += m_button("all_check_on_btn", "전체 선택", []);
|
||||||
|
tmp += m_button("all_check_off_btn", "전체 해제", []);
|
||||||
|
tmp += m_button("down_subtitle_btn", "자막만 전체 받기", [])
|
||||||
|
tmp +=
|
||||||
|
' <input id="new_title" name="new_title" class="form-control form-control-sm" value="' +
|
||||||
|
data.title +
|
||||||
|
'">';
|
||||||
|
tmp += "</div>";
|
||||||
|
tmp += '<div class="form-inline">';
|
||||||
|
tmp += m_button("apply_new_title_btn", "저장폴더명 변경", []);
|
||||||
|
tmp +=
|
||||||
|
' <input id="new_season" name="new_season" class="form-control form-control-sm" value="' +
|
||||||
|
data.season +
|
||||||
|
'">';
|
||||||
|
tmp += m_button("apply_new_season_btn", "시즌 변경 (숫자만 가능)", []);
|
||||||
|
tmp += m_button("search_tvdb_btn", "TVDB", []);
|
||||||
|
tmp += m_button("add_whitelist", "스케쥴링 추가", []);
|
||||||
|
|
||||||
|
tmp += "</div>";
|
||||||
|
tmp = m_button_group(tmp);
|
||||||
|
str += tmp;
|
||||||
|
// program
|
||||||
|
// str += m_hr_black();
|
||||||
|
str += "<div class='card p-lg-5 mt-md-3 p-md-3 border-light'>"
|
||||||
|
|
||||||
|
str += m_row_start(0);
|
||||||
|
tmp = "";
|
||||||
|
if (data.poster_url != null)
|
||||||
|
tmp = '<img src="' + data.poster_url + '" class="img-fluid">';
|
||||||
|
str += m_col(3, tmp);
|
||||||
|
tmp = "";
|
||||||
|
tmp += m_row_start(0);
|
||||||
|
tmp += m_col(3, "제목", "right");
|
||||||
|
tmp += m_col(9, data.title);
|
||||||
|
tmp += m_row_end();
|
||||||
|
tmp += m_row_start(0);
|
||||||
|
tmp += m_col(3, "시즌", "right");
|
||||||
|
tmp += m_col(9, data.season);
|
||||||
|
tmp += m_row_end();
|
||||||
|
for (i in data.detail) {
|
||||||
|
tmp += m_row_start(0);
|
||||||
|
key = Object.keys(data.detail[i])[0];
|
||||||
|
value = data.detail[i][key];
|
||||||
|
tmp += m_col(3, key, "right");
|
||||||
|
tmp += m_col(9, value);
|
||||||
|
tmp += m_row_end();
|
||||||
|
}
|
||||||
|
|
||||||
|
str += m_col(9, tmp);
|
||||||
|
str += m_row_end();
|
||||||
|
|
||||||
|
// str += m_hr_black();
|
||||||
|
str += "</div>"
|
||||||
|
for (i in data.episode) {
|
||||||
|
str += m_row_start();
|
||||||
|
// tmp = '<img src="' + data.episode[i].image + '" class="img-fluid">'
|
||||||
|
// str += m_col(3, tmp)
|
||||||
|
tmp = "<strong>" + data.episode[i].title + "</strong><span>화. </span>";
|
||||||
|
{#tmp += "<br>";#}
|
||||||
|
tmp += data.episode[i].filename + "<br><p></p>";
|
||||||
|
|
||||||
|
tmp += '<div class="form-inline">';
|
||||||
|
tmp +=
|
||||||
|
'<input id="checkbox_' +
|
||||||
|
data.episode[i].code +
|
||||||
|
'" name="checkbox_' +
|
||||||
|
data.episode[i].code +
|
||||||
|
'" 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': 'code', 'value': data.episode[i].code}])
|
||||||
|
tmp += m_button("add_queue_btn", "다운로드 추가", [
|
||||||
|
{key: "idx", value: i},
|
||||||
|
]);
|
||||||
|
// tmp += '<button id="play_video" name="play_video" class="btn btn-sm btn-outline-primary" data-idx="'+i+'">바로보기</button>';
|
||||||
|
tmp += "</div>";
|
||||||
|
str += m_col(12, 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({
|
||||||
|
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'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("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) {
|
||||||
|
console.log('#add_queue_btn::data >>', 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>
|
||||||
|
<style>
|
||||||
|
button.code-button {
|
||||||
|
min-width: 82px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-tooltip-text]:hover {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-tooltip-text]:after {
|
||||||
|
-webkit-transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||||
|
-moz-transition: bottom 0.3s ease-in-out, opacity 0.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);
|
||||||
|
|
||||||
|
-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);
|
||||||
|
box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||||
|
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 7px 12px;
|
||||||
|
position: absolute;
|
||||||
|
width: auto;
|
||||||
|
min-width: 50px;
|
||||||
|
max-width: 300px;
|
||||||
|
word-wrap: break-word;
|
||||||
|
|
||||||
|
z-index: 9999;
|
||||||
|
|
||||||
|
opacity: 0;
|
||||||
|
left: -9999px;
|
||||||
|
top: 90%;
|
||||||
|
|
||||||
|
content: attr(data-tooltip-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-tooltip-text]:hover:after {
|
||||||
|
top: 230%;
|
||||||
|
left: 0;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-tooltip-text]:hover {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-tooltip-text]:after {
|
||||||
|
-webkit-transition: bottom 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||||
|
-moz-transition: bottom 0.3s ease-in-out, opacity 0.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);
|
||||||
|
|
||||||
|
-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);
|
||||||
|
box-shadow: 0px 0px 3px 1px rgba(50, 50, 50, 0.4);
|
||||||
|
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 7px 12px;
|
||||||
|
position: absolute;
|
||||||
|
width: auto;
|
||||||
|
min-width: 50px;
|
||||||
|
max-width: 300px;
|
||||||
|
word-wrap: break-word;
|
||||||
|
|
||||||
|
z-index: 9999;
|
||||||
|
|
||||||
|
opacity: 0;
|
||||||
|
left: -9999px;
|
||||||
|
top: -210% !important;
|
||||||
|
|
||||||
|
content: attr(data-tooltip-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
[data-tooltip-text]:hover:after {
|
||||||
|
top: 130%;
|
||||||
|
left: 0;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#airing_list {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cut-text {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#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 %}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{% extends "base.html" %} {% block content %}
|
{% extends "base.html" %} {% block content %}
|
||||||
<!--<div id="preloader"></div>-->
|
<!--<div id="preloader"></div>-->
|
||||||
<div id="preloader" class="loader">
|
<div id="preloader" class="loader">
|
||||||
<div class="loader-inner">
|
<div class="loader-inner">
|
||||||
<div class="loader-line-wrap">
|
<div class="loader-line-wrap">
|
||||||
<div class="loader-line"></div>
|
<div class="loader-line"></div>
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
<div class="loader-line"></div>
|
<div class="loader-line"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="yommi_wrapper">
|
<div id="yommi_wrapper">
|
||||||
<div class="input-group mb-2">
|
<div class="input-group mb-2">
|
||||||
<input
|
<input
|
||||||
id="input_search"
|
id="input_search"
|
||||||
@@ -62,18 +62,18 @@
|
|||||||
<div id="episode_list"></div>
|
<div id="episode_list"></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--전체-->
|
<!--전체-->
|
||||||
|
|
||||||
<script
|
<script
|
||||||
type="text/javascript"
|
type="text/javascript"
|
||||||
src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"
|
src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"
|
||||||
></script>
|
></script>
|
||||||
<script src="{{ url_for('.static', filename='js/sjva_ui14.js') }}"></script>
|
<script src="{{ url_for('.static', filename='js/sjva_ui14.js') }}"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js"
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js"
|
||||||
integrity="sha512-jNDtFf7qgU0eH/+Z42FG4fw3w7DM/9zbgNPe3wfJlCylVDTT3IgKW5r92Vy9IHa6U50vyMz5gRByIu4YIXFtaQ=="
|
integrity="sha512-jNDtFf7qgU0eH/+Z42FG4fw3w7DM/9zbgNPe3wfJlCylVDTT3IgKW5r92Vy9IHa6U50vyMz5gRByIu4YIXFtaQ=="
|
||||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
<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 anilife_url = "{{arg['anilife_url']}}";
|
const anilife_url = "{{arg['anilife_url']}}";
|
||||||
@@ -120,13 +120,13 @@
|
|||||||
url = '/' + package_name + '/ajax/' + sub + '/screen_movie_list'
|
url = '/' + package_name + '/ajax/' + sub + '/screen_movie_list'
|
||||||
current_cate = 'movie'
|
current_cate = 'movie'
|
||||||
break;
|
break;
|
||||||
case 'theater':
|
case 'complete':
|
||||||
url = '/' + package_name + '/ajax/' + sub + '/anime_list'
|
url = '/' + package_name + '/ajax/' + sub + '/anime_list'
|
||||||
current_cate = 'theater'
|
current_cate = 'complete'
|
||||||
break;
|
break;
|
||||||
case 'fin':
|
case 'complete':
|
||||||
url = '/' + package_name + '/ajax/' + sub + '/complete_list'
|
url = '/' + package_name + '/ajax/' + sub + '/complete_list'
|
||||||
current_cate = 'fin'
|
current_cate = 'complete'
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -144,7 +144,8 @@
|
|||||||
|
|
||||||
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)
|
||||||
|
make_screen_movie_list(ret.data, page);
|
||||||
observer.observe();
|
observer.observe();
|
||||||
} else if (type === "fin") {
|
} else if (type === "fin") {
|
||||||
make_screen_movie_list(ret.data, page)
|
make_screen_movie_list(ret.data, page)
|
||||||
@@ -282,56 +283,97 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function make_screen_movie_list(data, page) {
|
function make_screen_movie_list(data, page) {
|
||||||
let str = ''
|
let str = "";
|
||||||
let tmp = ''
|
let tmp = "";
|
||||||
|
let new_anime = true;
|
||||||
console.log(data.anime_list, page)
|
let new_style = ''
|
||||||
|
console.log('page a: ', page)
|
||||||
str += '<div>';
|
console.log(data)
|
||||||
str += '<button type="button" class="btn btn-info">Page <span class="badge bg-warning">' + page + '</span></button>';
|
console.log(data.episode)
|
||||||
str += '</div>';
|
|
||||||
// str += '<div class="card-columns">'
|
|
||||||
str += '<div id="inner_screen_movie" class="row infinite-scroll">';
|
|
||||||
for (let i in data.anime_list) {
|
|
||||||
|
|
||||||
tmp = '<div class="col-sm-4">';
|
|
||||||
tmp += '<div class="card">';
|
|
||||||
tmp += '<img class="card-img-top" src="' + data.anime_list[i].image_link + '" />';
|
|
||||||
tmp += '<div class="card-body">'
|
|
||||||
tmp += '<h5 class="card-title">' + data.anime_list[i].title + '</h5>';
|
|
||||||
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 += '</div>';
|
|
||||||
tmp += '</div>';
|
|
||||||
tmp += '</div>';
|
|
||||||
str += tmp
|
|
||||||
|
|
||||||
|
let page_elem = "";
|
||||||
|
if (page === undefined) {
|
||||||
|
} else {
|
||||||
|
page_elem = '<span class="badge bg-warning">' + page + "</span>";
|
||||||
}
|
}
|
||||||
str += '</div>';
|
|
||||||
// str += '</div><!-- .card-columns -->';
|
// str += "<div id='page_caption' style='border-bottom: aqua 1px solid; margin-bottom: 5px'>";
|
||||||
|
str += "<div id='page_caption' style='padding-bottom: 3px'>";
|
||||||
|
str +=
|
||||||
|
'<button type="button" class="btn btn-info">Page ' +
|
||||||
|
page_elem +
|
||||||
|
"</button>";
|
||||||
|
str += "</div>";
|
||||||
|
str += '<div id="inner_screen_movie" class="row infinite-scroll">';
|
||||||
|
for (let i in data.episode) {
|
||||||
|
if (data.episode[i].code === data.latest_anime_code) {
|
||||||
|
new_anime = false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (new_anime && page === '1') {
|
||||||
|
new_style = 'new-anime';
|
||||||
|
} else {
|
||||||
|
new_style = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
tmp = '<div class="col-6 col-sm-4 col-md-3">';
|
||||||
|
tmp += '<div class="card ' + new_style + '">';
|
||||||
|
// tmp += '<div class="card-header">';
|
||||||
|
|
||||||
|
// tmp +=
|
||||||
|
// '<img class="card-img-top lazyload" src="./static/img_loader_x200.svg" data-original="' + data.episode[i].image_link + '" />';
|
||||||
|
tmp +=
|
||||||
|
'<img class="card-img-top lazy" src="{{ url_for('.static', filename='img_loader_x200.svg') }}" data-lazy-src="' +
|
||||||
|
data.episode[i].image_link +
|
||||||
|
'" style="cursor: pointer" onclick="location.href=\'./request?code=' +
|
||||||
|
data.episode[i].code +
|
||||||
|
"'\"/>";
|
||||||
|
if (current_cate === "ing") {
|
||||||
|
tmp +=
|
||||||
|
'<span class="badge badge-danger badge-on-image">' +
|
||||||
|
data.episode[i].chapter +
|
||||||
|
"</span>";
|
||||||
|
}
|
||||||
|
// tmp += '<div class="card-body '+ new_anime ? 'new-anime' : '' +'">';
|
||||||
|
tmp += '<div class="card-body">';
|
||||||
|
tmp += '<h5 class="card-title">' + data.episode[i].title + "</h5>";
|
||||||
|
tmp +=
|
||||||
|
'<button id="add_whitelist" name="add_whitelist" class="btn btn-sm btn-favorite mb-1" data-code="' +
|
||||||
|
data.episode[i].code +
|
||||||
|
'"><p class="card-text">' +
|
||||||
|
data.episode[i].code +
|
||||||
|
" <i class=\"bi bi-heart-fill\"></i></p></button>";
|
||||||
|
tmp +=
|
||||||
|
'<a href="./request?code=' +
|
||||||
|
data.episode[i].code +
|
||||||
|
'" class="btn btn-primary cut-text">' +
|
||||||
|
data.episode[i].title +
|
||||||
|
"</a>";
|
||||||
|
tmp += "</div>";
|
||||||
|
tmp += "</div>";
|
||||||
|
// tmp += "</div>"
|
||||||
|
tmp += "</div>";
|
||||||
|
str += tmp;
|
||||||
|
}
|
||||||
|
str += "</div>";
|
||||||
str += m_hr_black();
|
str += m_hr_black();
|
||||||
|
|
||||||
if (page > 1) {
|
if (page > 1) {
|
||||||
|
const temp = document.createElement("div");
|
||||||
const temp = document.createElement('div')
|
|
||||||
temp.innerHTML = str;
|
temp.innerHTML = str;
|
||||||
while (temp.firstChild) {
|
while (temp.firstChild) {
|
||||||
document.getElementById("screen_movie_list").appendChild(temp.firstChild);
|
document.getElementById("screen_movie_list").appendChild(temp.firstChild);
|
||||||
}
|
}
|
||||||
page++
|
page++;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("screen_movie_list").innerHTML = str;
|
document.getElementById("screen_movie_list").innerHTML = str;
|
||||||
}
|
}
|
||||||
|
|
||||||
$("img.lazyload").lazyload({
|
$("img.lazyload").lazyload({
|
||||||
threshold: 10,
|
threshold: 100,
|
||||||
effect: "fadeIn",
|
effect: "fadeIn",
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
// if ( "{{arg['anilife_current_code']}}" !== "" ) {
|
// if ( "{{arg['anilife_current_code']}}" !== "" ) {
|
||||||
@@ -582,8 +624,97 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
document.addEventListener("scroll", debounce(onScroll, 300));
|
document.addEventListener("scroll", debounce(onScroll, 300));
|
||||||
</script>
|
window.lazyLoadOptions = {
|
||||||
<style>
|
elements_selector:
|
||||||
|
"img[data-lazy-src],.rocket-lazyload,iframe[data-lazy-src]",
|
||||||
|
data_src: "lazy-src",
|
||||||
|
data_srcset: "lazy-srcset",
|
||||||
|
data_sizes: "lazy-sizes",
|
||||||
|
class_loading: "lazyloading",
|
||||||
|
class_loaded: "lazyloaded",
|
||||||
|
threshold: 50,
|
||||||
|
callback_loaded: function (element) {
|
||||||
|
if (
|
||||||
|
element.tagName === "IFRAME" &&
|
||||||
|
element.dataset.rocketLazyload == "fitvidscompatible"
|
||||||
|
) {
|
||||||
|
if (element.classList.contains("lazyloaded")) {
|
||||||
|
if (typeof window.jQuery != "undefined") {
|
||||||
|
if (jQuery.fn.fitVids) {
|
||||||
|
jQuery(element).parent().fitVids();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
window.addEventListener(
|
||||||
|
"LazyLoad::Initialized",
|
||||||
|
function (e) {
|
||||||
|
var lazyLoadInstance = e.detail.instance;
|
||||||
|
if (window.MutationObserver) {
|
||||||
|
var observer = new MutationObserver(function (mutations) {
|
||||||
|
var image_count = 0;
|
||||||
|
var iframe_count = 0;
|
||||||
|
var rocketlazy_count = 0;
|
||||||
|
mutations.forEach(function (mutation) {
|
||||||
|
for (var i = 0; i < mutation.addedNodes.length; i++) {
|
||||||
|
if (
|
||||||
|
typeof mutation.addedNodes[i].getElementsByTagName !== "function"
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
typeof mutation.addedNodes[i].getElementsByClassName !==
|
||||||
|
"function"
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
images = mutation.addedNodes[i].getElementsByTagName("img");
|
||||||
|
is_image = mutation.addedNodes[i].tagName == "IMG";
|
||||||
|
iframes = mutation.addedNodes[i].getElementsByTagName("iframe");
|
||||||
|
is_iframe = mutation.addedNodes[i].tagName == "IFRAME";
|
||||||
|
rocket_lazy =
|
||||||
|
mutation.addedNodes[i].getElementsByClassName("rocket-lazyload");
|
||||||
|
image_count += images.length;
|
||||||
|
iframe_count += iframes.length;
|
||||||
|
rocketlazy_count += rocket_lazy.length;
|
||||||
|
if (is_image) {
|
||||||
|
image_count += 1;
|
||||||
|
}
|
||||||
|
if (is_iframe) {
|
||||||
|
iframe_count += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (image_count > 0 || iframe_count > 0 || rocketlazy_count > 0) {
|
||||||
|
lazyLoadInstance.update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var b = document.getElementsByTagName("body")[0];
|
||||||
|
var config = {
|
||||||
|
childList: !0,
|
||||||
|
subtree: !0,
|
||||||
|
};
|
||||||
|
observer.observe(b, config);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
!1
|
||||||
|
);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<script
|
||||||
|
src="https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js"
|
||||||
|
integrity="sha512-jNDtFf7qgU0eH/+Z42FG4fw3w7DM/9zbgNPe3wfJlCylVDTT3IgKW5r92Vy9IHa6U50vyMz5gRByIu4YIXFtaQ=="
|
||||||
|
crossorigin="anonymous"
|
||||||
|
referrerpolicy="no-referrer"
|
||||||
|
></script>
|
||||||
|
<script
|
||||||
|
async
|
||||||
|
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.7.0/dist/lazyload.min.js"
|
||||||
|
></script>
|
||||||
|
|
||||||
|
<style>
|
||||||
button.code-button {
|
button.code-button {
|
||||||
min-width: 82px !important;
|
min-width: 82px !important;
|
||||||
}
|
}
|
||||||
@@ -919,6 +1050,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.1/font/bootstrap-icons.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.1/font/bootstrap-icons.css">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user