Beispiel #1
0
 def __init__(self):
     self.standbyDB  = Database(_DB_SETTINGS)
     self.stableDB   = Database(_DB_SETTINGS)
     self.standbyDB.table  = _TABLE['standby']
     self.stableDB.table   = _TABLE['stable']
     self.standby_data     = []
     self.stable_data      = []
Beispiel #2
0
 def __init__(self,targets=targets):
     """
     初始化
     :param targets: 默认加载config中的目标url列表targets
     """
     self.targets = targets
     self.db = Database(_DB_SETTINGS)
Beispiel #3
0
 def __init__(self):
     self.db = Database(_DB_SETTINGS)
     self.db.table = _TABLE['standby']
     self.rator = Rator(self.db)
     self.standby_data = []
Beispiel #4
0
"""
    @author  : linkin
    @email   : [email protected]
    @date    : 2018-10-04
"""
import random
import logging
import json
from flask import Flask
from components.dbhelper import Database
from config.DBsettings import _TABLE
from config.DBsettings import _DB_SETTINGS

logger = logging.getLogger('APIserver')
app = Flask(__name__)
stable_db = Database(_DB_SETTINGS)
standby_db = Database(_DB_SETTINGS)
common_db = Database(_DB_SETTINGS)

standby_db.table = _TABLE['standby']
stable_db.table = _TABLE['stable']
standby_db.connect()
stable_db.connect()
common_db.connect()

all_standby_proxy = standby_db.all()
all_stable_proxy = stable_db.all()
anony_standby = [
    i for i in all_standby_proxy
    if i['anony_type'] == '高匿' and i['combo_fail'] == 0
]