mirror of
https://github.com/wahyd4/youxiang.git
synced 2026-08-08 21:06:21 +10:00
fix issue
This commit is contained in:
+18
-8
@@ -25,6 +25,9 @@ def tb_share_text(group_name: str, material_id: str, app_key, app_secret, adzone
|
||||
count = 0
|
||||
for item in json_data:
|
||||
count += 1
|
||||
coupon_amount = 0
|
||||
coupon_share_url = ""
|
||||
title = ""
|
||||
if str(item).find("coupon_share_url") > -1:
|
||||
coupon_share_url = "https:" + item['coupon_share_url']
|
||||
coupon_amount = item['coupon_amount']
|
||||
@@ -36,10 +39,12 @@ def tb_share_text(group_name: str, material_id: str, app_key, app_secret, adzone
|
||||
# 发送图片
|
||||
itchat.send('@img@%s' % (f'''{filename}'''), group_name)
|
||||
|
||||
itchat.send(f''' {title} \n【在售价】¥{zk_final_price}\n【券后价】¥{round(float(zk_final_price) - float(coupon_amount),
|
||||
2)}\n-----------------\n復製評论({tb_client.taobao_tbk_tpwd_create(
|
||||
title, coupon_share_url)}),去【tao寶】下单\n''', group_name)
|
||||
|
||||
time.sleep(2)
|
||||
itchat.send(f'''{title}\n【在售价】¥{zk_final_price}\n【券后价】¥{round(float(zk_final_price) - float(coupon_amount), 2)}''', group_name)
|
||||
time.sleep(random.randint(1, 3))
|
||||
text = f'''{tb_client.taobao_tbk_tpwd_create(title, coupon_share_url)}'''
|
||||
start_index = text.find('¥')
|
||||
itchat.send(f'''({text[start_index: 13+start_index]})''', group_name)
|
||||
time.sleep(2)
|
||||
del_pic(filename)
|
||||
else:
|
||||
@@ -51,9 +56,14 @@ def tb_share_text(group_name: str, material_id: str, app_key, app_secret, adzone
|
||||
print(pict_url)
|
||||
filename = save_pic(pict_url, item_id)
|
||||
itchat.send('@img@%s' % (f'''{filename}'''), group_name)
|
||||
itchat.send(
|
||||
f'''{title} \n【在售价】¥{zk_final_price}\n-----------------\n復製評论({tb_client.taobao_tbk_tpwd_create(
|
||||
title, click_url)}),去【tao寶】下单\n''', group_name)
|
||||
time.sleep(2)
|
||||
itchat.send(f'''{title}\n【在售价】¥{zk_final_price}\n【券后价】¥{round(float(zk_final_price) - float(coupon_amount), 2)}''', group_name)
|
||||
time.sleep(random.randint(1, 3))
|
||||
text = f'''{tb_client.taobao_tbk_tpwd_create(title, coupon_share_url)}'''
|
||||
start_index = text.find('¥')
|
||||
itchat.send(f'''({text[start_index: 13+start_index]})''', group_name)
|
||||
time.sleep(2)
|
||||
del_pic(filename)
|
||||
time.sleep(2)
|
||||
del_pic(filename)
|
||||
except Exception as e:
|
||||
@@ -62,4 +72,4 @@ def tb_share_text(group_name: str, material_id: str, app_key, app_secret, adzone
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(f'''tb function''')
|
||||
print(f'''tb function''')
|
||||
|
||||
Reference in New Issue
Block a user