2022.11.12 (01. bug fixed)

This commit is contained in:
2022-11-30 23:03:41 +09:00
parent e7bb53c33b
commit ebed736c2f
12 changed files with 1341 additions and 1600 deletions

View File

@@ -1,368 +0,0 @@
import abc
import os
import queue
import threading
import time
import traceback
from datetime import datetime
import requests
# from flaskfarm.lib.plugin import get_model_setting
from flaskfarm.lib.support.expand.ffmpeg import SupportFfmpeg
# from flaskfarm.lib.system.setup import SystemModelSetting
from flaskfarm.lib.tool import ToolUtil
# from flaskfarm.lib.system.setup import P as SM
# from flaskfarm.lib.system.mod_setting import ModuleSetting as SM
from ..setup import *
class FfmpegQueueEntity(abc.ABCMeta('ABC', (object,), {'__slots__': ()})):
def __init__(self, P, module_logic, info):
self.P = P
# SupportFfmpeg.initialize()
self.module_logic = module_logic
self.entity_id = -1 # FfmpegQueueEntity.static_index
self.info = info
self.url = None
self.ffmpeg_status = -1
self.ffmpeg_status_kor = u'대기중'
self.ffmpeg_percent = 0
self.ffmpeg_arg = None
self.cancel = False
self.created_time = datetime.now().strftime('%m-%d %H:%M:%S')
self.savepath = None
self.filename = None
self.filepath = None
self.quality = None
self.headers = None
# FfmpegQueueEntity.static_index += 1
# FfmpegQueueEntity.entity_list.append(self)
def get_video_url(self):
return self.url
def get_video_filepath(self):
return self.filepath
@abc.abstractmethod
def refresh_status(self):
pass
@abc.abstractmethod
def info_dict(self, tmp):
pass
def download_completed(self):
pass
def as_dict(self):
tmp = {}
tmp['entity_id'] = self.entity_id
tmp['url'] = self.url
tmp['ffmpeg_status'] = self.ffmpeg_status
tmp['ffmpeg_status_kor'] = self.ffmpeg_status_kor
tmp['ffmpeg_percent'] = self.ffmpeg_percent
tmp['ffmpeg_arg'] = self.ffmpeg_arg
tmp['cancel'] = self.cancel
tmp['created_time'] = self.created_time # .strftime('%m-%d %H:%M:%S')
tmp['savepath'] = self.savepath
tmp['filename'] = self.filename
tmp['filepath'] = self.filepath
tmp['quality'] = self.quality
# tmp['current_speed'] = self.ffmpeg_arg['current_speed'] if self.ffmpeg_arg is not None else ''
tmp = self.info_dict(tmp)
return tmp
class FfmpegQueue(object):
def __init__(self, P, max_ffmpeg_count):
self.P = P
self.static_index = 1
self.entity_list = []
self.current_ffmpeg_count = 0
self.download_queue = None
self.download_thread = None
self.max_ffmpeg_count = max_ffmpeg_count
if self.max_ffmpeg_count is None or self.max_ffmpeg_count == '':
self.max_ffmpeg_count = 1
def queue_start(self):
try:
if self.download_queue is None:
self.download_queue = queue.Queue()
if self.download_thread is None:
self.download_thread = threading.Thread(target=self.download_thread_function, args=())
self.download_thread.daemon = True
self.download_thread.start()
except Exception as exception:
self.P.logger.error('Exception:%s', exception)
self.P.logger.error(traceback.format_exc())
def download_thread_function(self):
while True:
try:
while True:
try:
if self.current_ffmpeg_count < self.max_ffmpeg_count:
break
time.sleep(5)
except Exception as exception:
self.P.logger.error('Exception:%s', exception)
self.P.logger.error(traceback.format_exc())
self.P.logger.error('current_ffmpeg_count : %s', self.current_ffmpeg_count)
self.P.logger.error('max_ffmpeg_count : %s', self.max_ffmpeg_count)
break
entity = self.download_queue.get()
if entity.cancel:
continue
# from .logic_ani24 import LogicAni24
# entity.url = LogicAni24.get_video_url(entity.info['code'])
video_url = entity.get_video_url()
if video_url is None:
entity.ffmpeg_status_kor = 'URL실패'
entity.refresh_status()
# plugin.socketio_list_refresh()
continue
# import ffmpeg
# max_pf_count = 0
# save_path = ModelSetting.get('download_path')
# if ModelSetting.get('auto_make_folder') == 'True':
# program_path = os.path.join(save_path, entity.info['filename'].split('.')[0])
# save_path = program_path
# try:
# if not os.path.exists(save_path):
# os.makedirs(save_path)
# except:
# logger.debug('program path make fail!!')
# 파일 존재여부 체크
print(entity.info)
filepath = entity.get_video_filepath()
P.logger.debug(f'filepath:: {filepath}')
if os.path.exists(filepath):
entity.ffmpeg_status_kor = '파일 있음'
entity.ffmpeg_percent = 100
entity.refresh_status()
# plugin.socketio_list_refresh()
continue
dirname = os.path.dirname(filepath)
# filename = os.path.f
if not os.path.exists(dirname):
os.makedirs(dirname)
# f = ffmpeg.Ffmpeg(video_url, os.path.basename(filepath), plugin_id=entity.entity_id, listener=self.ffmpeg_listener, call_plugin=self.P.package_name, save_path=dirname, headers=entity.headers)
# print(filepath)
# print(os.path.basename(filepath))
# print(dirname)
# aa_sm = get_model_setting("system", P.logger)
P.logger.debug(P)
# P.logger.debug(P.system_setting.get("port"))
ffmpeg = SupportFfmpeg(video_url, os.path.basename(str(filepath)),
callback_function=self.callback_function,
max_pf_count=0, save_path=ToolUtil.make_path(dirname), timeout_minute=60,
)
#
ffmpeg.start()
self.current_ffmpeg_count += 1
self.download_queue.task_done()
except Exception as exception:
self.P.logger.error('Exception:%s', exception)
self.P.logger.error(traceback.format_exc())
def callback_function(self, **args):
refresh_type = None
if args['type'] == 'status_change':
if args['status'] == SupportFfmpeg.Status.DOWNLOADING:
refresh_type = 'status_change'
elif args['status'] == SupportFfmpeg.Status.COMPLETED:
refresh_type = 'status_change'
elif args['status'] == SupportFfmpeg.Status.READY:
data = {'type': 'info',
'msg': '다운로드중 Duration(%s)' % args['data']['duration_str'] + '<br>' + args['data'][
'save_fullpath'], 'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'add'
elif args['type'] == 'last':
if args['status'] == SupportFfmpeg.Status.WRONG_URL:
data = {'type': 'warning', 'msg': '잘못된 URL입니다'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'add'
elif args['status'] == SupportFfmpeg.Status.WRONG_DIRECTORY:
data = {'type': 'warning', 'msg': '잘못된 디렉토리입니다.<br>' + args['data']['save_fullpath']}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'add'
elif args['status'] == SupportFfmpeg.Status.ERROR or args['status'] == SupportFfmpeg.Status.EXCEPTION:
data = {'type': 'warning', 'msg': '다운로드 시작 실패.<br>' + args['data']['save_fullpath']}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'add'
elif args['status'] == SupportFfmpeg.Status.USER_STOP:
data = {'type': 'warning', 'msg': '다운로드가 중지 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.COMPLETED:
data = {'type': 'success', 'msg': '다운로드가 완료 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.TIME_OVER:
data = {'type': 'warning', 'msg': '시간초과로 중단 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.PF_STOP:
data = {'type': 'warning', 'msg': 'PF초과로 중단 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.FORCE_STOP:
data = {'type': 'warning', 'msg': '강제 중단 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.HTTP_FORBIDDEN:
data = {'type': 'warning', 'msg': '403에러로 중단 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.ALREADY_DOWNLOADING:
data = {'type': 'warning', 'msg': '임시파일폴더에 파일이 있습니다.<br>' + args['data']['temp_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['type'] == 'normal':
if args['status'] == SupportFfmpeg.Status.DOWNLOADING:
refresh_type = 'status'
# P.logger.info(refresh_type)
self.socketio_callback(refresh_type, args['data'])
def ffmpeg_listener(self, **arg):
import ffmpeg
entity = self.get_entity_by_entity_id(arg['plugin_id'])
if entity is None:
return
if arg['type'] == 'status_change':
if arg['status'] == ffmpeg.Status.DOWNLOADING:
pass
elif arg['status'] == ffmpeg.Status.COMPLETED:
entity.donwload_completed()
elif arg['status'] == ffmpeg.Status.READY:
pass
elif arg['type'] == 'last':
self.current_ffmpeg_count += -1
elif arg['type'] == 'log':
pass
elif arg['type'] == 'normal':
pass
entity.ffmpeg_arg = arg
entity.ffmpeg_status = int(arg['status'])
entity.ffmpeg_status_kor = str(arg['status'])
entity.ffmpeg_percent = arg['data']['percent']
entity.ffmpeg_arg['status'] = str(arg['status'])
# self.P.logger.debug(arg)
# import plugin
# arg['status'] = str(arg['status'])
# plugin.socketio_callback('status', arg)
entity.refresh_status()
# FfmpegQueueEntity.static_index += 1
# FfmpegQueueEntity.entity_list.append(self)
def add_queue(self, entity):
try:
# entity = QueueEntity.create(info)
# if entity is not None:
# LogicQueue.download_queue.put(entity)
# return True
entity.entity_id = self.static_index
self.static_index += 1
self.entity_list.append(entity)
self.download_queue.put(entity)
return True
except Exception as exception:
self.P.logger.error('Exception:%s', exception)
self.P.logger.error(traceback.format_exc())
return False
def set_max_ffmpeg_count(self, max_ffmpeg_count):
self.max_ffmpeg_count = max_ffmpeg_count
def get_max_ffmpeg_count(self):
return self.max_ffmpeg_count
def command(self, cmd, entity_id):
self.P.logger.debug('command :%s %s', cmd, entity_id)
ret = {}
try:
if cmd == 'cancel':
self.P.logger.debug('command :%s %s', cmd, entity_id)
entity = self.get_entity_by_entity_id(entity_id)
if entity is not None:
if entity.ffmpeg_status == -1:
entity.cancel = True
entity.ffmpeg_status_kor = "취소"
# entity.refresh_status()
ret['ret'] = 'refresh'
elif entity.ffmpeg_status != 5:
ret['ret'] = 'notify'
ret['log'] = '다운로드중 상태가 아닙니다.'
else:
idx = entity.ffmpeg_arg['data']['idx']
import ffmpeg
ffmpeg.Ffmpeg.stop_by_idx(idx)
entity.refresh_status()
ret['ret'] = 'refresh'
elif cmd == 'reset':
if self.download_queue is not None:
with self.download_queue.mutex:
self.download_queue.queue.clear()
for _ in self.entity_list:
if _.ffmpeg_status == 5:
import ffmpeg
idx = _.ffmpeg_arg['data']['idx']
ffmpeg.Ffmpeg.stop_by_idx(idx)
self.entity_list = []
ret['ret'] = 'refresh'
elif cmd == 'delete_completed':
new_list = []
for _ in self.entity_list:
if _.ffmpeg_status_kor in [u'파일 있음', u'취소', u'사용자중지']:
continue
if _.ffmpeg_status != 7:
new_list.append(_)
self.entity_list = new_list
ret['ret'] = 'refresh'
elif cmd == 'remove':
new_list = []
for _ in self.entity_list:
if _.entity_id == entity_id:
continue
new_list.append(_)
self.entity_list = new_list
ret['ret'] = 'refresh'
return ret
except Exception as exception:
self.P.logger.error('Exception:%s', exception)
self.P.logger.error(traceback.format_exc())
def get_entity_by_entity_id(self, entity_id):
for _ in self.entity_list:
if _.entity_id == entity_id:
return _
return None
def get_entity_list(self):
ret = []
P.logger.debug(self)
for x in self.entity_list:
tmp = x.as_dict()
ret.append(tmp)
return ret

View File

@@ -23,7 +23,9 @@ class FfmpegQueueEntity(abc.ABCMeta('ABC', (object,), {'__slots__': ()})):
self.P = P
# SupportFfmpeg.initialize()
self.module_logic = module_logic
self.entity_id = -1 # FfmpegQueueEntity.static_index
self.entity_id = -1
self.entity_list = []
# FfmpegQueueEntity.static_index
self.info = info
self.url = None
self.ffmpeg_status = -1
@@ -97,8 +99,8 @@ class FfmpegQueue(object):
if self.download_thread is None:
self.download_thread = threading.Thread(target=self.download_thread_function, args=())
self.download_thread.daemon = True
# todo:
# self.download_thread.start()
# todo: 동작 방식 고찰
self.download_thread.start()
except Exception as exception:
self.P.logger.error(f'Exception: {exception}')
self.P.logger.error(traceback.format_exc())
@@ -170,7 +172,7 @@ class FfmpegQueue(object):
)
#
# todo: 임시로 start() 중지
# ffmpeg.start()
ffmpeg.start()
self.current_ffmpeg_count += 1
self.download_queue.task_done()
@@ -178,72 +180,72 @@ class FfmpegQueue(object):
self.P.logger.error('Exception:%s', exception)
self.P.logger.error(traceback.format_exc())
def callback_function(self, **args):
refresh_type = None
if args['type'] == 'status_change':
if args['status'] == SupportFfmpeg.Status.DOWNLOADING:
refresh_type = 'status_change'
elif args['status'] == SupportFfmpeg.Status.COMPLETED:
refresh_type = 'status_change'
elif args['status'] == SupportFfmpeg.Status.READY:
data = {'type': 'info',
'msg': '다운로드중 Duration(%s)' % args['data']['duration_str'] + '<br>' + args['data'][
'save_fullpath'], 'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'add'
elif args['type'] == 'last':
if args['status'] == SupportFfmpeg.Status.WRONG_URL:
data = {'type': 'warning', 'msg': '잘못된 URL입니다'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'add'
elif args['status'] == SupportFfmpeg.Status.WRONG_DIRECTORY:
data = {'type': 'warning', 'msg': '잘못된 디렉토리입니다.<br>' + args['data']['save_fullpath']}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'add'
elif args['status'] == SupportFfmpeg.Status.ERROR or args['status'] == SupportFfmpeg.Status.EXCEPTION:
data = {'type': 'warning', 'msg': '다운로드 시작 실패.<br>' + args['data']['save_fullpath']}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'add'
elif args['status'] == SupportFfmpeg.Status.USER_STOP:
data = {'type': 'warning', 'msg': '다운로드가 중지 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.COMPLETED:
data = {'type': 'success', 'msg': '다운로드가 완료 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.TIME_OVER:
data = {'type': 'warning', 'msg': '시간초과로 중단 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.PF_STOP:
data = {'type': 'warning', 'msg': 'PF초과로 중단 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.FORCE_STOP:
data = {'type': 'warning', 'msg': '강제 중단 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.HTTP_FORBIDDEN:
data = {'type': 'warning', 'msg': '403에러로 중단 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.ALREADY_DOWNLOADING:
data = {'type': 'warning', 'msg': '임시파일폴더에 파일이 있습니다.<br>' + args['data']['temp_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['type'] == 'normal':
if args['status'] == SupportFfmpeg.Status.DOWNLOADING:
refresh_type = 'status'
# P.logger.info(refresh_type)
self.socketio_callback(refresh_type, args['data'])
# def callback_function(self, **args):
# refresh_type = None
# if args['type'] == 'status_change':
# if args['status'] == SupportFfmpeg.Status.DOWNLOADING:
# refresh_type = 'status_change'
# elif args['status'] == SupportFfmpeg.Status.COMPLETED:
# refresh_type = 'status_change'
# elif args['status'] == SupportFfmpeg.Status.READY:
# data = {'type': 'info',
# 'msg': '다운로드중 Duration(%s)' % args['data']['duration_str'] + '<br>' + args['data'][
# 'save_fullpath'], 'url': '/ffmpeg/download/list'}
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
# refresh_type = 'add'
# elif args['type'] == 'last':
# if args['status'] == SupportFfmpeg.Status.WRONG_URL:
# data = {'type': 'warning', 'msg': '잘못된 URL입니다'}
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
# refresh_type = 'add'
# elif args['status'] == SupportFfmpeg.Status.WRONG_DIRECTORY:
# data = {'type': 'warning', 'msg': '잘못된 디렉토리입니다.<br>' + args['data']['save_fullpath']}
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
# refresh_type = 'add'
# elif args['status'] == SupportFfmpeg.Status.ERROR or args['status'] == SupportFfmpeg.Status.EXCEPTION:
# data = {'type': 'warning', 'msg': '다운로드 시작 실패.<br>' + args['data']['save_fullpath']}
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
# refresh_type = 'add'
# elif args['status'] == SupportFfmpeg.Status.USER_STOP:
# data = {'type': 'warning', 'msg': '다운로드가 중지 되었습니다.<br>' + args['data']['save_fullpath'],
# 'url': '/ffmpeg/download/list'}
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
# refresh_type = 'last'
# elif args['status'] == SupportFfmpeg.Status.COMPLETED:
# data = {'type': 'success', 'msg': '다운로드가 완료 되었습니다.<br>' + args['data']['save_fullpath'],
# 'url': '/ffmpeg/download/list'}
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
# refresh_type = 'last'
# elif args['status'] == SupportFfmpeg.Status.TIME_OVER:
# data = {'type': 'warning', 'msg': '시간초과로 중단 되었습니다.<br>' + args['data']['save_fullpath'],
# 'url': '/ffmpeg/download/list'}
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
# refresh_type = 'last'
# elif args['status'] == SupportFfmpeg.Status.PF_STOP:
# data = {'type': 'warning', 'msg': 'PF초과로 중단 되었습니다.<br>' + args['data']['save_fullpath'],
# 'url': '/ffmpeg/download/list'}
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
# refresh_type = 'last'
# elif args['status'] == SupportFfmpeg.Status.FORCE_STOP:
# data = {'type': 'warning', 'msg': '강제 중단 되었습니다.<br>' + args['data']['save_fullpath'],
# 'url': '/ffmpeg/download/list'}
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
# refresh_type = 'last'
# elif args['status'] == SupportFfmpeg.Status.HTTP_FORBIDDEN:
# data = {'type': 'warning', 'msg': '403에러로 중단 되었습니다.<br>' + args['data']['save_fullpath'],
# 'url': '/ffmpeg/download/list'}
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
# refresh_type = 'last'
# elif args['status'] == SupportFfmpeg.Status.ALREADY_DOWNLOADING:
# data = {'type': 'warning', 'msg': '임시파일폴더에 파일이 있습니다.<br>' + args['data']['temp_fullpath'],
# 'url': '/ffmpeg/download/list'}
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
# refresh_type = 'last'
# elif args['type'] == 'normal':
# if args['status'] == SupportFfmpeg.Status.DOWNLOADING:
# refresh_type = 'status'
# # P.logger.info(refresh_type)
# self.socketio_callback(refresh_type, args['data'])
def ffmpeg_listener(self, **arg):
import ffmpeg

View File

@@ -49,7 +49,8 @@ from framework import F
from plugin import (
PluginModuleBase
)
from .lib.ffmpeg_queue import FfmpegQueueEntity, FfmpegQueue
from .lib.ffmpeg_queue_v1 import FfmpegQueueEntity, FfmpegQueue
from support.expand.ffmpeg import SupportFfmpeg
from .lib.crawler import Crawler
# from tool_base import d
@@ -547,6 +548,40 @@ class LogicAniLife(PluginModuleBase):
P.logger.error("Exception:%s", e)
P.logger.error(traceback.format_exc())
def process_command(self, command, arg1, arg2, arg3, req):
ret = {'ret': 'success'}
logger.debug('queue_list')
if command == 'queue_list':
logger.debug(f"self.queue.get_entity_list():: {self.queue.get_entity_list()}")
ret = [x for x in self.queue.get_entity_list()]
return ret
elif command == 'download_program':
_pass = arg2
db_item = ModelOhli24Program.get(arg1)
if _pass == 'false' and db_item != None:
ret['ret'] = 'warning'
ret['msg'] = '이미 DB에 있는 항목 입니다.'
elif _pass == 'true' and db_item != None and ModelOhli24Program.get_by_id_in_queue(db_item.id) != None:
ret['ret'] = 'warning'
ret['msg'] = '이미 큐에 있는 항목 입니다.'
else:
if db_item == None:
db_item = ModelOhli24Program(arg1, self.get_episode(arg1))
db_item.save()
db_item.init_for_queue()
self.download_queue.put(db_item)
ret['msg'] = '다운로드를 추가 하였습니다.'
elif command == 'list':
ret = []
for ins in SupportFfmpeg.get_list():
ret.append(ins.get_data())
return jsonify(ret)
@staticmethod
def add_whitelist(*args):
ret = {}
@@ -650,7 +685,7 @@ class LogicAniLife(PluginModuleBase):
import json
post_data = {
"url": url,
"headless": True,
"headless": False,
"engine": "webkit"
}
payload = json.dumps(post_data)
@@ -830,8 +865,9 @@ class LogicAniLife(PluginModuleBase):
import json
post_data = {
"url": url,
"headless": True,
"engine": "chromium"
"headless": False,
"engine": "chrome",
"reload": True,
}
payload = json.dumps(post_data)
logger.debug(payload)
@@ -877,6 +913,7 @@ class LogicAniLife(PluginModuleBase):
# real_url = LogicAniLife.get_real_link(url=entity["link"])
entity["code"] = entity["link"].split("/")[-1]
entity["epx"] = item.xpath(".//span[@class='epx']/text()")[0].strip()
entity["title"] = item.xpath(".//div[@class='tt']/text()")[0].strip()
entity["image_link"] = item.xpath(".//div[@class='limit']/img/@src")[
0
@@ -986,14 +1023,15 @@ class AniLifeQueueEntity(FfmpegQueueEntity):
logger.info(f"self.info:::> {self.info}")
referer = "https://anilife.live/g/l?id=13fd4d28-ff18-4764-9968-7e7ea7347c51"
referer = LogicAniLife.episode_url
# text = requests.get(url, headers=headers).text
# text = LogicAniLife.get_html_seleniumwire(url, referer=referer, wired=True)
# https://anilife.live/ani/provider/10f60832-20d1-4918-be62-0f508bf5460c
referer_url = (
"https://anilife.live/g/l?id=d4be1e0e-301b-403b-be1b-cf19f3ccfd23"
"https://anilife.live/g/l?id=b012a355-a997-449a-ae2b-408a81a9b464"
)
referer_url = LogicAniLife.episode_url
logger.debug(f"LogicAniLife.episode_url:: {LogicAniLife.episode_url}")
@@ -1017,14 +1055,16 @@ class AniLifeQueueEntity(FfmpegQueueEntity):
# ))
# loop = asyncio.new_event_loop()
logger.debug(url, referer_url)
import json
post_data = {
"url": url,
"headless": True,
"engine": "chromium",
"headless": False,
# "engine": "chromium",
"engine": "webkit",
"referer": referer_url,
"stealth": "False"
"stealth": "False",
"reload": True,
}
payload = json.dumps(post_data)
logger.debug(payload)
@@ -1114,14 +1154,14 @@ class AniLifeQueueEntity(FfmpegQueueEntity):
# vod_1080p_url = asyncio.run(
# LogicAniLife.get_vod_url(jawcloud_url, headless=True)
# )
vod_1080p_url = LogicAniLife.get_vod_url_v2(jawcloud_url, headless=True)
vod_1080p_url = LogicAniLife.get_vod_url_v2(jawcloud_url, headless=False)
print(f"vod_1080p_url:: {vod_1080p_url}")
self.url = vod_1080p_url
logger.info(self.url)
except Exception as e:
P.logger.error("Exception:%s", e)
P.logger.error(f"Exception: str(e)")
P.logger.error(traceback.format_exc())

View File

@@ -52,7 +52,7 @@ from framework import F
from plugin import (
PluginModuleBase
)
from .lib.ffmpeg_queue import FfmpegQueueEntity, FfmpegQueue
from .lib.ffmpeg_queue_v1 import FfmpegQueueEntity, FfmpegQueue
from support.expand.ffmpeg import SupportFfmpeg
from .lib.util import Util
@@ -118,7 +118,7 @@ class LogicOhli24(PluginModuleBase):
}
self.queue = None
# default_route_socketio(P, self)
default_route_socketio_module(self, attach='/search')
default_route_socketio_module(self, attach='/queue')
@staticmethod
def db_init():
@@ -219,10 +219,6 @@ class LogicOhli24(PluginModuleBase):
# if db_item == None:
# db_item = ModelOhli24Program(info['_id'], self.get_episode(info['_id']))
# db_item.save()
elif sub == "entity_list":
return jsonify(self.queue.get_entity_list())
elif sub == "queue_list":
@@ -255,7 +251,8 @@ class LogicOhli24(PluginModuleBase):
thread.daemon = True
thread.start()
return jsonify("")
elif sub == "web_list":
elif sub == "web_list2":
logger.debug("web_list2")
return jsonify(ModelOhli24Item.web_list(request))
elif sub == "db_remove":
return jsonify(ModelOhli24Item.delete_by_id(req.form["id"]))
@@ -287,8 +284,9 @@ class LogicOhli24(PluginModuleBase):
def process_command(self, command, arg1, arg2, arg3, req):
ret = {'ret': 'success'}
logger.debug('queue_list')
if command == 'queue_list':
logger.debug('queue_list')
logger.debug(f"self.queue.get_entity_list():: {self.queue.get_entity_list()}")
ret = [x for x in self.queue.get_entity_list()]
@@ -315,6 +313,19 @@ class LogicOhli24(PluginModuleBase):
for ins in SupportFfmpeg.get_list():
ret.append(ins.get_data())
elif command == 'queue_command':
if arg1 == 'cancel':
pass
elif arg1 == 'reset':
logger.debug('reset')
# if self.queue is not None:
# with self.queue.mutex:
# self.queue.queue.clear()
if self.download_queue is not None:
with self.download_queue.mutex:
self.download_queue.queue.clear()
return jsonify(ret)
@staticmethod
@@ -751,8 +762,8 @@ class LogicOhli24(PluginModuleBase):
# self.callback_function, ffmpeg_modelsetting.get_int('max_pf_count'))
# plugin loading download_queue 가 없으면 생성
if self.download_queue is None:
self.download_queue = queue.Queue()
# if self.download_queue is None:
# self.download_queue = queue.Queue()
SupportFfmpeg.initialize("ffmpeg", os.path.join(F.config['path_data'], 'tmp'),
self.callback_function, 1)
@@ -762,7 +773,7 @@ class LogicOhli24(PluginModuleBase):
P, P.ModelSetting.get_int("ohli24_max_ffmpeg_process_count")
)
self.current_data = None
# self.queue.queue_start()
self.queue.queue_start()
except Exception as e:
logger.error("Exception:%s", e)
@@ -859,13 +870,16 @@ class LogicOhli24(PluginModuleBase):
return "db_completed"
def is_exist(self, info):
print(self.queue.entity_list)
# print(self.queue)
# print(self.queue.entity_list)
for en in self.queue.entity_list:
if en.info["_id"] == info["_id"]:
return True
# return False
def callback_function(self, **args):
logger.debug('callback_function============')
logger.debug(args)
refresh_type = None
if args['type'] == 'status_change':
if args['status'] == SupportFfmpeg.Status.DOWNLOADING:
@@ -876,7 +890,7 @@ class LogicOhli24(PluginModuleBase):
data = {'type': 'info',
'msg': '다운로드중 Duration(%s)' % args['data']['duration_str'] + '<br>' + args['data'][
'save_fullpath'], 'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'add'
elif args['type'] == 'last':
if args['status'] == SupportFfmpeg.Status.WRONG_URL:
@@ -899,7 +913,9 @@ class LogicOhli24(PluginModuleBase):
elif args['status'] == SupportFfmpeg.Status.COMPLETED:
data = {'type': 'success', 'msg': '다운로드가 완료 되었습니다.<br>' + args['data']['save_fullpath'],
'url': '/ffmpeg/download/list'}
socketio.emit("notify", data, namespace='/framework', broadcast=True)
# socketio.emit("notify", data, namespace='/framework', broadcast=True)
refresh_type = 'last'
elif args['status'] == SupportFfmpeg.Status.TIME_OVER:
data = {'type': 'warning', 'msg': '시간초과로 중단 되었습니다.<br>' + args['data']['save_fullpath'],

View File

@@ -1,7 +1,9 @@
{% extends "base.html" %}
{% block content %}
<div>
{{ macros.m_button_group([['reset_btn', '초기화'], ['delete_completed_btn', '완료 목록 삭제'], ['go_ffmpeg_btn', 'Go FFMPEG']]) }}
</div>
<table id="result_table" class="table table-sm tableRowHover">
<thead class="thead-dark">
<tr>
@@ -22,9 +24,38 @@
</table>
<script type="text/javascript">
const package_name = "{{arg['package_name'] }}";
const sub = "{{arg['sub'] }}";
function on_start() {
$.ajax({
url: '/' + package_name + '/ajax/' + sub + '/entity_list',
type: "POST",
cache: false,
data: {},
dataType: "json",
success: function (data) {
make_download_list(data)
}
});
}
$(document).ready(function () {
var socket = io.connect(window.location.href);
const socket = io.connect(window.location.href);
{#socket = io.connect(window.location.protocol + "//" + document.domain + ":" + location.port + "/" + package_name + '/' + sub);#}
socket.on('start', function (data) {
on_start();
});
socket.on('list_refresh', function (data) {
on_start()
});
socket.on('status', function (data) {
console.log(data);
on_status(data)
});
socket.on('on_start', function (data) {
document.getElementById("log").innerHTML += data.data;
@@ -71,6 +102,8 @@ $(document).ready(function(){
}
$("#list").html(str);
});
});
@@ -171,5 +204,28 @@ function status_html(data) {
document.getElementById("detail_" + data.idx).innerHTML = get_detail(data);
}
$("body").on('click', '#reset_btn', function (e) {
e.preventDefault();
entity_id = $(this).data('id')
send_data = {'command': 'reset', 'entity_id': -1}
queue_command(send_data)
});
function queue_command(data) {
$.ajax({
url: '/' + package_name + '/ajax/' + sub + '/queue_command',
type: "POST",
cache: false,
data: data,
dataType: "json",
success: function (ret) {
if (ret.ret == 'notify') {
$.notify('<strong>' + ret.log + '</strong>', {type: 'warning'});
}
on_start();
}
});
}
</script>
{% endblock %}

View File

@@ -222,6 +222,7 @@
$(document).ready(function () {
$("#loader").css("display", 'none')
console.log({{ arg['code'] }})
// console.log('wr_id::', params.wr_id)

View File

@@ -187,6 +187,7 @@
// {# '<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 += '<p class="card-text">' + data.anime_list[i].epx + '</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>';
@@ -247,6 +248,7 @@
// {# '<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 += '<p class="card-text">' + data.anime_list[i].epx + '</p>';
tmp += '<a href="' + request_url + '" class="btn btn-primary cut-text">' + data.anime_list[i].title + '</a>';
tmp += '</div>';
tmp += '</div>';
@@ -602,6 +604,7 @@
max-width: 80%;
margin: 0 auto;
}
}
[data-tooltip-text]:hover {
@@ -703,6 +706,11 @@
width: 100%;
}
.btn {
white-space: normal !important;
word-wrap: break-word;
}
#screen_movie_list {
margin-top: 10px;
}
@@ -851,5 +859,6 @@
z-index: 99999;
opacity: 0.5;
}
</style>
{% endblock %}

View File

@@ -34,18 +34,23 @@
<div id='page2'></div>
</div>
{# <script src="{{ url_for('.static', filename='js/sjva_global1.js') }}"></script>#}
{# <script src="{{ url_for('.static', filename='js/sjva_ui14.js') }}"></script>#}
<script type="text/javascript">
var package_name = "{{arg['package_name']}}";
var sub = "{{arg['sub']}}";
var current_data = null;
$(document).ready(function(){
global_sub_request_search('1');
{#global_sub_request_search('1');#}
console.log('ready')
globalRequestSearch2('1');
});
$("#search").click(function(e) {
e.preventDefault();
global_sub_request_search('1');
{#global_sub_request_search('1');#}
globalRequestSearch2('1');
});
$("body").on('click', '#page', function(e){

View File

@@ -1,175 +1,141 @@
{% extends "base.html" %}
{% block content %}
<table id="result_table" class="table table-sm tableRowHover">
<thead class="thead-dark">
<tr>
<th style="width:5%; text-align:center;">IDX</th>
<th style="width:8%; text-align:center;">Plugin</th>
<th style="width:10%; text-align:center;">시작시간</th>
<th style="width:20%; text-align:center;">파일명</th>
<th style="width:8%; text-align:center;">상태</th>
<th style="width:15%; text-align:center;">진행률</th>
<th style="width:5%; text-align:center;">길이</th>
<th style="width:5%; text-align:center;">PF</th>
<th style="width:8%; text-align:center;">배속</th>
<th style="width:8%; text-align:center;">진행시간</th>
<th style="width:8%; text-align:center;">Action</th>
</tr>
</thead>
<tbody id="list"></tbody>
</table>
<div>
{{ macros.m_button_group([['reset_btn', '초기화'], ['delete_completed_btn', '완료 목록 삭제'], ['go_ffmpeg_btn', 'Go FFMPEG']]) }}
{{ macros.m_row_start('0') }}
{{ macros.m_row_end() }}
{{ macros.m_hr_head_top() }}
{{ macros.m_row_start('0') }}
{{ macros.m_col(1, macros.m_strong('Idx')) }}
{{ macros.m_col(2, macros.m_strong('CreatedTime')) }}
{{ macros.m_col(4, macros.m_strong('Filename')) }}
{{ macros.m_col(3, macros.m_strong('Status')) }}
{{ macros.m_col(2, macros.m_strong('Action')) }}
{{ macros.m_row_end() }}
{{ macros.m_hr_head_bottom() }}
<div id="download_list_div"></div>
</div> <!--전체-->
<script type="text/javascript">
var package_name = "{{arg['package_name'] }}";
var sub = "{{arg['sub'] }}";
var current_data = null;
{#socket = io.connect(window.location.protocol + "//" + document.domain + ":" + location.port + "/" + package_name + '/' + sub);#}
$(document).ready(function () {
console.log(window.location.href)
var socket = io.connect(window.location.href);
socket.on('on_start', function(data){
document.getElementById("log").innerHTML += data.data;
document.getElementById("log").scrollTop = document.getElementById("log").scrollHeight;
document.getElementById("log").style.visibility = 'visible';
$('#loading').hide();
console.log(socket)
socket.on('on_start', (data) => {
console.log('on_start().............')
console.log(data)
})
socket.on('start', function (data) {
console.log('socket start()')
on_start();
});
socket.on('add', function(data){
str = make_item(data);
if (current_data == null || current_data.length == 0) {
current_data = Array();
$("#list").html(str);
} else {
$("#list").html($("#list").html() + str);
}
current_data.push(data);
});
socket.on('status_change', function(data) {
button_html(data);
socket.on('list_refresh', function (data) {
on_start()
});
socket.on('status', function (data) {
status_html(data);
});
socket.on('last', function(data){
status_html(data);
button_html(data);
});
globalSendCommand('list', null, null, null, function(data) {
current_data = data;
$("#list").html('');
console.log(data)
if (data.length == 0) {
str = "<tr><td colspan='10'><h4>작업이 없습니다.</h4><td><tr>";
} else {
str = ''
for(i in data) {
str += make_item(data[i]);
}
}
$("#list").html(str);
});
console.log(data);
on_status(data)
});
$("body").on('click', '#stop_btn', function(e){
e.stopPropagation();
e.preventDefault();
globalSendCommand('stop', $(this).data('idx'), null, null, function(ret){
refresh_item(ret.data);
});
});
function refresh_item(data) {
$('#tr1_'+data.idx).html(make_item1(data));
$('#collapse_'+data.idx).html(make_item2(data));
function on_start() {
$.ajax({
url: '/' + package_name + '/ajax/' + sub + '/entity_list',
type: "POST",
cache: false,
data: {},
dataType: "json",
success: function (data) {
make_download_list(data)
}
function make_item(data) {
str = '<tr id="tr1_'+data.idx+'" style="cursor: pointer;" data-toggle="collapse" data-target="#collapse_'+ data.idx + '" aria-expanded="true" >';
str += make_item1(data);
str += '</tr>';
str += '<tr class="collapse tableRowHoverOff" style="cursor: pointer;" id="collapse_' + data.idx + '">';
str += make_item2(data);
str += '</tr>';
return str;
}
function make_item1(data) {
//console.log(data);
str = '';
str += '<td scope="col" style="width:5%; text-align:center;">'+ data.idx + '</td>';
str += '<td scope="col" style="width:8%; text-align:center;">'+ data.callback_id + '</td>';
str += '<td scope="col" style="width:10%; text-align:center;">'+ data.start_time + '</td>';
str += '<td scope="col" style="width:20%; text-align:center;">'+ data.filename + '</td>';
str += '<td id="status_'+data.idx+'" scope="col" style="width:8%; text-align:center;">'+ data.status_kor + '</td>';
var visi = 'hidden';
if (parseInt(data.percent) > 0) {
visi = 'visible';
}
str += '<td scope="col" style="width:20%; text-align:center;"><div class="progress"><div id="progress_'+data.idx+'" class="progress-bar" style="visibility: '+visi+'; width:'+data.percent+'%">'+data.percent +'%</div></div></td>';
str += '<td scope="col" style="width:5%; text-align:center;">'+ data.duration_str + '</td>';
str += '<td id="current_pf_count_'+data.idx+'" scope="col" style="width:5%; text-align:center;">'+ data.current_pf_count + '</td>';
str += '<td id="current_speed_'+data.idx+'" scope="col" style="width:8%; text-align:center;">'+ data.current_speed + '</td>';
str += '<td id="download_time_'+data.idx+'" scope="col" style="width:8%; text-align:center;">'+ data.download_time + '</td>';
str += '<td id="button_'+data.idx+'" scope="col" style="width:8%; text-align:center;">';
if (data.status_str == 'DOWNLOADING') {
str += j_button('stop_btn', '중지', {'idx':data.idx}, 'danger', false, false);
}
str += '</td>'
return str;
}
function make_item2(data) {
str = '';
str += '<td colspan="11">';
str += '<div id="detail_'+data.idx+'">';
str += get_detail(data);
str += '</div>';
str += '</td>';
return str
});
}
function get_detail(data) {
var str = j_row_info('URL', data.url);
str += j_row_info('임시경로', data.temp_fullpath);
str += j_row_info('저장경로', data.save_fullpath);
str += j_row_info('진행률(current/total)', data.percent+ '% (' + data.current_duration + ' / ' + data.duration + ')');
str += j_row_info('현재 비트레이트', data.current_bitrate);
str += j_row_info('종료시간', data.end_time);
str += j_row_info('허용 Packet Fail 수', data.max_pf_count);
str += j_row_info('파일 Exist', data.exist);
if (data.status_str == 'COMPLETED') {
str += j_row_info('파일 크기', data.filesize_str);
str += j_row_info('다운 속도', data.download_speed);
}
return str;
}
function button_html(data) {
function on_status(data) {
//console.log(data)
str = '';
if (data.status_str == 'DOWNLOADING') {
str = j_button('stop_btn', '중지', {'idx':data.idx}, 'danger', false, false);
tmp = document.getElementById("progress_" + data.entity_id)
if (tmp != null) {
document.getElementById("progress_" + data.entity_id).style.width = data.ffmpeg_percent + '%';
document.getElementById("progress_" + data.entity_id + "_label").innerHTML = data.ffmpeg_status_kor + "(" + data.ffmpeg_percent + "%)" + ' ' + ((data.ffmpeg_arg != null) ? data.ffmpeg_arg.data.current_speed : '')
}
$("#button_" + data.idx).html(str);
}
function status_html(data) {
var progress = document.getElementById("progress_" + data.idx);
progress.style.width = data.percent+ '%';
progress.innerHTML = data.percent+ '%';
progress.style.visibility = 'visible';
document.getElementById("status_" + data.idx).innerHTML = data.status_kor;
document.getElementById("current_pf_count_" + data.idx).innerHTML = data.current_pf_count;
document.getElementById("current_speed_" + data.idx).innerHTML = data.current_speed;
document.getElementById("download_time_" + data.idx).innerHTML = data.download_time;
document.getElementById("detail_" + data.idx).innerHTML = get_detail(data);
function make_download_list(data) {
str = '';
for (i in data) {
str += m_row_start();
str += m_col(1, data[i].entity_id);
str += m_col(2, data[i].created_time);
str += m_col(4, (data[i].filename != null) ? data[i].filename : '');
label = data[i].ffmpeg_status_kor
if (data[i].ffmpeg_percent != 0) {
label += '(' + data[i].ffmpeg_percent + '%)'
}
tmp = m_progress('progress_' + data[i].entity_id, data[i].ffmpeg_percent, label)
str += m_col(3, tmp);
tmp = m_button('program_cancel_btn', '취소', [{'key': 'id', 'value': data[i].entity_id}]);
tmp = m_button_group(tmp)
str += m_col(2, tmp)
str += m_row_end();
if (i != data.length - 1) str += m_hr(0);
}
document.getElementById("download_list_div").innerHTML = str;
}
$("body").on('click', '#program_cancel_btn', function (e) {
e.preventDefault();
entity_id = $(this).data('id')
send_data = {'command': 'cancel', 'entity_id': entity_id}
queue_command(send_data)
});
$("body").on('click', '#reset_btn', function (e) {
e.preventDefault();
entity_id = $(this).data('id')
send_data = {'command': 'reset', 'entity_id': -1}
queue_command(send_data)
});
$("body").on('click', '#delete_completed_btn', function (e) {
e.preventDefault();
entity_id = $(this).data('id')
send_data = {'command': 'delete_completed', 'entity_id': -1}
queue_command(send_data)
});
function queue_command(data) {
$.ajax({
url: '/' + package_name + '/ajax/' + sub + '/queue_command',
type: "POST",
cache: false,
data: data,
dataType: "json",
success: function (ret) {
if (ret.ret == 'notify') {
$.notify('<strong>' + ret.log + '</strong>', {type: 'warning'});
}
on_start();
}
});
}
$("body").on('click', '#go_ffmpeg_btn', function (e) {
e.preventDefault();
$(location).attr('href', '/ffmpeg')
});
</script>
{% endblock %}

View File

@@ -205,12 +205,14 @@
})
$(document).ready(function () {
console.log("{{ arg['code'] }}")
console.log('wr_id::', params.wr_id)
if (document.getElementById("code").value !== "") {
{#document.getElementById("analysis_btn").click()#}
$('#analysis_btn').click();
}
console.log(accessibleCount)
});
@@ -344,6 +346,7 @@
background-image: linear-gradient(90deg, #33242c, #263341, #17273a);
color: #d6eaf8;
}
button.code-button {
min-width: 82px !important;
}
@@ -615,5 +618,16 @@
z-index: 99999;
opacity: 0.5;
}
.btn-outline-success {
color: #fd7e14 !important;
border-color: #fd7e14 !important;
}
.btn-outline-success:hover {
color: #fff !important;
background-color: #0dcaf0 !important;
border-color: #0dcaf0 !important;
}
</style>
{% endblock %}

View File

@@ -30,7 +30,7 @@
{{ macros.setting_global_scheduler_sub_button(arg['scheduler'], arg['is_running']) }}
{{ macros.setting_input_text('ohli24_interval', '스케쥴링 실행 정보', value=arg['ohli24_interval'], col='3', desc=['Inverval(minute 단위)이나 Cron 설정']) }}
{{ macros.setting_checkbox('ohli24_auto_start', '시작시 자동실행', value=arg['ohli24_auto_start'], desc='On : 시작시 자동으로 스케쥴러에 등록됩니다.') }}
{{ macros.setting_input_textarea('ohli24_auto_code_list', '자동 다운로드할 작품 코드', desc=['all 입력시 모두 받기', '구분자 | 또는 엔터'], value=arg['ohli24_auto_code_list'], row='10') }}
{{ macros.setting_input_textarea('ohli24_auto_code_list', '자동 다운로드할 작품 코드', desc=['구분자 | 또는 엔터'], value=arg['ohli24_auto_code_list'], row='10') }}
{{ macros.setting_checkbox('ohli24_auto_mode_all', '에피소드 모두 받기', value=arg['ohli24_auto_mode_all'], desc=['On : 이전 에피소드를 모두 받습니다.', 'Off : 최신 에피소드만 받습니다.']) }}
{{ macros.m_tab_content_end() }}

View File

@@ -7,7 +7,7 @@ WORK_DIR="/Volumes/WD/Users/Work/python/ff_dev_plugins/anime_downloader/yommi_ap
echo "$LINE"
echo "* fast api running..."
echo "$LINE"
pip install fastapi uvicorn[standard] playwright
#pip install fastapi uvicorn[standard] playwright
# shellcheck disable=SC2164
cd "$WORK_DIR"
uvicorn main:app --reload --port=$PORT