Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
crawler
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chengyang Zhong
crawler
Commits
c3a0fcfc
Commit
c3a0fcfc
authored
Aug 04, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
8c715c04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
cal_ni_and_put_to_backend.py
crawler_sys/scheduler/cal_ni_and_put_to_backend.py
+8
-7
No files found.
crawler_sys/scheduler/cal_ni_and_put_to_backend.py
View file @
c3a0fcfc
...
...
@@ -24,10 +24,10 @@ import random
# from mistune import Renderer, InlineGrammar, InlineLexer, Markdown, escape
rds
=
redis
.
StrictRedis
(
host
=
'154.8.190.251'
,
port
=
6379
,
db
=
19
)
#
conn = pymysql.connect(host='bj-cdb-6slgqwlc.sql.tencentcdb.com', port=62120, user='work', passwd='Gengmei1',
#
db='mimas_test', charset='utf8')
conn
=
pymysql
.
connect
(
host
=
'172.16.30.138'
,
port
=
3306
,
user
=
'mimas'
,
passwd
=
'GJL3UJe1Ck9ggL6aKnZCq4cRvM'
,
db
=
'mimas_prod'
,
charset
=
'utf8mb4'
)
conn
=
pymysql
.
connect
(
host
=
'bj-cdb-6slgqwlc.sql.tencentcdb.com'
,
port
=
62120
,
user
=
'work'
,
passwd
=
'Gengmei1'
,
db
=
'mimas_test'
,
charset
=
'utf8'
)
#
conn = pymysql.connect(host='172.16.30.138', port=3306, user='mimas', passwd='GJL3UJe1Ck9ggL6aKnZCq4cRvM',
#
db='mimas_prod', charset='utf8mb4')
cur
=
conn
.
cursor
()
...
...
@@ -255,13 +255,14 @@ def push_data_to_user(res_data: Dict) -> Dict:
if
res_data
[
"img_list"
]:
for
img_url
in
res_data
[
"img_list"
]:
try
:
img_wb
=
retry_get_url
(
img_url
)
.
content
img_wb
=
retry_get_url
(
img_url
,
proxies
=
2
)
.
content
res
=
upload
(
img_wb
)
print
(
res
)
img_info
=
retry_get_url
(
res
+
"-imageinfo"
)
img_info_json
=
img_info
.
json
()
qiniu_img_list
.
append
((
res
+
"-w"
,
img_info_json
))
except
:
except
Exception
as
e
:
print
(
"down load img error
%
s"
%
e
)
return
{}
# 替换图片
...
...
@@ -391,7 +392,7 @@ def task_main():
for
res_data
in
scan_from_redis
(
rules_list
):
tractate_id
=
write_data_into_mysql
(
res_data
)
try
:
print
(
"line394"
,
res_data
)
print
(
"line394"
,
tractate_id
,
res_data
)
if
res_data
[
"level"
]
>=
1
and
tractate_id
:
title_str
=
res_data
[
"platform"
]
+
"帖子内容审核"
body_str
=
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment