Commit c3d3152f authored by litaolemo's avatar litaolemo

update

parent d15fee19
......@@ -24,8 +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='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()
......@@ -313,7 +315,7 @@ def write_data_into_mysql(res_data):
sql_query = """insert into api_tractate
(user_id,content,is_online,status,platform,content_level,is_excellent,create_time,last_modified,user_del,low_quality,low_quality_deal,platform_id,pgc_type,title)
values ({user_id},'{content}',{is_online},{status},{platform},{content_level},{is_excellent},'{create_time}','{last_modified}',{user_del},{low_quality},{low_quality_deal},'{platform_id}',{pgc_type},'{title}');""".format(
user_id=random.choice(user_id_list), content=data["content"], is_online=1, status=2, platform=3,
user_id=random.choice(user_id_list), content=data["content"], is_online=1, status=2, platform=15,
content_level=data["level"],
is_excellent=0, create_time=now_str,
last_modified=now_str, user_del=0,
......@@ -330,7 +332,7 @@ def write_data_into_mysql(res_data):
if img_info[0] in data.get("content"):
image_url_source = 2
else:
image_url_source = 1
image_url_source = 3
try:
image_type = img_type.get(img_info[1]["format"].upper())
except:
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment