Compare commits
20 Commits
f4fe73486d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 9779d82ad7 | |||
| 1bebd593f7 | |||
| 62356738bb | |||
| 4da03ab7ff | |||
| 0ad6c9c59a | |||
| bfb7436b07 | |||
| c091ce916a | |||
| 602b39d9bf | |||
| 88d0a8ff05 | |||
| dec47f900b | |||
| 1d9bbbf922 | |||
| a797423576 | |||
| 846ff82a06 | |||
| 8019f078d6 | |||
| b2d07abecb | |||
| 4d0e55b25f | |||
| 889c0177a8 | |||
| 1d53aa670a | |||
| b00c449dfe | |||
| 75450f6c9d |
107
logic_ohli24.py
107
logic_ohli24.py
@@ -15,6 +15,7 @@ import hashlib
|
|||||||
import requests
|
import requests
|
||||||
from lxml import html
|
from lxml import html
|
||||||
from urllib import parse
|
from urllib import parse
|
||||||
|
import urllib
|
||||||
|
|
||||||
# third-party
|
# third-party
|
||||||
from flask import request, render_template, jsonify
|
from flask import request, render_template, jsonify
|
||||||
@@ -129,11 +130,14 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
if sub == "analysis":
|
if sub == "analysis":
|
||||||
# code = req.form['code']
|
# code = req.form['code']
|
||||||
code = request.form["code"]
|
code = request.form["code"]
|
||||||
|
|
||||||
|
wr_id = request.form.get("wr_id", None)
|
||||||
|
bo_table = request.form.get("bo_table", None)
|
||||||
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("ohli24_current_code", code)
|
||||||
data = self.get_series_info(code)
|
data = self.get_series_info(code, wr_id, bo_table)
|
||||||
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":
|
||||||
@@ -146,6 +150,27 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
return jsonify(
|
return jsonify(
|
||||||
{"ret": "success", "cate": cate, "page": page, "data": data}
|
{"ret": "success", "cate": cate, "page": page, "data": data}
|
||||||
)
|
)
|
||||||
|
elif sub == "complete_list":
|
||||||
|
data = []
|
||||||
|
|
||||||
|
cate = request.form["type"]
|
||||||
|
logger.debug("cate", 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"]
|
||||||
|
query = request.form["query"]
|
||||||
|
|
||||||
|
data = self.get_search_result(query)
|
||||||
|
# self.current_data = data
|
||||||
|
return jsonify({"ret": "success", "query": query, "data": data})
|
||||||
|
|
||||||
elif sub == "add_queue":
|
elif sub == "add_queue":
|
||||||
ret = {}
|
ret = {}
|
||||||
@@ -198,9 +223,9 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
P.ModelSetting.get_int("ohli24_max_ffmpeg_process_count")
|
P.ModelSetting.get_int("ohli24_max_ffmpeg_process_count")
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_series_info(self, code):
|
def get_series_info(self, code, wr_id, bo_table):
|
||||||
code_type = "c"
|
code_type = "c"
|
||||||
# _code = None
|
|
||||||
try:
|
try:
|
||||||
if (
|
if (
|
||||||
self.current_data is not None
|
self.current_data is not None
|
||||||
@@ -232,7 +257,22 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
url = P.ModelSetting.get("ohli24_url") + "/e/" + code
|
url = P.ModelSetting.get("ohli24_url") + "/e/" + code
|
||||||
else:
|
else:
|
||||||
url = P.ModelSetting.get("ohli24_url") + "/e/" + code
|
url = P.ModelSetting.get("ohli24_url") + "/e/" + code
|
||||||
|
|
||||||
|
if wr_id is not None:
|
||||||
|
# print(len(wr_id))
|
||||||
|
if len(wr_id) > 0:
|
||||||
|
url = (
|
||||||
|
P.ModelSetting.get("ohli24_url")
|
||||||
|
+ "/bbs/board.php?bo_table="
|
||||||
|
+ bo_table
|
||||||
|
+ "&wr_id="
|
||||||
|
+ wr_id
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
logger.debug("url:::> %s", url)
|
logger.debug("url:::> %s", url)
|
||||||
|
|
||||||
# self.current_headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)
|
# self.current_headers = { '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',
|
# AppleWebKit/537.36 (KHTML, like Gecko) ' 'Chrome/96.0.4664.110 Whale/3.12.129.46 Safari/537.36',
|
||||||
# 'Referer': url }
|
# 'Referer': url }
|
||||||
@@ -255,6 +295,7 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
"_grade",
|
"_grade",
|
||||||
"_total_chapter",
|
"_total_chapter",
|
||||||
"_show_time",
|
"_show_time",
|
||||||
|
"_release_year",
|
||||||
]
|
]
|
||||||
description_dict = {
|
description_dict = {
|
||||||
"원제": "_otit",
|
"원제": "_otit",
|
||||||
@@ -271,6 +312,7 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
"등급": "_grade",
|
"등급": "_grade",
|
||||||
"총화수": "_total_chapter",
|
"총화수": "_total_chapter",
|
||||||
"상영시간": "_show_time",
|
"상영시간": "_show_time",
|
||||||
|
"개봉년도": "_release_year",
|
||||||
}
|
}
|
||||||
|
|
||||||
list_body_li = tree.xpath('//ul[@class="list-body"]/li')
|
list_body_li = tree.xpath('//ul[@class="list-body"]/li')
|
||||||
@@ -310,7 +352,10 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
span = item.xpath(".//span//text()")
|
span = item.xpath(".//span//text()")
|
||||||
logger.info(span)
|
logger.info(span)
|
||||||
key = description_dict[span[0]]
|
key = description_dict[span[0]]
|
||||||
des[key] = item.xpath(".//span/text()")[1]
|
try:
|
||||||
|
des[key] = item.xpath(".//span/text()")[1]
|
||||||
|
except IndexError:
|
||||||
|
des[key] = ""
|
||||||
|
|
||||||
logger.info(f"des::>> {des}")
|
logger.info(f"des::>> {des}")
|
||||||
image = image.replace("..", P.ModelSetting.get("ohli24_url"))
|
image = image.replace("..", P.ModelSetting.get("ohli24_url"))
|
||||||
@@ -381,7 +426,9 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
entity = {}
|
entity = {}
|
||||||
entity["link"] = item.xpath(".//a/@href")[0]
|
entity["link"] = item.xpath(".//a/@href")[0]
|
||||||
entity["code"] = entity["link"].split("/")[-1]
|
entity["code"] = entity["link"].split("/")[-1]
|
||||||
entity["title"] = item.xpath(".//div[@class='post-title']/text()")[0]
|
entity["title"] = item.xpath(".//div[@class='post-title']/text()")[
|
||||||
|
0
|
||||||
|
].strip()
|
||||||
entity["image_link"] = item.xpath(".//div[@class='img-item']/img/@src")[
|
entity["image_link"] = item.xpath(".//div[@class='img-item']/img/@src")[
|
||||||
0
|
0
|
||||||
].replace("..", P.ModelSetting.get("ohli24_url"))
|
].replace("..", P.ModelSetting.get("ohli24_url"))
|
||||||
@@ -394,6 +441,48 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
P.logger.error(traceback.format_exc())
|
P.logger.error(traceback.format_exc())
|
||||||
return {"ret": "exception", "log": str(e)}
|
return {"ret": "exception", "log": str(e)}
|
||||||
|
|
||||||
|
# @staticmethod
|
||||||
|
def get_search_result(self, query):
|
||||||
|
try:
|
||||||
|
_query = urllib.parse.quote(query)
|
||||||
|
url = (
|
||||||
|
P.ModelSetting.get("ohli24_url")
|
||||||
|
+ "/bbs/search.php?srows=24&gr_id=&sfl=wr_subject&stx="
|
||||||
|
+ _query
|
||||||
|
)
|
||||||
|
|
||||||
|
logger.info("url:::> %s", url)
|
||||||
|
data = {}
|
||||||
|
response_data = LogicOhli24.get_html(url, timeout=10)
|
||||||
|
tree = html.fromstring(response_data)
|
||||||
|
tmp_items = tree.xpath('//div[@class="list-row"]')
|
||||||
|
data["anime_count"] = len(tmp_items)
|
||||||
|
data["anime_list"] = []
|
||||||
|
|
||||||
|
for item in tmp_items:
|
||||||
|
entity = {}
|
||||||
|
entity["link"] = item.xpath(".//a/@href")[0]
|
||||||
|
# entity["code"] = entity["link"].split("/")[-1]
|
||||||
|
entity["wr_id"] = entity["link"].split("=")[-1]
|
||||||
|
# logger.debug(item.xpath(".//div[@class='post-title']/text()").join())
|
||||||
|
entity["title"] = "".join(
|
||||||
|
item.xpath(".//div[@class='post-title']/text()")
|
||||||
|
).strip()
|
||||||
|
entity["image_link"] = item.xpath(".//div[@class='img-item']/img/@src")[
|
||||||
|
0
|
||||||
|
].replace("..", P.ModelSetting.get("ohli24_url"))
|
||||||
|
|
||||||
|
entity["code"] = item.xpath(".//div[@class='img-item']/img/@alt")[0]
|
||||||
|
|
||||||
|
data["ret"] = "success"
|
||||||
|
data["anime_list"].append(entity)
|
||||||
|
|
||||||
|
return data
|
||||||
|
except Exception as e:
|
||||||
|
P.logger.error("Exception:%s", e)
|
||||||
|
P.logger.error(traceback.format_exc())
|
||||||
|
return {"ret": "exception", "log": str(e)}
|
||||||
|
|
||||||
# @staticmethod
|
# @staticmethod
|
||||||
def plugin_load(self):
|
def plugin_load(self):
|
||||||
try:
|
try:
|
||||||
@@ -571,7 +660,7 @@ class Ohli24QueueEntity(FfmpegQueueEntity):
|
|||||||
# logger.info('match groups:: %s', match.groups())
|
# logger.info('match groups:: %s', match.groups())
|
||||||
# logger.info('match group3:: %s', match.group(3))
|
# logger.info('match group3:: %s', match.group(3))
|
||||||
# print('packed_script==>', packed_script)
|
# print('packed_script==>', packed_script)
|
||||||
logger.debug(unpack_script)
|
# logger.debug(unpack_script)
|
||||||
|
|
||||||
p1 = re.compile(r"(\"tracks\".*\])\,\"captions\"", re.MULTILINE | re.DOTALL)
|
p1 = re.compile(r"(\"tracks\".*\])\,\"captions\"", re.MULTILINE | re.DOTALL)
|
||||||
m2 = re.search(
|
m2 = re.search(
|
||||||
@@ -633,8 +722,10 @@ class Ohli24QueueEntity(FfmpegQueueEntity):
|
|||||||
|
|
||||||
self.url = stream_info[1].strip()
|
self.url = stream_info[1].strip()
|
||||||
match = re.compile(r'NAME="(?P<quality>.*?)"').search(stream_info[0])
|
match = re.compile(r'NAME="(?P<quality>.*?)"').search(stream_info[0])
|
||||||
self.quality = match.group("quality")
|
self.quality = "720P"
|
||||||
logger.info(self.quality)
|
if match is not None:
|
||||||
|
self.quality = match.group("quality")
|
||||||
|
logger.info(self.quality)
|
||||||
|
|
||||||
match = re.compile(
|
match = re.compile(
|
||||||
r"(?P<title>.*?)\s*((?P<season>\d+)%s)?\s*((?P<epi_no>\d+)%s)"
|
r"(?P<title>.*?)\s*((?P<season>\d+)%s)?\s*((?P<epi_no>\d+)%s)"
|
||||||
|
|||||||
69
plugin.py
69
plugin.py
@@ -6,8 +6,10 @@
|
|||||||
# @Software: PyCharm
|
# @Software: PyCharm
|
||||||
|
|
||||||
import os, traceback
|
import os, traceback
|
||||||
|
|
||||||
# third-party
|
# third-party
|
||||||
from flask import Blueprint
|
from flask import Blueprint
|
||||||
|
|
||||||
# sjva 공용
|
# sjva 공용
|
||||||
from framework.logger import get_logger
|
from framework.logger import get_logger
|
||||||
from framework import app, path_data
|
from framework import app, path_data
|
||||||
@@ -17,56 +19,71 @@ from plugin import get_model_setting, Logic, default_route, PluginUtil
|
|||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
|
|
||||||
class P(object):
|
class P(object):
|
||||||
package_name = __name__.split('.')[0]
|
package_name = __name__.split(".")[0]
|
||||||
logger = get_logger(package_name)
|
logger = get_logger(package_name)
|
||||||
blueprint = Blueprint(package_name, package_name, url_prefix='/%s' % package_name,
|
blueprint = Blueprint(
|
||||||
template_folder=os.path.join(os.path.dirname(__file__), 'templates'))
|
package_name,
|
||||||
|
package_name,
|
||||||
|
url_prefix="/%s" % package_name,
|
||||||
|
template_folder=os.path.join(os.path.dirname(__file__), "templates"),
|
||||||
|
static_folder="static",
|
||||||
|
)
|
||||||
menu = {
|
menu = {
|
||||||
'main': [package_name, u'애니 다운로드'],
|
"main": [package_name, "애니 다운로드"],
|
||||||
'sub': [
|
"sub": [["ohli24", "OHLI24"], ["linkkf", "LINKKF"], ["log", "로그"]],
|
||||||
['ohli24', u'OHLI24'], ['linkkf', u'LINKKF'], ['log', u'로그']
|
"category": "vod",
|
||||||
],
|
"sub2": {
|
||||||
'category': 'vod',
|
"ohli24": [
|
||||||
'sub2': {
|
["setting", "설정"],
|
||||||
'ohli24': [
|
["request", "요청"],
|
||||||
['setting', u'설정'], ['request', u'요청'], ['queue', u'큐'], ['category', u'분류'], ['list', u'목록']
|
["queue", "큐"],
|
||||||
|
["category", "분류"],
|
||||||
|
["list", "목록"],
|
||||||
],
|
],
|
||||||
'linkkf': [
|
"linkkf": [
|
||||||
['setting', u'설정'], ['request', u'요청'], ['queue', u'큐'], ['list', u'목록']
|
["setting", "설정"],
|
||||||
|
["request", "요청"],
|
||||||
|
["queue", "큐"],
|
||||||
|
["list", "목록"],
|
||||||
],
|
],
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
plugin_info = {
|
plugin_info = {
|
||||||
'version': '0.1.1.0',
|
"version": "0.1.1.0",
|
||||||
'name': 'anime_downloader',
|
"name": "anime_downloader",
|
||||||
'category_name': 'vod',
|
"category_name": "vod",
|
||||||
'icon': '',
|
"icon": "",
|
||||||
'developer': 'soju6jan && projectdx',
|
"developer": "soju6jan && projectdx",
|
||||||
'description': u'비디오 다운로드',
|
"description": "비디오 다운로드",
|
||||||
'home': 'http://yommi.duckdns.org:20080/projectdx/anime-downloader',
|
"home": "http://yommi.duckdns.org:20080/projectdx/anime-downloader",
|
||||||
'more': '',
|
"more": "",
|
||||||
}
|
}
|
||||||
ModelSetting = get_model_setting(package_name, logger)
|
ModelSetting = get_model_setting(package_name, logger)
|
||||||
logic = None
|
logic = None
|
||||||
module_list = None
|
module_list = None
|
||||||
home_module = 'ohli24'
|
home_module = "ohli24"
|
||||||
|
|
||||||
|
|
||||||
# 초기화 함수
|
# 초기화 함수
|
||||||
def initialize():
|
def initialize():
|
||||||
try:
|
try:
|
||||||
app.config['SQLALCHEMY_BINDS'][P.package_name] = 'sqlite:///%s' % (
|
app.config["SQLALCHEMY_BINDS"][P.package_name] = "sqlite:///%s" % (
|
||||||
os.path.join(path_data, 'db', '{package_name}.db'.format(package_name=P.package_name)))
|
os.path.join(
|
||||||
|
path_data, "db", "{package_name}.db".format(package_name=P.package_name)
|
||||||
|
)
|
||||||
|
)
|
||||||
PluginUtil.make_info_json(P.plugin_info, __file__)
|
PluginUtil.make_info_json(P.plugin_info, __file__)
|
||||||
from .logic_ohli24 import LogicOhli24
|
from .logic_ohli24 import LogicOhli24
|
||||||
from .logic_linkkf import LogicLinkkf
|
from .logic_linkkf import LogicLinkkf
|
||||||
|
|
||||||
# P.module_list = [LogicOhli24(P), LogicLinkkf(P)]
|
# P.module_list = [LogicOhli24(P), LogicLinkkf(P)]
|
||||||
P.module_list = [LogicOhli24(P)]
|
P.module_list = [LogicOhli24(P)]
|
||||||
P.logic = Logic(P)
|
P.logic = Logic(P)
|
||||||
default_route(P)
|
default_route(P)
|
||||||
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())
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
23
static/img_loader_x200.svg
Normal file
23
static/img_loader_x200.svg
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: rgb(241, 242, 243); display: block; shape-rendering: auto;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
|
||||||
|
<g transform="translate(27.166666666666664,27.166666666666664)">
|
||||||
|
<rect x="-18.5" y="-18.5" width="37" height="37" fill="#85a2b6">
|
||||||
|
<animateTransform attributeName="transform" type="scale" repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.1;1" begin="-0.3s"></animateTransform>
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="translate(72.83333333333333,27.166666666666664)">
|
||||||
|
<rect x="-18.5" y="-18.5" width="37" height="37" fill="#bbcedd">
|
||||||
|
<animateTransform attributeName="transform" type="scale" repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.1;1" begin="-0.2s"></animateTransform>
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="translate(27.166666666666664,72.83333333333333)">
|
||||||
|
<rect x="-18.5" y="-18.5" width="37" height="37" fill="#dce4eb">
|
||||||
|
<animateTransform attributeName="transform" type="scale" repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.1;1" begin="0s"></animateTransform>
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="translate(72.83333333333333,72.83333333333333)">
|
||||||
|
<rect x="-18.5" y="-18.5" width="37" height="37" fill="#fdfdfd">
|
||||||
|
<animateTransform attributeName="transform" type="scale" repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.1;1" begin="-0.1s"></animateTransform>
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<!-- [ldio] generated by https://loading.io/ --></svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
23
static/ohli24/img_loader_x200.svg
Normal file
23
static/ohli24/img_loader_x200.svg
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: rgb(241, 242, 243); display: block; shape-rendering: auto;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
|
||||||
|
<g transform="translate(27.166666666666664,27.166666666666664)">
|
||||||
|
<rect x="-18.5" y="-18.5" width="37" height="37" fill="#85a2b6">
|
||||||
|
<animateTransform attributeName="transform" type="scale" repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.1;1" begin="-0.3s"></animateTransform>
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="translate(72.83333333333333,27.166666666666664)">
|
||||||
|
<rect x="-18.5" y="-18.5" width="37" height="37" fill="#bbcedd">
|
||||||
|
<animateTransform attributeName="transform" type="scale" repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.1;1" begin="-0.2s"></animateTransform>
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="translate(27.166666666666664,72.83333333333333)">
|
||||||
|
<rect x="-18.5" y="-18.5" width="37" height="37" fill="#dce4eb">
|
||||||
|
<animateTransform attributeName="transform" type="scale" repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.1;1" begin="0s"></animateTransform>
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<g transform="translate(72.83333333333333,72.83333333333333)">
|
||||||
|
<rect x="-18.5" y="-18.5" width="37" height="37" fill="#fdfdfd">
|
||||||
|
<animateTransform attributeName="transform" type="scale" repeatCount="indefinite" dur="1s" keyTimes="0;1" values="1.1;1" begin="-0.1s"></animateTransform>
|
||||||
|
</rect>
|
||||||
|
</g>
|
||||||
|
<!-- [ldio] generated by https://loading.io/ --></svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -1,271 +1,605 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %} {% block content %}
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
{#<div>#}
|
<div class="input-group mb-2">
|
||||||
{# <form id='program_list'>#}
|
<input
|
||||||
{# {{ macros.setting_input_text_and_buttons('code', '작품 Code', [['analysis_btn', '분석'], ['go_ohli24_btn', 'Go OHLI24']], desc='예) "https://ohli24.net/c/녹을 먹는 비스코" 이나 "녹을 먹는 비스코"') }}#}
|
id="input_search"
|
||||||
{# </form>#}
|
type="search"
|
||||||
{# <form id="program_auto_form">#}
|
class="form-control rounded"
|
||||||
{# <div id='episode_list'></div>#}
|
placeholder="Search"
|
||||||
{# </form>#}
|
aria-label="Search"
|
||||||
{#</div> <!--전체-->#}
|
aria-describedby="search-addon"
|
||||||
|
/>
|
||||||
|
<button id="btn_search" type="button" class="btn btn-outline-primary">
|
||||||
|
search
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div id="anime_category" class="btn-group" role="group" aria-label="Basic example">
|
<div
|
||||||
<button id="ing" type="button" class="btn btn-success">방영중</button>
|
id="anime_category"
|
||||||
<button id="movie" type="button" class="btn btn-primary">극장판</button>
|
class="btn-group"
|
||||||
<button id="complete_anilist" type="button" class="btn btn-dark">완결</button>
|
role="group"
|
||||||
|
aria-label="Basic example"
|
||||||
|
>
|
||||||
|
<button id="ing" type="button" class="btn btn-success">방영중</button>
|
||||||
|
<button id="theater" type="button" class="btn btn-primary">극장판</button>
|
||||||
|
<button id="complete_anilist" type="button" class="btn btn-dark">
|
||||||
|
완결
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<form id="airing_list_form">
|
||||||
|
<div id="airing_list"></div>
|
||||||
|
</form>
|
||||||
|
<form id="screen_movie_list_form">
|
||||||
|
<div id="screen_movie_list" class="container"></div>
|
||||||
|
</form>
|
||||||
|
<div class="text-center">
|
||||||
|
<div id="spinner" class="spinner-border" role="status">
|
||||||
|
<span class="sr-only">Loading...</span>
|
||||||
</div>
|
</div>
|
||||||
<form id="airing_list_form">
|
</div>
|
||||||
<div id="airing_list"></div>
|
<form id="program_auto_form">
|
||||||
</form>
|
<div id="episode_list"></div>
|
||||||
<form id="screen_movie_list_form">
|
</form>
|
||||||
<div id="screen_movie_list" class="container">
|
</div>
|
||||||
</div>
|
<!--전체-->
|
||||||
</form>
|
|
||||||
<div class="text-center">
|
|
||||||
<div id="spinner" class="spinner-border" role="status">
|
|
||||||
<span class="sr-only">Loading...</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<form id="program_auto_form">
|
|
||||||
<div id='episode_list'></div>
|
|
||||||
</form>
|
|
||||||
</div> <!--전체-->
|
|
||||||
|
|
||||||
|
|
||||||
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js"
|
||||||
|
></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 type="text/javascript">
|
<script type="text/javascript">
|
||||||
const package_name = "{{arg['package_name'] }}";
|
const package_name = "{{arg['package_name'] }}";
|
||||||
const sub = "{{arg['sub'] }}";
|
const sub = "{{arg['sub'] }}";
|
||||||
const ohli24_url = "{{arg['ohli24_url']}}";
|
const ohli24_url = "{{arg['ohli24_url']}}";
|
||||||
let current_data = null;
|
let current_data = null;
|
||||||
|
let page = 1;
|
||||||
|
let next_page = Number
|
||||||
|
let current_cate = ''
|
||||||
|
|
||||||
|
const observer = lozad('.lozad', {
|
||||||
|
rootMargin: '10px 0px', // syntax similar to that of CSS Margin
|
||||||
|
threshold: 0.1, // ratio of element convergence
|
||||||
|
enableAutoReload: true // it will reload the new image when validating attributes changes
|
||||||
|
});
|
||||||
|
observer.observe();
|
||||||
|
|
||||||
|
|
||||||
const get_anime_list = (type, page) => {
|
const get_anime_list = (type, page) => {
|
||||||
console.log(`type: ${type}, page: ${page}`)
|
console.log(`type: ${type}, page: ${page}`)
|
||||||
let url = ''
|
let url = ''
|
||||||
let data = {"page": page, "type": type}
|
let data = {"page": page, "type": type}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'ing':
|
case 'ing':
|
||||||
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
||||||
break;
|
current_cate = 'ing'
|
||||||
case 'movie':
|
break;
|
||||||
url = '/' + package_name + '/ajax/'+sub+'screen_movie_list'
|
case 'movie':
|
||||||
break;
|
url = '/' + package_name + '/ajax/'+sub+'/screen_movie_list'
|
||||||
case 'complete':
|
current_cate = 'movie'
|
||||||
url = '/' + package_name + '/ajax/'+sub+'screen_movie_list'
|
break;
|
||||||
break
|
case 'theater':
|
||||||
default:
|
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
||||||
break;
|
current_cate = 'theater'
|
||||||
}
|
break;
|
||||||
|
case 'fin':
|
||||||
|
url = '/' + package_name + '/ajax/'+sub+'/complete_list'
|
||||||
|
current_cate = 'fin'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: data,
|
data: data,
|
||||||
cache: false,
|
cache: false,
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: (ret) => {
|
success: (ret) => {
|
||||||
current_screen_movie_data = ret
|
current_screen_movie_data = ret
|
||||||
console.log('ret::>', ret)
|
console.log('ret::>', ret)
|
||||||
|
|
||||||
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)
|
||||||
} else {
|
observer.observe();
|
||||||
make_screen_movie_list(ret, page)
|
} else if (type === "fin") {
|
||||||
}
|
make_screen_movie_list(ret.data, page)
|
||||||
div_visible = true
|
observer.observe();
|
||||||
console.log(div_visible)
|
} else if (type === "theater") {
|
||||||
}
|
make_screen_movie_list(ret.data, page)
|
||||||
next_page = page + 1
|
observer.observe();
|
||||||
}
|
} else {
|
||||||
})
|
make_screen_movie_list(ret.data, page)
|
||||||
}
|
}
|
||||||
|
div_visible = true
|
||||||
|
console.log(div_visible)
|
||||||
function make_airing_list(data, page) {
|
}
|
||||||
let str = ''
|
next_page = page + 1
|
||||||
let tmp = ''
|
|
||||||
|
|
||||||
{#str += "<d"#}
|
|
||||||
{#str += m_hr_black();#}
|
|
||||||
{#str += m_row_start(0);#}
|
|
||||||
{##}
|
|
||||||
{#str += m_row_end();#}
|
|
||||||
{#str += m_hr_black();#}
|
|
||||||
str += '<div>';
|
|
||||||
str += '<button type="button" class="btn btn-info">Page <span class="badge bg-warning">' + page + '</span></button>';
|
|
||||||
str += '</div>';
|
|
||||||
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 += '<button id="code_button" data-code="' + data.episode[i].code + '" type="button" class="btn btn-primary code-button bootstrap-tooltip" data-toggle="button" data-tooltip="true" aria-pressed="true" autocomplete="off" data-placement="top">' +#}
|
|
||||||
{# '<span data-tooltip-text="'+data.episode[i].title+'">' + data.episode[i].code + '</span></button></div>';#}
|
|
||||||
tmp += '<h5 class="card-title">' + data.anime_list[i].title + '</h5>';
|
|
||||||
tmp += '<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
|
|
||||||
|
|
||||||
}
|
|
||||||
str += '</div>';
|
|
||||||
str += m_hr_black();
|
|
||||||
|
|
||||||
if (page > 1) {
|
|
||||||
|
|
||||||
const temp = document.createElement('div')
|
|
||||||
temp.innerHTML = str;
|
|
||||||
while (temp.firstChild) {
|
|
||||||
document.getElementById("screen_movie_list").appendChild(temp.firstChild);
|
|
||||||
}
|
|
||||||
page++
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
document.getElementById("screen_movie_list").innerHTML = str;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function make_screen_movie_list(data, page) {
|
|
||||||
let str = ''
|
|
||||||
let tmp = ''
|
|
||||||
|
|
||||||
{#str += "<d"#}
|
|
||||||
{#str += m_hr_black();#}
|
|
||||||
{#str += m_row_start(0);#}
|
|
||||||
{##}
|
|
||||||
{#str += m_row_end();#}
|
|
||||||
{#str += m_hr_black();#}
|
|
||||||
str += '<div>';
|
|
||||||
str += '<button type="button" class="btn btn-info">Page <span class="badge bg-warning">' + page + '</span></button>';
|
|
||||||
str += '</div>';
|
|
||||||
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 += '<button id="code_button" data-code="' + data.episode[i].code + '" type="button" class="btn btn-primary code-button bootstrap-tooltip" data-toggle="button" data-tooltip="true" aria-pressed="true" autocomplete="off" data-placement="top">' +#}
|
|
||||||
{# '<span data-tooltip-text="'+data.episode[i].title+'">' + data.episode[i].code + '</span></button></div>';#}
|
|
||||||
tmp += '<h5 class="card-title">' + data.anime_list[i].title + '</h5>';
|
|
||||||
tmp += '<p class="card-text">' + data.anime_list[i].code + '</p>';
|
|
||||||
tmp += '<a href="./request?code=' + data.anime_list[i].code + '" class="btn btn-primary cut-text">' + data.episode[i].title + '</a>';
|
|
||||||
tmp += '</div>';
|
|
||||||
tmp += '</div>';
|
|
||||||
tmp += '</div>';
|
|
||||||
str += tmp
|
|
||||||
|
|
||||||
}
|
|
||||||
str += '</div>';
|
|
||||||
str += m_hr_black();
|
|
||||||
|
|
||||||
if (page > 1) {
|
|
||||||
|
|
||||||
const temp = document.createElement('div')
|
|
||||||
temp.innerHTML = str;
|
|
||||||
while (temp.firstChild) {
|
|
||||||
document.getElementById("screen_movie_list").appendChild(temp.firstChild);
|
|
||||||
}
|
|
||||||
page++
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
document.getElementById("screen_movie_list").innerHTML = str;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
|
||||||
{#if ( "{{arg['ohli24_current_code']}}" !== "" ) {#}
|
|
||||||
{# document.getElementById("code").value = "{{arg['ohli24_current_code']}}";#}
|
|
||||||
{# // 값이 공백이 아니면 분석 버튼 계속 누름#}
|
|
||||||
{#document.getElementById("analysis_btn").click();#}
|
|
||||||
{#}#}
|
|
||||||
|
|
||||||
$('#anime_category #ing').on("click", function() {
|
|
||||||
{#console.log(this.id)#}
|
|
||||||
let spinner = document.getElementById('spinner');
|
|
||||||
spinner.style.visibility = 'visible';
|
|
||||||
get_anime_list("ing", 1)
|
|
||||||
})
|
|
||||||
|
|
||||||
// 분석 버튼 클릭시 호출
|
|
||||||
$("body").on('click', '#analysis_btn', function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
const code = document.getElementById("code").value
|
|
||||||
console.log(code)
|
|
||||||
$.ajax({
|
|
||||||
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
|
||||||
type: "POST",
|
|
||||||
cache: false,
|
|
||||||
data: {code:code},
|
|
||||||
dataType: "json",
|
|
||||||
success: function (ret) {
|
|
||||||
if (ret.ret === 'success' && ret.data != null) {
|
|
||||||
{#console.log(ret.code)#}
|
|
||||||
console.log(ret.data)
|
|
||||||
make_program(ret.data)
|
|
||||||
} else {
|
|
||||||
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
});
|
}
|
||||||
|
|
||||||
|
function make_airing_list(data, page) {
|
||||||
|
let str = ''
|
||||||
|
let tmp = ''
|
||||||
|
|
||||||
|
str += '<div>';
|
||||||
|
str += '<button type="button" class="btn btn-info">Page <span class="badge bg-warning">' + page + '</span></button>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '<div id="inner_screen_movie" class="row infinite-scroll">';
|
||||||
|
for (let i in data.anime_list) {
|
||||||
|
|
||||||
|
tmp = '<div class="col-6 col-sm-4 col-md-3">';
|
||||||
|
tmp += '<div class="card">';
|
||||||
|
// tmp += '<img class="lozad" data-src="' + data.anime_list[i].image_link + '" />';
|
||||||
|
tmp += '<img class="lazyload" src="../static/img_loader_x200.svg" data-original="' + data.anime_list[i].image_link + '" />';
|
||||||
|
tmp += '<div class="card-body">'
|
||||||
|
// {#tmp += '<button id="code_button" data-code="' + data.episode[i].code + '" type="button" class="btn btn-primary code-button bootstrap-tooltip" data-toggle="button" data-tooltip="true" aria-pressed="true" autocomplete="off" data-placement="top">' +#}
|
||||||
|
// {# '<span data-tooltip-text="'+data.episode[i].title+'">' + data.episode[i].code + '</span></button></div>';#}
|
||||||
|
tmp += '<h5 class="card-title">' + data.anime_list[i].title + '</h5>';
|
||||||
|
tmp += '<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
|
||||||
|
|
||||||
|
}
|
||||||
|
str += '</div>';
|
||||||
|
str += m_hr_black();
|
||||||
|
|
||||||
|
if (page > 1) {
|
||||||
|
|
||||||
|
const temp = document.createElement('div')
|
||||||
|
temp.innerHTML = str;
|
||||||
|
while (temp.firstChild) {
|
||||||
|
document.getElementById("screen_movie_list").appendChild(temp.firstChild);
|
||||||
|
}
|
||||||
|
page++
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
document.getElementById("screen_movie_list").innerHTML = str;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$("img.lazyload").lazyload({
|
||||||
|
threshold : 10,
|
||||||
|
effect : "fadeIn",
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function make_search_result_list(data, page) {
|
||||||
|
let str = ''
|
||||||
|
let tmp = ''
|
||||||
|
|
||||||
|
console.log(data.anime_list, page)
|
||||||
|
|
||||||
|
str += '<div>';
|
||||||
|
str += '<button type="button" class="btn btn-info">Page <span class="badge bg-warning">' + page + '</span></button>';
|
||||||
|
str += '</div>';
|
||||||
|
str += '<div id="inner_screen_movie" class="row infinite-scroll">';
|
||||||
|
for (let i in data.anime_list) {
|
||||||
|
if (data.anime_list[i].wr_id !== '') {
|
||||||
|
const re = /bo_table=([^&]+)/
|
||||||
|
const bo_table = data.anime_list[i].link.match(re)
|
||||||
|
// console.log(bo_table)
|
||||||
|
request_url = './request?code=' + data.anime_list[i].code + '&wr_id='+ data.anime_list[i].wr_id + '&bo_table='+bo_table[1]
|
||||||
|
} else {
|
||||||
|
request_url = './request?code=' + data.anime_list[i].code
|
||||||
|
}
|
||||||
|
|
||||||
|
tmp = '<div class="col-sm-4">';
|
||||||
|
tmp += '<div class="card">';
|
||||||
|
tmp += '<img class="card-img-top" src="' + data.anime_list[i].image_link + '" />';
|
||||||
|
tmp += '<div class="card-body">'
|
||||||
|
// {#tmp += '<button id="code_button" data-code="' + data.episode[i].code + '" type="button" class="btn btn-primary code-button bootstrap-tooltip" data-toggle="button" data-tooltip="true" aria-pressed="true" autocomplete="off" data-placement="top">' +#}
|
||||||
|
// {# '<span data-tooltip-text="'+data.episode[i].title+'">' + data.episode[i].code + '</span></button></div>';#}
|
||||||
|
tmp += '<h5 class="card-title">' + data.anime_list[i].title + '</h5>';
|
||||||
|
tmp += '<p class="card-text">' + data.anime_list[i].code + '</p>';
|
||||||
|
tmp += '<a href="'+request_url+'" class="btn btn-primary cut-text">' + data.anime_list[i].title + '</a>';
|
||||||
|
tmp += '</div>';
|
||||||
|
tmp += '</div>';
|
||||||
|
tmp += '</div>';
|
||||||
|
str += tmp
|
||||||
|
|
||||||
|
}
|
||||||
|
str += '</div>';
|
||||||
|
str += m_hr_black();
|
||||||
|
|
||||||
|
if (page > 1) {
|
||||||
|
|
||||||
|
const temp = document.createElement('div')
|
||||||
|
temp.innerHTML = str;
|
||||||
|
while (temp.firstChild) {
|
||||||
|
document.getElementById("screen_movie_list").appendChild(temp.firstChild);
|
||||||
|
}
|
||||||
|
page++
|
||||||
|
|
||||||
|
} else {
|
||||||
|
document.getElementById("screen_movie_list").innerHTML = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function make_screen_movie_list(data, page) {
|
||||||
|
let str = ''
|
||||||
|
let tmp = ''
|
||||||
|
|
||||||
|
console.log(data.anime_list, page)
|
||||||
|
|
||||||
|
str += '<div>';
|
||||||
|
str += '<button type="button" class="btn btn-info">Page <span class="badge bg-warning">' + page + '</span></button>';
|
||||||
|
str += '</div>';
|
||||||
|
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
|
||||||
|
|
||||||
|
}
|
||||||
|
str += '</div>';
|
||||||
|
str += m_hr_black();
|
||||||
|
|
||||||
|
if (page > 1) {
|
||||||
|
|
||||||
|
const temp = document.createElement('div')
|
||||||
|
temp.innerHTML = str;
|
||||||
|
while (temp.firstChild) {
|
||||||
|
document.getElementById("screen_movie_list").appendChild(temp.firstChild);
|
||||||
|
}
|
||||||
|
page++
|
||||||
|
|
||||||
|
} else {
|
||||||
|
document.getElementById("screen_movie_list").innerHTML = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("img.lazyload").lazyload({
|
||||||
|
threshold : 10,
|
||||||
|
effect : "fadeIn",
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
$("body").on('click', '#go_ohli24_btn', function(e){
|
// if ( "{{arg['ohli24_current_code']}}" !== "" ) {
|
||||||
e.preventDefault();
|
// document.getElementById("code").value = "{{arg['ohli24_current_code']}}";
|
||||||
window.open("{{arg['ohli24_url']}}", "_blank");
|
// // 값이 공백이 아니면 분석 버튼 계속 누름
|
||||||
});
|
// document.getElementById("analysis_btn").click();
|
||||||
|
// }
|
||||||
$("body").on('click', '#all_check_on_btn', function(e){
|
$("#input_search").keydown(function (key) {
|
||||||
e.preventDefault();
|
if (key.keyCode === 13) {
|
||||||
$('input[id^="checkbox_"]').bootstrapToggle('on')
|
// alert("엔터키를 눌렀습니다.");
|
||||||
});
|
$("#btn_search").trigger("click");
|
||||||
|
|
||||||
$("body").on('click', '#all_check_off_btn', function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
$('input[id^="checkbox_"]').bootstrapToggle('off')
|
|
||||||
});
|
|
||||||
|
|
||||||
$("body").on('click', '#add_queue_btn', function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
data = current_data.episode[$(this).data('idx')];
|
|
||||||
console.log('data:::>', data)
|
|
||||||
$.ajax({
|
|
||||||
url: '/' + package_name + '/ajax/' + sub + '/add_queue',
|
|
||||||
type: "POST",
|
|
||||||
cache: false,
|
|
||||||
data: {data:JSON.stringify(data)},
|
|
||||||
dataType: "json",
|
|
||||||
success: function (data) {
|
|
||||||
if (data.ret == 'enqueue_db_append' || data.ret == 'enqueue_db_exist') {
|
|
||||||
$.notify('<strong>다운로드 작업을 추가 하였습니다.</strong>', {type: 'success'});
|
|
||||||
} else if (data.ret == 'queue_exist') {
|
|
||||||
$.notify('<strong>이미 큐에 있습니다. 삭제 후 추가하세요.</strong>', {type: 'warning'});
|
|
||||||
} else if (data.ret == 'db_completed') {
|
|
||||||
$.notify('<strong>DB에 완료 기록이 있습니다.</strong>', {type: 'warning'});
|
|
||||||
} else {
|
|
||||||
$.notify('<strong>추가 실패</strong><br>' + ret.log, {type: 'warning'});
|
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
const observer = lozad('.lozad', {
|
||||||
|
rootMargin: '10px 0px', // syntax similar to that of CSS Margin
|
||||||
|
threshold: 0.1, // ratio of element convergence
|
||||||
|
enableAutoReload: true // it will reload the new image when validating attributes changes
|
||||||
|
});
|
||||||
|
observer.observe();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").on("click", "#btn_search", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
let query = $("#input_search").val();
|
||||||
|
console.log(query);
|
||||||
|
|
||||||
|
if ($("#input_search").val() === "") {
|
||||||
|
console.log("search keyword nothing");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/" + package_name + "/ajax/" + sub + "/search",
|
||||||
|
type: "POST",
|
||||||
|
cache: false,
|
||||||
|
data: { query: query },
|
||||||
|
// dataType: "json",
|
||||||
|
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
|
||||||
|
success: function (ret) {
|
||||||
|
if (ret.ret) {
|
||||||
|
console.log('ret:::', ret)
|
||||||
|
make_search_result_list(ret.data, 1);
|
||||||
|
} else {
|
||||||
|
$.notify("<strong>분석 실패</strong><br>" + ret.log, {
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#anime_category #ing').on("click", function() {
|
||||||
|
// {#console.log(this.id)#}
|
||||||
|
let spinner = document.getElementById('spinner');
|
||||||
|
spinner.style.visibility = 'visible';
|
||||||
|
get_anime_list("ing", 1)
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#anime_category #complete_anilist').on("click", function() {
|
||||||
|
// {#console.log(this.id)#}
|
||||||
|
let spinner = document.getElementById('spinner');
|
||||||
|
spinner.style.visibility = 'visible';
|
||||||
|
get_anime_list("fin", 1)
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#anime_category #theater').on("click", function() {
|
||||||
|
// {#console.log(this.id)#}
|
||||||
|
let spinner = document.getElementById('spinner');
|
||||||
|
spinner.style.visibility = 'visible';
|
||||||
|
get_anime_list("theater", 1)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 분석 버튼 클릭시 호출
|
||||||
|
$("body").on('click', '#analysis_btn', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
const code = document.getElementById("code").value
|
||||||
|
console.log(code)
|
||||||
|
$.ajax({
|
||||||
|
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
||||||
|
type: "POST",
|
||||||
|
cache: false,
|
||||||
|
data: {code: code},
|
||||||
|
dataType: "json",
|
||||||
|
success: function (ret) {
|
||||||
|
if (ret.ret === 'success' && ret.data != null) {
|
||||||
|
// console.log(ret.code)
|
||||||
|
console.log(ret.data)
|
||||||
|
make_program(ret.data)
|
||||||
|
} else {
|
||||||
|
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("body").on('click', '#go_ohli24_btn', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
window.open("{{arg['ohli24_url']}}", "_blank");
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").on('click', '#all_check_on_btn', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
$('input[id^="checkbox_"]').bootstrapToggle('on')
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").on('click', '#all_check_off_btn', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
$('input[id^="checkbox_"]').bootstrapToggle('off')
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").on('click', '#add_queue_btn', function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
data = current_data.episode[$(this).data('idx')];
|
||||||
|
console.log('data:::>', data)
|
||||||
|
$.ajax({
|
||||||
|
url: '/' + package_name + '/ajax/' + sub + '/add_queue',
|
||||||
|
type: "POST",
|
||||||
|
cache: false,
|
||||||
|
data: {data:JSON.stringify(data)},
|
||||||
|
dataType: "json",
|
||||||
|
success: function (data) {
|
||||||
|
if (data.ret == 'enqueue_db_append' || data.ret == 'enqueue_db_exist') {
|
||||||
|
$.notify('<strong>다운로드 작업을 추가 하였습니다.</strong>', {type: 'success'});
|
||||||
|
} else if (data.ret == 'queue_exist') {
|
||||||
|
$.notify('<strong>이미 큐에 있습니다. 삭제 후 추가하세요.</strong>', {type: 'warning'});
|
||||||
|
} else if (data.ret == 'db_completed') {
|
||||||
|
$.notify('<strong>DB에 완료 기록이 있습니다.</strong>', {type: 'warning'});
|
||||||
|
} else {
|
||||||
|
$.notify('<strong>추가 실패</strong><br>' + ret.log, {type: 'warning'});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// const observer = lozad();
|
||||||
|
// const el = document.querySelector('img');
|
||||||
|
// const observer = lozad(el); // passing a `NodeList` (e.g. `document.querySelectorAll()`) is also valid
|
||||||
|
// observer.observe();
|
||||||
|
const loadNextAnimes = (cate, page) => {
|
||||||
|
spinner.style.display = "block";
|
||||||
|
const data = { type: cate, page: String(page) };
|
||||||
|
let url = ''
|
||||||
|
switch (cate) {
|
||||||
|
case 'ing':
|
||||||
|
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
||||||
|
current_cate = 'ing'
|
||||||
|
break;
|
||||||
|
case 'movie':
|
||||||
|
url = '/' + package_name + '/ajax/'+sub+'/screen_movie_list'
|
||||||
|
current_cate = 'movie'
|
||||||
|
break;
|
||||||
|
case 'theater':
|
||||||
|
url = '/' + package_name + '/ajax/'+sub+'/anime_list'
|
||||||
|
current_cate = 'theater'
|
||||||
|
break;
|
||||||
|
case 'fin':
|
||||||
|
url = '/' + package_name + '/ajax/'+sub+'/complete_list'
|
||||||
|
current_cate = 'fin'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch(url, {
|
||||||
|
method: "POST",
|
||||||
|
cache: "no-cache",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
|
},
|
||||||
|
body: new URLSearchParams(data),
|
||||||
|
})
|
||||||
|
.then((res) => res.json())
|
||||||
|
.then((response) => {
|
||||||
|
console.log("Success:", JSON.stringify(response));
|
||||||
|
// {#imagesContainer.appendChild()#}
|
||||||
|
console.log("return page:::> ", response.page);
|
||||||
|
// {#page = response.page#}
|
||||||
|
make_screen_movie_list(response.data, response.page);
|
||||||
|
|
||||||
|
page++;
|
||||||
|
next_page++;
|
||||||
|
})
|
||||||
|
.catch((error) => console.error("Error:", error));
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const onScroll = (e) => {
|
||||||
|
console.dir(e.target.scrollingElement.scrollHeight);
|
||||||
|
const { scrollTop, scrollHeight, clientHeight } = e.target.scrollingElement;
|
||||||
|
if (Math.round(scrollHeight - scrollTop) <= clientHeight) {
|
||||||
|
document.getElementById("spinner").style.display = "block";
|
||||||
|
console.log("loading");
|
||||||
|
console.log("now page::> ", page);
|
||||||
|
console.log("next_page::> ", next_page);
|
||||||
|
loadNextAnimes(current_cate, next_page);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const debounce = (func, delay) => {
|
||||||
|
let timeoutId = null;
|
||||||
|
return (...args) => {
|
||||||
|
clearTimeout(timeoutId);
|
||||||
|
timeoutId = setTimeout(func.bind(null, ...args), delay);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener("scroll", debounce(onScroll, 300));
|
||||||
</script>
|
</script>
|
||||||
|
<style>
|
||||||
|
button.code-button {
|
||||||
|
min-width: 82px !important;
|
||||||
|
}
|
||||||
|
.tooltip {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
@media (min-width: 576px) {
|
||||||
|
.container {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[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;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -1,169 +1,366 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %} {% block content %}
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<form id='program_list'>
|
<form id="program_list">
|
||||||
{{ macros.setting_input_text_and_buttons('code', '작품 Code', [['analysis_btn', '분석'], ['go_ohli24_btn', 'Go OHLI24']], desc='예) "https://ohli24.net/c/녹을 먹는 비스코" 이나 "녹을 먹는 비스코"') }}
|
{{ macros.setting_input_text_and_buttons('code', '작품 Code',
|
||||||
|
[['analysis_btn', '분석'], ['go_ohli24_btn', 'Go OHLI24']], desc='예)
|
||||||
|
"https://ohli24.net/c/녹을 먹는 비스코" 이나 "녹을 먹는 비스코"') }}
|
||||||
</form>
|
</form>
|
||||||
<form id="program_auto_form">
|
<form id="program_auto_form">
|
||||||
<div id='episode_list'></div>
|
<div id="episode_list"></div>
|
||||||
</form>
|
</form>
|
||||||
</div> <!--전체-->
|
</div>
|
||||||
|
<!--전체-->
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const package_name = "{{arg['package_name'] }}";
|
const package_name = "{{arg['package_name'] }}";
|
||||||
const sub = "{{arg['sub'] }}";
|
const sub = "{{arg['sub'] }}";
|
||||||
const ohli24_url = "{{arg['ohli24_url']}}";
|
const ohli24_url = "{{arg['ohli24_url']}}";
|
||||||
let current_data = null;
|
let current_data = null;
|
||||||
|
|
||||||
const params = new Proxy(new URLSearchParams(window.location.search), {
|
const params = new Proxy(new URLSearchParams(window.location.search), {
|
||||||
get: (searchParams, prop) => searchParams.get(prop),
|
get: (searchParams, prop) => searchParams.get(prop),
|
||||||
})
|
})
|
||||||
|
|
||||||
$(document).ready(function(){
|
|
||||||
console.log(params.code)
|
|
||||||
if (params.code === '') {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
document.getElementById("code").value = params.code
|
|
||||||
{#document.getElementById("analysis_btn").click();#}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( "{{arg['ohli24_current_code']}}" !== "") {
|
|
||||||
if (params.code === null && params.code === '') {
|
|
||||||
document.getElementById("code").value = "{{arg['ohli24_current_code']}}";
|
|
||||||
} else {
|
|
||||||
document.getElementById("code").value = params.code
|
|
||||||
}
|
|
||||||
// 값이 공백이 아니면 분석 버튼 계속 누름
|
|
||||||
{#document.getElementById("analysis_btn").click();#}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 분석 버튼 클릭시 호출
|
function findGetParameter(parameterName) {
|
||||||
$("body").on('click', '#analysis_btn', function(e){
|
let result = null,
|
||||||
e.preventDefault();
|
tmp = [];
|
||||||
const code = document.getElementById("code").value
|
const items = location.search.substr(1).split("&");
|
||||||
console.log(code)
|
for (let index = 0; index < items.length; index++) {
|
||||||
$.ajax({
|
tmp = items[index].split("=");
|
||||||
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
|
||||||
type: "POST",
|
}
|
||||||
cache: false,
|
return result;
|
||||||
data: {code:code},
|
}
|
||||||
dataType: "json",
|
|
||||||
success: function (ret) {
|
|
||||||
if (ret.ret === 'success' && ret.data != null) {
|
|
||||||
{#console.log(ret.code)#}
|
|
||||||
console.log(ret.data)
|
|
||||||
make_program(ret.data)
|
|
||||||
} else {
|
|
||||||
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function make_program(data) {
|
function analyze(wr_id, bo_table) {
|
||||||
current_data = data;
|
// e.preventDefault();
|
||||||
console.log(current_data)
|
const code = document.getElementById("code").value
|
||||||
str = '';
|
console.log(code)
|
||||||
tmp = '<div class="form-inline">'
|
|
||||||
tmp += m_button('check_download_btn', '선택 다운로드 추가', []);
|
|
||||||
tmp += m_button('all_check_on_btn', '전체 선택', []);
|
|
||||||
tmp += m_button('all_check_off_btn', '전체 해제', []);
|
|
||||||
/*
|
|
||||||
tmp += ' <input id="new_title" name="new_title" class="form-control form-control-sm" value="'+data.title+'">'
|
|
||||||
tmp += '</div>'
|
|
||||||
tmp += m_button('apply_new_title_btn', '저장폴더명, 파일명 제목 변경', []);
|
|
||||||
tmp += m_button('search_tvdb_btn', 'TVDB', []);
|
|
||||||
tmp = m_button_group(tmp)
|
|
||||||
*/
|
|
||||||
str += tmp
|
|
||||||
// program
|
|
||||||
str += m_hr_black();
|
|
||||||
str += m_row_start(0);
|
|
||||||
tmp = ''
|
|
||||||
if (data.image != null)
|
|
||||||
tmp = '<img src="' + data.image + '" class="img-fluid">';
|
|
||||||
str += m_col(3, tmp)
|
|
||||||
tmp = ''
|
|
||||||
tmp += m_row_start(2) + m_col(3, '제목', 'right') + m_col(9, data.title) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '원제', 'right') + m_col(9, data.des._otit) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '감독', 'right') + m_col(9, data.des._dir) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '제작사', 'right') + m_col(9, data.des._pub) + m_row_end();
|
|
||||||
{#tmp += m_row_start(2) + m_col(3, '장르', 'right') + m_col(9, data.des._tag.join(' | ')) + m_row_end();#}
|
|
||||||
tmp += m_row_start(2) + m_col(3, '장르', 'right') + m_col(9, data.des._tag) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '분류', 'right') + m_col(9, data.des._classifi) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '방영일', 'right') + m_col(9, data.date+'('+data.day+')') + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '등급', 'right') + m_col(9, data.des._grade) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '총화수', 'right') + m_col(9, data.des._total_chapter) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '상영시간', 'right') + m_col(9, data.des._show_time) + m_row_end();
|
|
||||||
tmp += m_row_start(2) + m_col(3, '줄거리', 'right') + m_col(9, data.ser_description) + m_row_end();
|
|
||||||
str += m_col(9, tmp)
|
|
||||||
str += m_row_end();
|
|
||||||
|
|
||||||
str += m_hr_black();
|
|
||||||
for (i in data.episode) {
|
|
||||||
str += m_row_start(); tmp = '';
|
|
||||||
if (data.episode[i].thumbnail)
|
|
||||||
tmp = '<img src="'+ data.episode[i].thumbnail + '" class="img-fluid">'
|
|
||||||
str += m_col(3, tmp)
|
|
||||||
tmp = '<strong>' + data.episode[i].title+ '</strong>';
|
|
||||||
tmp += '<br>';
|
|
||||||
tmp += data.episode[i].date + '<br>';
|
|
||||||
|
|
||||||
tmp += '<div class="form-inline">'
|
|
||||||
tmp += '<input id="checkbox_'+i+'" name="checkbox_'+i+'" type="checkbox" checked data-toggle="toggle" data-on="선 택" data-off="-" data-onstyle="success" data-offstyle="danger" data-size="small"> '
|
|
||||||
tmp += m_button('add_queue_btn', '다운로드 추가', [{'key':'idx', 'value':i}])
|
|
||||||
tmp += '</div>'
|
|
||||||
str += m_col(9, tmp)
|
|
||||||
str += m_row_end();
|
|
||||||
if (i != data.length -1) str += m_hr(0);
|
|
||||||
}
|
|
||||||
document.getElementById("episode_list").innerHTML = str;
|
|
||||||
$('input[id^="checkbox_"]').bootstrapToggle()
|
|
||||||
}
|
|
||||||
|
|
||||||
$("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({
|
$.ajax({
|
||||||
url: '/' + package_name + '/ajax/' + sub + '/add_queue',
|
url: '/' + package_name + '/ajax/' + sub + '/analysis',
|
||||||
type: "POST",
|
type: "POST",
|
||||||
cache: false,
|
cache: false,
|
||||||
data: {data:JSON.stringify(data)},
|
data: {code: code, wr_id: wr_id, bo_table: bo_table},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (data) {
|
success: function (ret) {
|
||||||
if (data.ret == 'enqueue_db_append' || data.ret == 'enqueue_db_exist') {
|
if (ret.ret === 'success' && ret.data != null) {
|
||||||
$.notify('<strong>다운로드 작업을 추가 하였습니다.</strong>', {type: 'success'});
|
// {#console.log(ret.code)#}
|
||||||
} else if (data.ret == 'queue_exist') {
|
console.log(ret.data)
|
||||||
$.notify('<strong>이미 큐에 있습니다. 삭제 후 추가하세요.</strong>', {type: 'warning'});
|
make_program(ret.data)
|
||||||
} else if (data.ret == 'db_completed') {
|
} else {
|
||||||
$.notify('<strong>DB에 완료 기록이 있습니다.</strong>', {type: 'warning'});
|
$.notify('<strong>분석 실패</strong><br>' + ret.log, {type: 'warning'});
|
||||||
} else {
|
}
|
||||||
$.notify('<strong>추가 실패</strong><br>' + ret.log, {type: 'warning'});
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
function make_program(data) {
|
||||||
|
current_data = data;
|
||||||
|
console.log("current_data::", current_data)
|
||||||
|
str = '';
|
||||||
|
tmp = '<div class="form-inline">'
|
||||||
|
tmp += m_button('check_download_btn', '선택 다운로드 추가', []);
|
||||||
|
tmp += m_button('all_check_on_btn', '전체 선택', []);
|
||||||
|
tmp += m_button('all_check_off_btn', '전체 해제', []);
|
||||||
|
/*
|
||||||
|
tmp += ' <input id="new_title" name="new_title" class="form-control form-control-sm" value="'+data.title+'">'
|
||||||
|
tmp += '</div>'
|
||||||
|
tmp += m_button('apply_new_title_btn', '저장폴더명, 파일명 제목 변경', []);
|
||||||
|
tmp += m_button('search_tvdb_btn', 'TVDB', []);
|
||||||
|
tmp = m_button_group(tmp)
|
||||||
|
*/
|
||||||
|
str += tmp
|
||||||
|
// program
|
||||||
|
str += m_hr_black();
|
||||||
|
str += m_row_start(0);
|
||||||
|
tmp = ''
|
||||||
|
if (data.image != null)
|
||||||
|
tmp = '<img src="' + data.image + '" class="img-fluid">';
|
||||||
|
str += m_col(3, tmp)
|
||||||
|
tmp = ''
|
||||||
|
tmp += m_row_start(2) + m_col(3, '제목', 'right') + m_col(9, data.title) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '원제', 'right') + m_col(9, data.des._otit) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '감독', 'right') + m_col(9, data.des._dir) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '제작사', 'right') + m_col(9, data.des._pub) + m_row_end();
|
||||||
|
{#tmp += m_row_start(2) + m_col(3, '장르', 'right') + m_col(9, data.des._tag.join(' | ')) + m_row_end();#}
|
||||||
|
tmp += m_row_start(2) + m_col(3, '장르', 'right') + m_col(9, data.des._tag) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '분류', 'right') + m_col(9, data.des._classifi) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '방영일', 'right') + m_col(9, data.date+'('+data.day+')') + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '등급', 'right') + m_col(9, data.des._grade) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '총화수', 'right') + m_col(9, data.des._total_chapter) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '상영시간', 'right') + m_col(9, data.des._show_time) + m_row_end();
|
||||||
|
tmp += m_row_start(2) + m_col(3, '줄거리', 'right') + m_col(9, data.ser_description) + m_row_end();
|
||||||
|
str += m_col(9, tmp)
|
||||||
|
str += m_row_end();
|
||||||
|
|
||||||
|
str += m_hr_black();
|
||||||
|
for (i in data.episode) {
|
||||||
|
str += m_row_start(); tmp = '';
|
||||||
|
if (data.episode[i].thumbnail)
|
||||||
|
tmp = '<img src="'+ data.episode[i].thumbnail + '" class="img-fluid">'
|
||||||
|
str += m_col(3, tmp)
|
||||||
|
tmp = '<strong>' + data.episode[i].title+ '</strong>';
|
||||||
|
tmp += '<br>';
|
||||||
|
tmp += data.episode[i].date + '<br>';
|
||||||
|
|
||||||
|
tmp += '<div class="form-inline">'
|
||||||
|
tmp += '<input id="checkbox_'+i+'" name="checkbox_'+i+'" type="checkbox" checked data-toggle="toggle" data-on="선 택" data-off="-" data-onstyle="success" data-offstyle="danger" data-size="small"> '
|
||||||
|
tmp += m_button('add_queue_btn', '다운로드 추가', [{'key':'idx', 'value':i}])
|
||||||
|
tmp += '</div>'
|
||||||
|
str += m_col(9, tmp)
|
||||||
|
str += m_row_end();
|
||||||
|
if (i != data.length -1) str += m_hr(0);
|
||||||
|
}
|
||||||
|
document.getElementById("episode_list").innerHTML = str;
|
||||||
|
$('input[id^="checkbox_"]').bootstrapToggle()
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
console.log(params.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>
|
</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;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user