2022-02-08 23:17:30 +09:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
# @Time : 2022/02/08 3:44 PM
|
|
|
|
|
# @Author : yommi
|
2022-04-27 15:29:17 +09:00
|
|
|
# @Site :
|
2022-02-08 23:17:30 +09:00
|
|
|
# @File : logic_linkkf
|
|
|
|
|
# @Software: PyCharm
|
|
|
|
|
import os, sys, traceback, re, json, threading
|
|
|
|
|
from datetime import datetime
|
|
|
|
|
import copy
|
2022-04-27 15:29:17 +09:00
|
|
|
|
2022-02-08 23:17:30 +09:00
|
|
|
# third-party
|
|
|
|
|
import requests
|
2022-04-27 15:29:17 +09:00
|
|
|
|
2022-02-08 23:17:30 +09:00
|
|
|
# third-party
|
|
|
|
|
from flask import request, render_template, jsonify
|
|
|
|
|
from sqlalchemy import or_, and_, func, not_, desc
|
|
|
|
|
|
|
|
|
|
# sjva 공용
|
|
|
|
|
from framework import db, scheduler, path_data, socketio
|
|
|
|
|
from framework.util import Util
|
|
|
|
|
from framework.common.util import headers
|
2022-04-27 15:29:17 +09:00
|
|
|
from plugin import (
|
|
|
|
|
LogicModuleBase,
|
|
|
|
|
FfmpegQueueEntity,
|
|
|
|
|
FfmpegQueue,
|
|
|
|
|
default_route_socketio,
|
|
|
|
|
)
|
2022-02-08 23:17:30 +09:00
|
|
|
from tool_base import d
|
2022-04-27 15:29:17 +09:00
|
|
|
|
2022-02-08 23:17:30 +09:00
|
|
|
# 패키지
|
|
|
|
|
from .plugin import P
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LogicLinkkf(LogicModuleBase):
|
|
|
|
|
def __init__(self, P):
|
2022-04-27 15:29:17 +09:00
|
|
|
super(LogicLinkkf, self).__init__(P, "setting", scheduler_desc="linkkf 자동 다운로드")
|
|
|
|
|
self.name = "linkkf"
|
2022-02-08 23:17:30 +09:00
|
|
|
default_route_socketio(P, self)
|
|
|
|
|
|
|
|
|
|
def process_menu(self, sub, req):
|
|
|
|
|
arg = P.ModelSetting.to_dict()
|
2022-04-27 15:29:17 +09:00
|
|
|
arg["sub"] = self.name
|
|
|
|
|
if sub in ["setting", "queue", "list", "request"]:
|
|
|
|
|
if sub == "request" and req.args.get("content_code") is not None:
|
|
|
|
|
arg["ani365_current_code"] = req.args.get("content_code")
|
|
|
|
|
if sub == "setting":
|
|
|
|
|
job_id = "%s_%s" % (self.P.package_name, self.name)
|
|
|
|
|
arg["scheduler"] = str(scheduler.is_include(job_id))
|
|
|
|
|
arg["is_running"] = str(scheduler.is_running(job_id))
|
|
|
|
|
return render_template(
|
|
|
|
|
"{package_name}_{module_name}_{sub}.html".format(
|
|
|
|
|
package_name=P.package_name, module_name=self.name, sub=sub
|
|
|
|
|
),
|
|
|
|
|
arg=arg,
|
|
|
|
|
)
|
|
|
|
|
return render_template("sample.html", title="%s - %s" % (P.package_name, sub))
|
2022-02-08 23:17:30 +09:00
|
|
|
|
|
|
|
|
pass
|