Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zzsn_spider
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
丁双波
zzsn_spider
Commits
d4632531
提交
d4632531
authored
11月 23, 2023
作者:
薛凌堃
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
研报处理
上级
481d2a7b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
373 行增加
和
3 行删除
+373
-3
classtool.py
comData/BaseInfo_qcc/classtool.py
+3
-3
deletebyid.py
comData/YanBao/deletebyid.py
+59
-0
uploadfile.py
comData/YanBao/uploadfile.py
+311
-0
没有找到文件。
comData/BaseInfo_qcc/classtool.py
浏览文件 @
d4632531
...
@@ -79,16 +79,16 @@ class Token():
...
@@ -79,16 +79,16 @@ class Token():
# 删除失效的token
# 删除失效的token
def
delete_token
(
self
,
cookie_
):
def
delete_token
(
self
,
cookie_
):
deletesql
=
f
"delete from QCC_token where
cookies
='{cookie_}' "
deletesql
=
f
"delete from QCC_token where
id
='{cookie_}' "
cursor
.
execute
(
deletesql
)
cursor
.
execute
(
deletesql
)
cnx
.
commit
()
cnx
.
commit
()
# token的处理
# token的处理
def
updateTokeen
(
self
,
id_token
,
type
):
def
updateTokeen
(
self
,
id_token
,
type
):
if
type
==
2
:
if
type
==
1
:
# session失效,删除token
# session失效,删除token
cursor
.
execute
(
f
"delete from QCC_token where id={id_token}"
)
cursor
.
execute
(
f
"delete from QCC_token where id={id_token}"
)
if
type
==
1
:
if
type
==
2
:
# 封号了 修改封号时间
# 封号了 修改封号时间
cursor
.
execute
(
f
"update QCC_token set fenghao_time=now() where id={id_token}"
)
cursor
.
execute
(
f
"update QCC_token set fenghao_time=now() where id={id_token}"
)
if
type
==
3
:
if
type
==
3
:
...
...
comData/YanBao/deletebyid.py
0 → 100644
浏览文件 @
d4632531
# -*- coding: utf-8 -*-
import
json
import
re
import
threading
import
time
import
uuid
import
fitz
import
redis
import
requests
from
bs4
import
BeautifulSoup
from
obs
import
ObsClient
from
retry
import
retry
from
elasticsearch
import
Elasticsearch
from
base
import
BaseCore
baseCore
=
BaseCore
.
BaseCore
()
log
=
baseCore
.
getLogger
()
baseCore
=
BaseCore
.
BaseCore
()
cnx_
=
baseCore
.
cnx_
cursor_
=
cnx_
.
cursor
()
lock
=
threading
.
Lock
()
pathType_
=
'QYResearchReport/'
taskType
=
'企业研报/东方财富网'
pool
=
redis
.
ConnectionPool
(
host
=
"114.115.236.206"
,
port
=
6379
,
password
=
'clbzzsn'
,
db
=
6
)
class
EsMethod
(
object
):
def
__init__
(
self
):
# 创建Elasticsearch对象,并提供账号信息
self
.
es
=
Elasticsearch
([
'http://114.116.19.92:9700'
],
http_auth
=
(
'elastic'
,
'zzsn9988'
),
timeout
=
300
)
self
.
index_name
=
'researchreportdata'
'''
删除
'''
def
delete
(
self
,
index_name
,
id
):
result
=
self
.
es
.
delete
(
index
=
index_name
,
doc_type
=
"_doc"
,
id
=
id
)
log
.
info
(
'删除结果
%
s'
%
result
)
if
__name__
==
"__main__"
:
esMethod
=
EsMethod
()
redis_conn
=
redis
.
Redis
(
connection_pool
=
pool
)
while
True
:
# 从redis中读取数据,去附件表中根据title查询,更新查到的附件id
item
=
redis_conn
.
lpop
(
'YanBao:up'
)
if
item
:
log
.
info
(
item
)
id
=
item
.
decode
()
esMethod
.
delete
(
esMethod
.
index_name
,
id
)
else
:
log
.
info
(
'已删除完毕'
)
break
comData/YanBao/uploadfile.py
0 → 100644
浏览文件 @
d4632531
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论