fix: 修正代理数据提取逻辑以使用字典格式
This commit is contained in:
parent
d310c8a418
commit
78b793b0df
2
DB.py
2
DB.py
@ -109,14 +109,12 @@ class DBVidcon:
|
||||
self.cursor.execute(sql)
|
||||
rows = self.cursor.fetchall()
|
||||
result = {row['rn']: row['parameter'] for row in rows}
|
||||
self.close()
|
||||
return result
|
||||
|
||||
def get_proxy_parameter(self, rn: str) -> str:
|
||||
sql = "SELECT parameter FROM proxy_agent WHERE rn = %s LIMIT 1"
|
||||
self.cursor.execute(sql, (rn,))
|
||||
result = self.cursor.fetchone()
|
||||
self.close()
|
||||
return result[0] if result else None
|
||||
|
||||
def rollback_records(self, raws):
|
||||
|
Loading…
x
Reference in New Issue
Block a user