pull/109/head
Mr Chen 6 years ago
parent 859899cd96
commit 9cd9091c93
  1. 8
      plugins/qbittorrent/conf/qb.conf
  2. 3
      plugins/qbittorrent/index.html
  3. 14
      plugins/qbittorrent/index.py
  4. 59
      plugins/qbittorrent/workers/dl_worker.py
  5. 2
      plugins/simdht/index.html

@ -1,5 +1,11 @@
[db]
DB_HOST = 127.0.0.1
DB_USER = qbittorrent
DB_PORT = 3306
DB_PASS = qbittorrent
DB_NAME = qbittorrent
[qb]
QB_HOST = 127.0.0.1
QB_PORT = 8080
QB_USER = admin

@ -3,7 +3,8 @@
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('qbittorrent');">服务</p>
<p onclick="pluginInitD('qbittorrent');">自启动</p>
<p onclick="pluginConfig('qbittorrent', '','get_sql');">手动导入SQL</p>
<p onclick="pluginConfig('qbittorrent', '','get_sql');" title="手动导入SQL">导入SQL</p>
<p onclick="pluginConfig('qbittorrent');">配置</p>
</div>
<div class="bt-w-con pd15">

@ -68,8 +68,8 @@ def getSqlFile():
return file
def getDbConf():
file = getServerDir() + "/db.cfg"
def getConf():
file = getServerDir() + "/qb.conf"
return file
@ -85,9 +85,9 @@ def initDreplace():
sdir = getPluginDir() + '/workers'
public.execShell('cp -rf ' + sdir + ' ' + getServerDir())
cfg = getServerDir() + '/db.cfg'
cfg = getServerDir() + '/qb.conf'
if not os.path.exists(cfg):
cfg_tpl = getPluginDir() + '/workers/db.cfg'
cfg_tpl = getPluginDir() + '/conf/qb.conf'
content = public.readFile(cfg_tpl)
public.writeFile(cfg, content)
@ -188,7 +188,7 @@ def matchData(reg, content):
def getDbConfInfo():
cfg = getDbConf()
cfg = getConf()
content = public.readFile(cfg)
data = {}
data['DB_HOST'] = matchData("DB_HOST\s*=\s(.*)", content)
@ -245,8 +245,8 @@ if __name__ == "__main__":
print initdUinstall()
elif func == 'get_sql':
print getSqlFile()
elif func == 'get_db_conf':
print getDbConf()
elif func == 'conf':
print getConf()
elif func == 'get_run_Log':
print getRunLog()
elif func == 'get_trend_data':

@ -0,0 +1,59 @@
#!/usr/bin/env python
# encoding: utf-8
"""
磁力搜索meta信息入库程序
"""
import hashlib
import os
import SimpleXMLRPCServer
import time
import datetime
import traceback
import sys
import json
import socket
import threading
from hashlib import sha1
from random import randint
from struct import unpack
from socket import inet_ntoa
from threading import Timer, Thread
from time import sleep
from collections import deque
from Queue import Queue
reload(sys)
sys.setdefaultencoding('utf-8')
sys.path.append('/usr/local/lib/python2.7/site-packages')
# import pygeoip
import MySQLdb as mdb
# from configparser import ConfigParser
# cp = ConfigParser()
# cp.read("../db.cfg")
# section_db = cp.sections()[0]
# DB_HOST = cp.get(section_db, "DB_HOST")
# DB_USER = cp.get(section_db, "DB_USER")
# DB_PORT = cp.getint(section_db, "DB_PORT")
# DB_PASS = cp.get(section_db, "DB_PASS")
# DB_NAME = cp.get(section_db, "DB_NAME")
def checkDL():
while True:
print time.time()
time.sleep(1)
checkDL()
if __name__ == "__main__":
# import threading
# t = threading.Thread(target=checkDL)
# t.setDaemon(True)
# t.start()
checkDL()

@ -3,7 +3,7 @@
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('simdht');">服务</p>
<p onclick="pluginInitD('simdht');">自启动</p>
<p onclick="pluginConfig('simdht', '','get_sql');">手动导入SQL</p>
<p onclick="pluginConfig('simdht', '','get_sql');" title="手动导入SQL">导入SQL</p>
<p onclick="pluginConfig('simdht', '','get_db_conf');">配置</p>
<p onclick="pluginLogs('simdht','','get_run_Log', 10);">日志</p>
<p onclick="dhtTrend();">收录趋势</p>

Loading…
Cancel
Save