class P(object): package_name = __name__.split('.')[0] logger = get_logger(package_name) blueprint = Blueprint(package_name, package_name, url_prefix='/%s' % package_name, template_folder=os.path.join( os.path.dirname(__file__), 'templates')) menu = { 'main': [package_name, '봇 다운로드 - TV'], 'sub': [['torrent', '토렌트'], ['vod', 'VOD'], ['log', '로그']], 'category': 'torrent', 'sub2': { 'torrent': [['setting', '설정'], ['list', '목록']], 'vod': [['setting', '설정'], ['list', '목록']] } } plugin_info = { 'version': '0.2.0.0', 'name': 'bot_downloader_ktv', 'category_name': 'torrent', 'developer': 'soju6jan', 'description': '텔레그램 봇으로 수신한 정보로 TV 다운로드', 'home': 'https://github.com/soju6jan/bot_downloader_ktv', 'more': '', } ModelSetting = get_model_setting(package_name, logger) logic = None module_list = None home_module = 'torrent'
class P(object): package_name = __name__.split('.')[0] logger = get_logger(package_name) blueprint = Blueprint(package_name, package_name, url_prefix='/%s' % package_name, template_folder=os.path.join(os.path.dirname(__file__), 'templates')) menu = { 'main' : [package_name, u'봇 다운로드 - AV'], 'sub' : [ ['receive', u'수신'], ['broadcast', u'방송'], ['log', u'로그'] ], 'category' : 'torrent', 'sub2' : { 'receive' : [ ['setting', u'설정'], ['list', u'수신 목록'] ], 'broadcast' : [ ['setting', u'설정'], ['list', u'방송 목록'] ] } } plugin_info = { 'version' : '0.2.0.0', 'name' : 'bot_downloader_av', 'category_name' : 'torrent', 'developer' : 'soju6jan', 'description' : u'AV 토렌트 수신 & 방송 처리', 'home' : 'https://github.com/soju6jan/bot_downloader_av', 'more' : '', } ModelSetting = get_model_setting(package_name, logger) logic = None module_list = None home_module = 'torrent'
class P(object): package_name = __name__.split('.')[0] logger = get_logger(package_name) blueprint = Blueprint(package_name, package_name, url_prefix='/%s' % package_name, template_folder=os.path.join( os.path.dirname(__file__), 'templates')) menu = { 'main': [package_name, u'비디오 다운로드'], 'sub': [['ani365', u'ani365'], ['aniplus', u'ANIPLUS'], ['log', u'로그']], 'category': 'vod', 'sub2': { 'ani365': [['setting', u'설정'], ['request', u'요청'], ['queue', u'큐'], ['list', u'목록']], 'aniplus': [['setting', u'설정'], ['request', u'요청'], ['queue', u'큐'], ['list', u'목록']], } } plugin_info = { 'version': '0.2.0.0', 'name': 'downloader_video', 'category_name': 'vod', 'icon': '', 'developer': 'soju6jan', 'description': u'비디오 다운로드', 'home': 'https://github.com/soju6jan/downloader_video', 'more': '', } ModelSetting = get_model_setting(package_name, logger) logic = None module_list = None home_module = 'ani365'
class P(object): package_name = __name__.split('.')[0] logger = get_logger(package_name) blueprint = Blueprint(package_name, package_name, url_prefix='/%s' % package_name, template_folder=os.path.join(os.path.dirname(__file__), 'templates')) menu = { 'main' : [package_name, u'Podcast RSS Maker'], 'sub' : [ ['podbbang', u'팟빵'], ['google', u'구글 드라이브'], ['log', u'로그'] ], 'sub2' : { 'podbbang' : [ ['setting', u'설정'], ], 'google' : [ ['setting', u'설정'], ], }, 'category' : 'service' } plugin_info = { 'version' : '0.2.0.0', 'name' : u'Podcast RSS Maker', 'category_name' : 'service', 'developer' : 'soju6jan', 'description' : u'Podcast 지원', 'home' : 'https://github.com/soju6jan/podcast_feed_maker', 'more' : '', } ModelSetting = get_model_setting(package_name, logger) logic = None module_list = None home_module = 'podbbang'
class P(object): package_name = __name__.split('.')[0] logger = get_logger(package_name) blueprint = Blueprint(package_name, package_name, url_prefix='/%s' % package_name, template_folder=os.path.join( os.path.dirname(__file__), 'templates')) # 메뉴 정의 menu = { 'main': [package_name, u'플러그인샘플'], 'sub': [['sample', u'sample'], ['log', u'로그']], 'category': 'tool', 'sub2': { 'sample': [['setting', u'설정'], ['list', u'목록'], ['cardlist', u'카드목록'], ['uisample', u'UI샘플']], }, } plugin_info = { 'version': '0.1.0.0', 'name': package_name, 'category_name': 'tool', 'icon': '', 'developer': u'orial', 'description': u'Plugin sample for SJVA', 'home': 'https://github.com/byorial/%s' % package_name, 'more': '', } ModelSetting = get_model_setting(package_name, logger) logic = None module_list = None home_module = 'sample' # 기본모듈
class P(object): package_name = __name__.split('.')[0] logger = get_logger(package_name) blueprint = Blueprint(package_name, package_name, url_prefix='/%s' % package_name, template_folder=os.path.join( os.path.dirname(__file__), 'templates')) menu = { 'main': [package_name, u'메타데이터'], 'sub': [['movie', u'영화'], ['ktv', u'국내TV'], ['ftv', u'외국TV(개발중. 사용불가)'], ['jav_censored', u'JavCensored'], ['jav_censored_ama', u'JavCensored AMA'], ['log', u'로그']], 'category': 'tool', 'sub2': { 'ktv': [ ['setting', u'설정'], ['test', '테스트' ], #['daum', 'Daum'], ['wavve', '웨이브'], ['tving', '티빙'], ], 'movie': [ ['setting', u'설정'], [ 'test', '테스트' ], #['naver', '네이버'], ['daum', 'Daum'], ['tmdb', 'TMDB'], ['watcha', '왓챠'], ['tmdb', 'TMDB'], ['wavve', '웨이브'], ['tving', '티빙'], ], 'ftv': [ ['setting', u'설정'], ['test', '테스트'], ], 'jav_censored': [ ['setting', u'설정'], ['dmm', 'DMM'], ['javbus', 'Javbus'], ], 'jav_censored_ama': [ ['setting', u'설정'], ['jav321', 'Jav321'], ], } } plugin_info = { 'version': '0.2.0.0', 'name': package_name, 'category_name': 'tool', 'icon': '', 'developer': u'soju6jan', 'description': u'Metadata', 'home': 'https://github.com/soju6jan/%s' % package_name, 'more': '', } ModelSetting = get_model_setting(package_name, logger) logic = None module_list = None home_module = 'setting'
class PlugIn: package_name = __name__.split(".", maxsplit=1)[0] logger = get_logger(package_name) ModelSetting = get_model_setting( package_name, logger, table_name=f"plugin_{package_name}_setting") blueprint = Blueprint( package_name, package_name, url_prefix=f"/{package_name}", template_folder=os.path.join(os.path.dirname(__file__), "templates"), ) plugin_info = { "category_name": "torrent", "version": "0.1.2", "name": "torrent_info", "home": "https://github.com/wiserain/torrent_info", "more": "https://github.com/wiserain/torrent_info", "description": "토렌트 마그넷/파일 정보를 보여주는 플러그인", "developer": "wiserain", "zip": "https://github.com/wiserain/torrent_info/archive/master.zip", "icon": "", "install": "2.0.5-211206", } menu = { "main": [package_name, "토렌트 정보"], "sub": [["setting", "설정"], ["search", "검색"], ["log", "로그"]], "category": "torrent", } home_module = "search" module_list = None logic = None def __init__(self): from framework import app, path_data db_file = os.path.join(path_data, "db", f"{self.package_name}.db") app.config["SQLALCHEMY_BINDS"][ self.package_name] = f"sqlite:///{db_file}" from framework.util import Util Util.save_from_dict_to_json( self.plugin_info, os.path.join(os.path.dirname(__file__), "info.json"))
class PlugIn(object): package_name = __name__.split('.')[0] logger = get_logger(package_name) ModelSetting = get_model_setting( package_name, logger, table_name=f'plugin_{package_name}_setting') blueprint = Blueprint(package_name, package_name, url_prefix=f'/{package_name}', template_folder=os.path.join( os.path.dirname(__file__), 'templates')) plugin_info = { "category_name": "torrent", "version": "0.1.0", "name": "tf_viewer", "home": "https://github.com/wiserain/tf_viewer", "more": "https://github.com/wiserain/tf_viewer", "description": "TF 실시간 정보를 보여주는 플러그인", "developer": "wiserain", "zip": "https://github.com/wiserain/tf_viewer/archive/main.zip", "icon": "", } menu = { 'main': [package_name, '티프리카'], 'sub': [['setting', '설정'], ['tmovie', '영화'], ['tdrama', '드라마'], ['tent', '예능'], ['tv', 'TV'], ['tani', '애니'], ['tmusic', '음악'], ['log', '로그']], 'category': 'torrent', } home_module = 'tmovie' module_list = None logic = None def __init__(self): from framework import app, path_data db_file = os.path.join(path_data, 'db', f'{self.package_name}.db') app.config['SQLALCHEMY_BINDS'][ self.package_name] = f'sqlite:///{db_file}' from framework.util import Util Util.save_from_dict_to_json( self.plugin_info, os.path.join(os.path.dirname(__file__), 'info.json'))
class PlugIn(object): package_name = __name__.split('.')[0] logger = get_logger(package_name) ModelSetting = get_model_setting( package_name, logger, table_name=f'plugin_{package_name}_setting') blueprint = Blueprint(package_name, package_name, url_prefix=f'/{package_name}', template_folder=os.path.join( os.path.dirname(__file__), 'templates')) plugin_info = { "category_name": "tool", "version": "1.2.0", "name": "vnStat2", "home": "https://github.com/wiserain/vnStat2", "more": "https://github.com/wiserain/vnStat2", "supported_vnstat_version": ["2.6"], "description": "vnStat 정보를 보여주는 플러그인", "developer": "wiserain", "zip": "https://github.com/wiserain/vnStat2/archive/master.zip", "icon": "" } menu = { 'main': [package_name, 'vnStat2'], 'sub': [['setting', '설정'], ['traffic', '트래픽'], ['log', '로그']], 'category': 'tool', } home_module = 'traffic' module_list = None logic = None def __init__(self): from framework import app, path_data db_file = os.path.join(path_data, 'db', f'{self.package_name}.db') app.config['SQLALCHEMY_BINDS'][ self.package_name] = f'sqlite:///{db_file}' from framework.util import Util Util.save_from_dict_to_json( self.plugin_info, os.path.join(os.path.dirname(__file__), 'info.json'))
class P(object): package_name = __name__.split('.')[0] logger = get_logger(package_name) blueprint = menu = None plugin_info = { 'version': '0.1.0.0', 'type': 'library', 'name': package_name, 'category_name': 'library', 'developer': u'orial', 'description': u'gdrive api library', 'home': 'https://github.com/byorial/%s' % package_name, 'more': '', } ModelSetting = get_model_setting(package_name, logger) @staticmethod def plugin_load(): P.logger.debug('%s plugin_load' % P.package_name) @staticmethod def plugin_unload(): P.logger.debug('%s plugin_unload' % P.package_name)
# third-party from sqlalchemy import or_, and_, func, not_, desc from sqlalchemy.orm import backref # sjva 공용 from framework import db, path_app_root, app from framework.util import Util from framework.common.plugin import get_model_setting, Logic, default_route # 패키지 from .plugin import logger, package_name ######################################################### db_file = os.path.join(path_app_root, 'data', 'db', '%s.db' % package_name) app.config['SQLALCHEMY_BINDS'][package_name] = 'sqlite:///%s' % (db_file) ModelSetting = get_model_setting(package_name, logger, table_name='plugin_%s_setting' % package_name) class ModelWavveEpisode(db.Model): __tablename__ = 'plugin_%s_auto_episode' % package_name __table_args__ = {'mysql_collate': 'utf8_general_ci'} __bind_key__ = package_name id = db.Column(db.Integer, primary_key=True) contents_json = db.Column(db.JSON) streaming_json = db.Column(db.JSON) created_time = db.Column(db.DateTime) channelname = db.Column(db.String)
from sqlalchemy import or_, and_, func, not_ from sqlalchemy.orm import backref from sqlalchemy.orm.attributes import flag_modified # sjva 공용 from framework import db, path_app_root, app from framework.util import Util from framework.common.plugin import get_model_setting, Logic, default_route # 패키지 from .plugin import logger, package_name ######################################################### app.config['SQLALCHEMY_BINDS'][package_name] = 'sqlite:///%s' % (os.path.join(path_app_root, 'data', 'db', '%s.db' % package_name)) ModelSetting = get_model_setting(package_name, logger) #DB 저장을 이용하지 않는다... class ModelChannel(db.Model): __tablename__ = '%s_channel' % package_name __table_args__ = {'mysql_collate': 'utf8_general_ci'} __bind_key__ = package_name id = db.Column(db.Integer, primary_key=True) json = db.Column(db.JSON) created_time = db.Column(db.DateTime) source = db.Column(db.String) source_id = db.Column(db.String) title = db.Column(db.String)
class P(object): package_name = __name__.split('.')[0] logger = get_logger(package_name) blueprint = Blueprint(package_name, package_name, url_prefix='/%s' % package_name, template_folder=os.path.join( os.path.dirname(__file__), 'templates')) try: import sqlite3 conn = sqlite3.connect( os.path.join( path_data, 'db', '{package_name}.db'.format(package_name=package_name))) cursor = conn.cursor() key = ('use_av', ) cursor.execute('SELECT value from scmanager_setting where key = ?', key) value = cursor.fetchone() if value[0] == u"True": use_av = True else: use_av = False key = ('use_setting', ) cursor.execute('SELECT value from scmanager_setting where key = ?', key) value = cursor.fetchone() if value[0] == u"True": use_setting = True else: use_setting = False conn.close() except Exception as e: logger.error('failed to get user setting') logger.error('Exception:%s', e) logger.error(traceback.format_exc()) conn.close() use_av = True use_setting = True if use_av: menu = { 'main': [package_name, u'GD바로가기관리'], 'sub': [['scmbase', u'라이브러리관리'], ['tv', 'TV목록'], ['mv', '영화목록'], ['av', 'AV목록'], ['log', u'로그']], 'category': 'service', 'sub2': { 'scmbase': [['setting', u'설정'], ['rulelist', u'경로규칙목록']], }, } else: if use_setting: menu = { 'main': [package_name, u'GD바로가기관리'], 'sub': [['scmbase', u'라이브러리관리'], ['tv', 'TV목록'], ['mv', '영화목록'], ['log', u'로그']], 'category': 'service', 'sub2': { 'scmbase': [['setting', u'설정'], ['rulelist', u'경로규칙목록']], }, } else: menu = { 'main': [package_name, u'GD바로가기관리'], 'sub': [['scmbase', u'라이브러리관리'], ['tv', 'TV목록'], ['mv', '영화목록'], ['log', u'로그']], 'category': 'service', 'sub2': { 'scmbase': [['rulelist', u'경로규칙목록']], }, } plugin_info = { 'version': '0.3.0.3', 'name': package_name, 'category_name': 'service', 'icon': '', 'developer': u'orial', 'description': u'Gdrive shorcut manager for SJVA Plugin', 'home': 'https://github.com/byorial/%s' % package_name, 'more': '', "dependency": [{ "name": "lib_gdrive", "home": "https://github.com/byorial/lib_gdrive" }, { "name": "lib_metadata", "home": "https://github.com/soju6jan/lib_metadata" }] } ModelSetting = get_model_setting(package_name, logger) logic = None module_list = None home_module = 'scmbase'