飞书提交数据.py 116 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914
  1. import tkinter as tk
  2. from tkinter import ttk, filedialog, messagebox, scrolledtext
  3. import pandas as pd
  4. import requests
  5. import json
  6. import threading
  7. import time
  8. import random
  9. import re
  10. from datetime import datetime
  11. import os
  12. import shutil
  13. from openpyxl import load_workbook
  14. from openpyxl.utils import get_column_letter
  15. from PIL import Image
  16. import io
  17. import base64
  18. import zlib
  19. class FeishuSubmitApp:
  20. def __init__(self, root):
  21. self.root = root
  22. self.root.title("飞书表格数据提交工具 - 自动提取图片")
  23. self.root.geometry("1100x800")
  24. # 状态变量
  25. self.is_running = False
  26. self.stop_flag = False
  27. self.excel_file = ""
  28. self.cookie_string = ""
  29. # 图片缓存
  30. self.image_cache = {} # {行号: [图片数据列表]}
  31. self.image_extract_folder = None
  32. self.uploaded_cache = {} # 缓存已上传的图片token {行号: attachment_info}
  33. # 从curl提取的默认配置
  34. self.default_headers = {
  35. "accept": "application/json, text/plain, */*",
  36. "accept-language": "zh-CN,zh;q=0.9",
  37. "content-type": "application/json",
  38. "f-version": "docs-6-17-1781628518399",
  39. "origin": "https://xhd.feishu.cn",
  40. "priority": "u=1, i",
  41. "referer": "https://xhd.feishu.cn/share/base/form/shrcnJqFUFF0sqlmrfsWpDNf8df",
  42. "sec-ch-ua": '"Chromium";v="148", "Google Chrome";v="148", "Not/A)Brand";v="99"',
  43. "sec-ch-ua-mobile": "?0",
  44. "sec-ch-ua-platform": '"Windows"',
  45. "sec-fetch-dest": "empty",
  46. "sec-fetch-mode": "cors",
  47. "sec-fetch-site": "same-origin",
  48. "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36",
  49. "x-csrftoken": "83aae12269bced10680d3ccf817f82262305e7d0-1781579108",
  50. "x-tt-logid": "02178275091573600000000000000000000ffff5bd640caae0cb8",
  51. "x-tt-trace": "1"
  52. }
  53. self.url = "https://xhd.feishu.cn/space/api/bitable/share/content"
  54. self.share_token = "shrcnJqFUFF0sqlmrfsWpDNf8df"
  55. self.setup_ui()
  56. self.load_config()
  57. def setup_ui(self):
  58. """构建界面"""
  59. # 主容器
  60. main_frame = ttk.Frame(self.root, padding="10")
  61. main_frame.pack(fill=tk.BOTH, expand=True)
  62. # ========== 第一行:文件选择 ==========
  63. file_frame = ttk.LabelFrame(main_frame, text="📁 数据文件", padding="10")
  64. file_frame.pack(fill=tk.X, pady=(0, 10))
  65. ttk.Label(file_frame, text="Excel文件:").grid(row=0, column=0, sticky=tk.W)
  66. self.file_path_var = tk.StringVar()
  67. ttk.Entry(file_frame, textvariable=self.file_path_var, width=60).grid(row=0, column=1, padx=(10, 10))
  68. ttk.Button(file_frame, text="浏览...", command=self.select_file).grid(row=0, column=2)
  69. ttk.Label(file_frame, text="工作表:").grid(row=1, column=0, sticky=tk.W, pady=(10, 0))
  70. self.sheet_var = tk.StringVar(value="Sheet1")
  71. ttk.Entry(file_frame, textvariable=self.sheet_var, width=20).grid(row=1, column=1, sticky=tk.W, padx=(10, 10), pady=(10, 0))
  72. ttk.Label(file_frame, text="(默认: Sheet1)").grid(row=1, column=2, sticky=tk.W, pady=(10, 0))
  73. # ========== 第二行:Cookie配置 ==========
  74. cookie_frame = ttk.LabelFrame(main_frame, text="🍪 Cookie 配置", padding="10")
  75. cookie_frame.pack(fill=tk.X, pady=(0, 10))
  76. ttk.Label(cookie_frame, text="Cookie:").grid(row=0, column=0, sticky=tk.W)
  77. self.cookie_text = tk.Text(cookie_frame, height=4, width=80, wrap=tk.WORD)
  78. self.cookie_text.grid(row=0, column=1, padx=(10, 10), pady=(0, 5), sticky=tk.W)
  79. cookie_btn_frame = ttk.Frame(cookie_frame)
  80. cookie_btn_frame.grid(row=1, column=1, sticky=tk.W, padx=(10, 0))
  81. ttk.Button(cookie_btn_frame, text="从剪贴板粘贴", command=self.paste_cookie).pack(side=tk.LEFT, padx=(0, 10))
  82. ttk.Button(cookie_btn_frame, text="保存配置", command=self.save_config).pack(side=tk.LEFT, padx=(0, 10))
  83. ttk.Button(cookie_btn_frame, text="加载默认", command=self.load_default_cookie).pack(side=tk.LEFT)
  84. # ========== 第三行:发送控制 ==========
  85. control_frame = ttk.LabelFrame(main_frame, text="⚙️ 发送控制", padding="10")
  86. control_frame.pack(fill=tk.X, pady=(0, 10))
  87. # 间隔配置
  88. ttk.Label(control_frame, text="最小间隔(秒):").grid(row=0, column=0, sticky=tk.W)
  89. self.min_interval_var = tk.StringVar(value="20")
  90. ttk.Entry(control_frame, textvariable=self.min_interval_var, width=10).grid(row=0, column=1, padx=(5, 15), sticky=tk.W)
  91. ttk.Label(control_frame, text="最大间隔(秒):").grid(row=0, column=2, sticky=tk.W)
  92. self.max_interval_var = tk.StringVar(value="50")
  93. ttk.Entry(control_frame, textvariable=self.max_interval_var, width=10).grid(row=0, column=3, padx=(5, 15), sticky=tk.W)
  94. ttk.Label(control_frame, text="起始行:").grid(row=0, column=4, sticky=tk.W)
  95. self.start_row_var = tk.StringVar(value="2")
  96. ttk.Entry(control_frame, textvariable=self.start_row_var, width=8).grid(row=0, column=5, padx=(5, 15), sticky=tk.W)
  97. ttk.Label(control_frame, text="(表头在第1行)").grid(row=0, column=6, sticky=tk.W)
  98. # 操作按钮
  99. btn_frame = ttk.Frame(control_frame)
  100. btn_frame.grid(row=1, column=0, columnspan=7, pady=(15, 0), sticky=tk.W)
  101. self.start_btn = ttk.Button(btn_frame, text="🚀 开始发送", command=self.start_send)
  102. self.start_btn.pack(side=tk.LEFT, padx=(0, 10))
  103. self.stop_btn = ttk.Button(btn_frame, text="⏹ 停止", command=self.stop_send, state=tk.DISABLED)
  104. self.stop_btn.pack(side=tk.LEFT, padx=(0, 10))
  105. ttk.Button(btn_frame, text="清空日志", command=self.clear_log).pack(side=tk.LEFT, padx=(0, 10))
  106. ttk.Button(btn_frame, text="📸 提取图片", command=self.extract_images).pack(side=tk.LEFT)
  107. # 状态显示
  108. self.status_var = tk.StringVar(value="就绪")
  109. ttk.Label(control_frame, textvariable=self.status_var, foreground="blue").grid(row=2, column=0, columnspan=7, pady=(10, 0), sticky=tk.W)
  110. # ========== 日志显示 ==========
  111. log_frame = ttk.LabelFrame(main_frame, text="📋 发送日志", padding="10")
  112. log_frame.pack(fill=tk.BOTH, expand=True)
  113. self.log_text = scrolledtext.ScrolledText(log_frame, height=20, wrap=tk.WORD, font=("Consolas", 9))
  114. self.log_text.pack(fill=tk.BOTH, expand=True)
  115. # 日志颜色标签
  116. self.log_text.tag_config("success", foreground="green")
  117. self.log_text.tag_config("error", foreground="red")
  118. self.log_text.tag_config("info", foreground="blue")
  119. self.log_text.tag_config("warning", foreground="orange")
  120. self.log_text.tag_config("debug", foreground="purple")
  121. # ========== 底部状态栏 ==========
  122. status_bar = ttk.Frame(self.root)
  123. status_bar.pack(fill=tk.X, side=tk.BOTTOM)
  124. ttk.Label(status_bar, textvariable=self.status_var, relief=tk.SUNKEN, anchor=tk.W).pack(fill=tk.X, padx=5, pady=2)
  125. def select_file(self):
  126. """选择Excel文件"""
  127. file_path = filedialog.askopenfilename(
  128. title="选择Excel文件",
  129. filetypes=[("Excel files", "*.xlsx *.xls"), ("All files", "*.*")]
  130. )
  131. if file_path:
  132. self.file_path_var.set(file_path)
  133. self.excel_file = file_path
  134. self.log(f"已选择文件: {file_path}", "info")
  135. # 尝试自动识别工作表
  136. try:
  137. xl = pd.ExcelFile(file_path)
  138. sheets = xl.sheet_names
  139. if sheets:
  140. self.sheet_var.set(sheets[0])
  141. self.log(f"自动选择工作表: {sheets[0]}", "info")
  142. except Exception as e:
  143. self.log(f"读取工作表失败: {str(e)}", "warning")
  144. def paste_cookie(self):
  145. """从剪贴板粘贴Cookie"""
  146. try:
  147. clipboard_text = self.root.clipboard_get()
  148. if "cookie:" in clipboard_text.lower() or "-H" in clipboard_text:
  149. cookie_match = re.search(r'-b\s+"([^"]+)"', clipboard_text)
  150. if not cookie_match:
  151. cookie_match = re.search(r'-H\s+"cookie:\s*([^"]+)"', clipboard_text, re.IGNORECASE)
  152. if cookie_match:
  153. self.cookie_text.delete(1.0, tk.END)
  154. self.cookie_text.insert(1.0, cookie_match.group(1))
  155. self.log("已从剪贴板提取Cookie", "success")
  156. return
  157. self.cookie_text.delete(1.0, tk.END)
  158. self.cookie_text.insert(1.0, clipboard_text)
  159. self.log("已粘贴Cookie", "info")
  160. except:
  161. messagebox.showwarning("提示", "无法读取剪贴板内容")
  162. def load_default_cookie(self):
  163. """加载默认Cookie"""
  164. default_cookie = "_uuid_hera_ab_path_1=7651649498397052109; __tea__ug__uid=4144561781538482924; _gcl_au=1.1.775810441.1781538483; lgw_csrf_token=9dcbe9c422a1a2df5727bebebf4136760e1ad6dc-1781538485; passport_web_did=7651823325329411260; passport_trace_id=7651823325353757894; QXV0aHpDb250ZXh0=ba539bcfe4a042c8bc1e99d4d03add38; s_v_web_id=verify_mqg251ox_Tp4ofGaR_NCf4_4zII_8Ad3_c3HxGb4PXIuN; session=XN0YXJ0-5b9t9966-1122-4520-890c-e9313b1f818a-WVuZA; session_list=XN0YXJ0-5b9t9966-1122-4520-890c-e9313b1f818a-WVuZA; login_recently=1; is_anonymous_session=; _csrf_token=83aae12269bced10680d3ccf817f82262305e7d0-1781579108; lang=zh; et=c0c63f4480fdf14d7e6e9a21bab2b7e1; ccm_cdn_host=//lf-package-cn.feishucdn.com/obj/feishu-static; locale=zh-CN; landing_url=https://www.feishu.cn/; Hm_lvt_a79616d9322d81f12a92402ac6ae32ea=1781538483,1781579751; Hm_lpvt_a79616d9322d81f12a92402ac6ae32ea=1781579751; HMACCOUNT=5CA5EB76287246C7; _ga_VPYRHN104D=GS2.1.s1781579004$o2$g1$t1781579751$j60$l0$h0; _uetvid=9877555068d111f1992d03b61d301033; _ga=GA1.2.692261332.1781538484; i18n_locale=zh-CN; i18n_locale=zh-CN; _gid=GA1.2.1918132955.1781749497; site_env=pre=0; sl_session=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3ODE3OTMyNTgsInVuaXQiOiJldV9uYyIsInJhdyI6eyJtZXRhIjoiQVdvYzIrdU1BNHZSYUhkQjl4N2lRQUpxTUx6RjlrN012R293dk1YMlRzeThhakM5WXdRQURMSUNLZ0VBUVVGQlFVRkJRVUZCUVVKeFRVd3hha2h6UkUxNFVUMDkiLCJzdW0iOiI1MWU3ZWM3YzU0NTAzNTljMzRhMjE3ODdlM2U1OGNmZjQzNzZmM2IzYjJjNzU4NWVjMGE3MjQyZDZjNTBiNmNkIiwibG9jIjoiemhfY24iLCJhcGMiOiJSZWxlYXNlIiwiaWF0IjoxNzgxNzUwMDU4LCJzYWMiOnsiVXNlclN0YWZmU3RhdHVzIjoiMSIsIlVzZXJUeXBlIjoiNDIifSwibG9kIjpudWxsLCJjbmYiOnsiamt0Ijoic3VWaTdnNDNJX0lUb0w2ZGo5QXhEWnBacUhkYldzNWJaaVhvV0s4akZrdyJ9LCJucyI6ImxhcmsiLCJuc191aWQiOiI3NjQ2MjI4MDcyMDgxMDk5NzI5IiwibnNfdGlkIjoiNzUyNzU1NzgzMTgwMzk0NDk2MiIsIm90IjoxLCJjdCI6MTc4MTU3OTEwNywicnQiOjE3ODE2Njg4OTMsInRjcyI6MiwidGJ0IjowfX0.6MrIkLX5grSs5PUBr3U-TC5keonxZZDADzbJ0c00y9HsalJhhQ0gbmfk2u2w5RWhMkXt46a50yMc9E7Po6kymg; msToken=Oyg-XUAwfnJlSSSvRBdj1W_LxhRCXLlWMx9mk0Ryxvku6FZLH0ysyeYnmGrIG_yvUClyZT2cLYe5rhC1PtVygRRXOhYTvrDcL8Oidp-ZHHI-LNFKPJk-She-3kUxNTnwb3fYj5FfI36vX-1eFZ_neFVmoTtgD1GhK3M3oNjh5H-Y; swp_csrf_token=6fe8dbf3-4ab2-4f46-b4f3-5c9cba7364cd; t_beda37=a427edf4f48d9fa049a454a58600fa2f188ffacaf053a85e3782d6615e737b03; passport_app_access_token=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3ODE3OTU2NDcsInVuaXQiOiJldV9uYyIsInJhdyI6eyJtX2FjY2Vzc19pbmZvIjp7IjE0MyI6eyJpYXQiOjE3ODE3NDk1MTksImFjY2VzcyI6dHJ1ZX0sIjIiOnsiaWF0IjoxNzgxNzUyMTY1LCJhY2Nlc3MiOnRydWV9LCIxMDAiOnsiaWF0IjoxNzgxNzUyMjk1LCJhY2Nlc3MiOnRydWV9LCI0Ijp7ImlhdCI6MTc4MTc1MjQ0NywiYWNjZXNzIjp0cnVlfX0sInN1bSI6IjUxZTdlYzdjNTQ1MDM1OWMzNGEyMTc4N2UzZTU4Y2ZmNDM3NmYzYjNiMmM3NTg1ZWMwYTcyNDJkNmM1MGI2Y2QifX0.6o43emSe8iOBsXTPUbx4cShf-DdIpGuTTYDR5NDAAvA6ZByV_biiboF32sk5SjLAuTfEEy1xWpZ_35Fb-nxvJg"
  165. self.cookie_text.delete(1.0, tk.END)
  166. self.cookie_text.insert(1.0, default_cookie)
  167. self.log("已加载默认Cookie", "info")
  168. def save_config(self):
  169. """保存Cookie配置到文件"""
  170. cookie = self.cookie_text.get(1.0, tk.END).strip()
  171. if not cookie:
  172. messagebox.showwarning("提示", "Cookie不能为空")
  173. return
  174. try:
  175. with open("cookie_config.txt", "w", encoding="utf-8") as f:
  176. f.write(cookie)
  177. self.log("Cookie配置已保存", "success")
  178. messagebox.showinfo("成功", "Cookie配置已保存到 cookie_config.txt")
  179. except Exception as e:
  180. self.log(f"保存失败: {str(e)}", "error")
  181. def load_config(self):
  182. """加载保存的Cookie配置"""
  183. try:
  184. with open("cookie_config.txt", "r", encoding="utf-8") as f:
  185. cookie = f.read().strip()
  186. if cookie:
  187. self.cookie_text.delete(1.0, tk.END)
  188. self.cookie_text.insert(1.0, cookie)
  189. self.log("已加载保存的Cookie配置", "info")
  190. except FileNotFoundError:
  191. pass
  192. except Exception as e:
  193. self.log(f"加载配置失败: {str(e)}", "warning")
  194. def log(self, message, tag="info"):
  195. """添加日志"""
  196. timestamp = datetime.now().strftime("%H:%M:%S")
  197. self.log_text.insert(tk.END, f"[{timestamp}] {message}\n", tag)
  198. self.log_text.see(tk.END)
  199. self.root.update_idletasks()
  200. def clear_log(self):
  201. """清空日志"""
  202. self.log_text.delete(1.0, tk.END)
  203. def parse_cookie(self, cookie_string):
  204. """解析Cookie字符串为字典"""
  205. cookies = {}
  206. for item in cookie_string.split(';'):
  207. item = item.strip()
  208. if '=' in item:
  209. key, value = item.split('=', 1)
  210. cookies[key.strip()] = value.strip()
  211. return cookies
  212. def _get_csrf_token(self):
  213. """从cookie中提取csrf_token"""
  214. cookie_text = self.cookie_text.get(1.0, tk.END).strip()
  215. # 匹配 _csrf_token=xxx 或 csrf_token=xxx
  216. match = re.search(r'_csrf_token=([^;]+)', cookie_text)
  217. if match:
  218. return match.group(1)
  219. # 也尝试匹配 x-csrftoken
  220. match = re.search(r'x-csrftoken[=:]\s*([^;\s]+)', cookie_text, re.IGNORECASE)
  221. if match:
  222. return match.group(1)
  223. # 返回默认值
  224. return "83aae12269bced10680d3ccf817f82262305e7d0-1781579108"
  225. def _get_mime_type(self, filename):
  226. """获取文件MIME类型"""
  227. ext = os.path.splitext(filename)[1].lower()
  228. mime_map = {
  229. '.jpg': 'image/jpeg',
  230. '.jpeg': 'image/jpeg',
  231. '.png': 'image/png',
  232. '.gif': 'image/gif',
  233. '.bmp': 'image/bmp',
  234. '.webp': 'image/webp'
  235. }
  236. return mime_map.get(ext, 'image/jpeg')
  237. def upload_image(self, image_data, filename="image.jpg"):
  238. """
  239. 完整上传图片到飞书,返回file_token信息
  240. """
  241. try:
  242. cookie_string = self.cookie_text.get(1.0, tk.END).strip()
  243. if not cookie_string:
  244. self.log(" ❌ Cookie为空,无法上传图片", "error")
  245. return None
  246. cookies = self.parse_cookie(cookie_string)
  247. csrf_token = self._get_csrf_token()
  248. self.log(f" 🔍 使用的CSRF token: {csrf_token[:30] if csrf_token else 'None'}...", "debug")
  249. self.log(f" 🔍 图片大小: {len(image_data)} bytes", "debug")
  250. # 构建通用请求头
  251. base_headers = {
  252. "accept": "application/json, text/plain, */*",
  253. "accept-language": "zh-CN,zh;q=0.9",
  254. "f-version": "docs-6-17-1781628518399",
  255. "x-csrftoken": csrf_token,
  256. "x-tt-logid": "02178275091573600000000000000000000ffff5bd640caae0cb8",
  257. "x-tt-trace": "1",
  258. "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
  259. }
  260. # ========== 步骤1: 获取uploadCode ==========
  261. self.log(f" 📤 [1/4] 获取上传code...", "info")
  262. code_url = "https://xhd.feishu.cn/space/api/bitable/external/share/uploadCode"
  263. code_params = {
  264. "shareToken": self.share_token,
  265. "fileName": filename,
  266. "size": len(image_data),
  267. "mountPoint": "bitable_tmp_point"
  268. }
  269. self.log(f" 📋 请求URL: {code_url}", "debug")
  270. self.log(f" 📋 请求参数: {json.dumps(code_params, ensure_ascii=False)}", "debug")
  271. code_response = requests.get(code_url, params=code_params, headers=base_headers, cookies=cookies, timeout=30)
  272. self.log(f" 📡 响应状态码: {code_response.status_code}", "debug")
  273. if code_response.status_code != 200:
  274. self.log(f" ❌ 获取code失败: HTTP {code_response.status_code}", "error")
  275. self.log(f" ❌ 响应内容: {code_response.text}", "error")
  276. return None
  277. try:
  278. code_data = code_response.json()
  279. except Exception as e:
  280. self.log(f" ❌ 解析JSON失败: {str(e)}", "error")
  281. return None
  282. upload_code = code_data.get('data', {}).get('uploadCode')
  283. if not upload_code:
  284. self.log(f" ❌ 响应中没有uploadCode字段", "error")
  285. self.log(f" ❌ data内容: {code_data.get('data', {})}", "error")
  286. return None
  287. self.log(f" ✅ 获取uploadCode成功: {upload_code[:30]}...", "success")
  288. # ========== 步骤2: 准备上传 ==========
  289. self.log(f" 📤 [2/4] 准备上传,获取upload_id...", "info")
  290. prepare_url = "https://xhd.feishu.cn/space/api/box/upload/prepare/authcode/"
  291. prepare_headers = base_headers.copy()
  292. prepare_headers["content-type"] = "application/json"
  293. prepare_headers["x-command"] = "space.api.box.upload.prepare.authcode"
  294. prepare_body = {
  295. "code": upload_code,
  296. "mount_point": "bitable_tmp_point",
  297. "mount_node_token": self.share_token
  298. }
  299. self.log(f" 📋 请求体: {json.dumps(prepare_body, ensure_ascii=False)}", "debug")
  300. prepare_response = requests.post(prepare_url, headers=prepare_headers, cookies=cookies, json=prepare_body, timeout=30)
  301. self.log(f" 📡 响应状态码: {prepare_response.status_code}", "debug")
  302. if prepare_response.status_code != 200:
  303. self.log(f" ❌ 准备上传失败: HTTP {prepare_response.status_code}", "error")
  304. self.log(f" ❌ 响应内容: {prepare_response.text}", "error")
  305. return None
  306. try:
  307. prepare_data = prepare_response.json()
  308. except Exception as e:
  309. self.log(f" ❌ 解析JSON失败: {str(e)}", "error")
  310. return None
  311. if prepare_data.get('code') != 0:
  312. self.log(f" ❌ 准备上传失败: code={prepare_data.get('code')}, msg={prepare_data.get('msg', '未知错误')}", "error")
  313. return None
  314. upload_id = prepare_data.get('data', {}).get('upload_id')
  315. if not upload_id:
  316. self.log(f" ❌ 响应中没有upload_id字段", "error")
  317. self.log(f" ❌ data内容: {prepare_data.get('data', {})}", "error")
  318. return None
  319. self.log(f" ✅ 获取upload_id成功: {upload_id}", "success")
  320. self.log(f" 📤 [3/4] 上传文件内容 ({len(image_data)} bytes)...", "info")
  321. # 使用 Adler-32 计算 checksum(飞书使用的算法)
  322. import zlib
  323. checksum = zlib.adler32(image_data) & 0xffffffff
  324. upload_url = f"https://internal-api-drive-stream.feishu.cn/space/api/box/stream/upload/merge_block/?upload_id={upload_id}"
  325. upload_headers = base_headers.copy()
  326. upload_headers["content-type"] = "application/octet-stream"
  327. upload_headers["x-command"] = "space.api.box.stream.upload.merge_block"
  328. upload_headers["x-seq-list"] = "0"
  329. upload_headers["x-block-list-checksum"] = str(checksum) # 注意:是数字字符串,不是十六进制
  330. upload_headers["x-block-origin-size"] = str(len(image_data))
  331. self.log(f" 📋 文件大小: {len(image_data)} bytes, checksum(Adler-32): {checksum}", "debug")
  332. upload_response = requests.post(upload_url, headers=upload_headers, cookies=cookies, data=image_data, timeout=60)
  333. self.log(f" 📡 响应状态码: {upload_response.status_code}", "debug")
  334. self.log(f" 📡 响应内容: {upload_response.text[:500]}", "debug")
  335. if upload_response.status_code != 200:
  336. self.log(f" ❌ 上传文件失败: HTTP {upload_response.status_code}", "error")
  337. self.log(f" ❌ 响应内容: {upload_response.text}", "error")
  338. return None
  339. # 检查上传是否真正成功
  340. try:
  341. upload_result = upload_response.json()
  342. if upload_result.get('code') != 0:
  343. self.log(f" ❌ 上传文件失败: code={upload_result.get('code')}, msg={upload_result.get('message', '未知错误')}", "error")
  344. return None
  345. except:
  346. pass
  347. self.log(f" ✅ 文件上传成功", "success")
  348. # ========== 步骤4: 完成上传 ==========
  349. self.log(f" 📤 [4/4] 完成上传,获取file_token...", "info")
  350. finish_url = "https://xhd.feishu.cn/space/api/box/upload/finish/"
  351. finish_headers = base_headers.copy()
  352. finish_headers["content-type"] = "application/json"
  353. finish_headers["x-command"] = "space.api.box.upload.finish"
  354. finish_body = {
  355. "upload_id": upload_id,
  356. "num_blocks": 1,
  357. "push_open_history_record": 0
  358. }
  359. self.log(f" 📋 请求体: {json.dumps(finish_body, ensure_ascii=False)}", "debug")
  360. finish_response = requests.post(finish_url, headers=finish_headers, cookies=cookies, json=finish_body, timeout=30)
  361. self.log(f" 📡 响应状态码: {finish_response.status_code}", "debug")
  362. self.log(f" 📡 响应内容: {finish_response.text[:500]}", "debug")
  363. if finish_response.status_code != 200:
  364. self.log(f" ❌ 完成上传失败: HTTP {finish_response.status_code}", "error")
  365. self.log(f" ❌ 响应内容: {finish_response.text}", "error")
  366. return None
  367. try:
  368. finish_data = finish_response.json()
  369. except Exception as e:
  370. self.log(f" ❌ 解析JSON失败: {str(e)}", "error")
  371. return None
  372. if finish_data.get('code') != 0:
  373. self.log(f" ❌ 完成上传失败: code={finish_data.get('code')}, msg={finish_data.get('message', '未知错误')}", "error")
  374. self.log(f" ❌ 完整响应: {json.dumps(finish_data, ensure_ascii=False, indent=2)}", "error")
  375. return None
  376. file_token = finish_data.get('data', {}).get('file_token')
  377. if not file_token:
  378. self.log(f" ❌ 响应中没有file_token字段", "error")
  379. self.log(f" ❌ data内容: {finish_data.get('data', {})}", "error")
  380. return None
  381. # 获取图片信息
  382. width, height = 0, 0
  383. try:
  384. from PIL import Image
  385. import io
  386. pil_img = Image.open(io.BytesIO(image_data))
  387. width, height = pil_img.size
  388. except:
  389. pass
  390. result = {
  391. 'attachmentToken': file_token,
  392. 'id': file_token,
  393. 'mimeType': self._get_mime_type(filename),
  394. 'name': filename,
  395. 'size': len(image_data),
  396. 'timeStamp': int(time.time() * 1000),
  397. 'height': height,
  398. 'width': width
  399. }
  400. self.log(f" ✅ 图片上传完成! file_token: {file_token}", "success")
  401. return result
  402. except requests.exceptions.Timeout:
  403. self.log(f" ❌ 上传超时", "error")
  404. return None
  405. except Exception as e:
  406. self.log(f" ❌ 上传图片异常: {str(e)}", "error")
  407. import traceback
  408. self.log(f" 详细: {traceback.format_exc()}", "debug")
  409. return None
  410. def extract_images_to_cache(self, file_path, sheet_name):
  411. """
  412. 提取Excel中的所有图片到缓存
  413. 返回: dict {行号: [图片数据列表]}
  414. """
  415. image_cache = {}
  416. try:
  417. wb = load_workbook(file_path, data_only=True)
  418. ws = wb[sheet_name]
  419. if hasattr(ws, '_images') and ws._images:
  420. self.log(f" 📸 开始提取 {len(ws._images)} 张图片到缓存...", "info")
  421. for idx, img in enumerate(ws._images):
  422. try:
  423. # 获取位置信息
  424. if hasattr(img, 'anchor') and hasattr(img.anchor, '_from'):
  425. anchor_from = img.anchor._from
  426. row = anchor_from.row + 1
  427. col = anchor_from.col + 1
  428. else:
  429. row = idx + 1
  430. col = 0
  431. # 获取图片数据
  432. image_data = None
  433. img_format = 'jpg'
  434. filename = f"image_{row}_{idx}.jpg"
  435. if hasattr(img, '_data') and callable(img._data):
  436. image_data = img._data()
  437. elif hasattr(img, '_data') and not callable(img._data):
  438. image_data = img._data
  439. elif hasattr(img, 'image'):
  440. if hasattr(img.image, '_data') and callable(img.image._data):
  441. image_data = img.image._data()
  442. elif hasattr(img.image, '_data'):
  443. image_data = img.image._data
  444. if image_data is None:
  445. continue
  446. # 检测图片格式
  447. try:
  448. from PIL import Image
  449. import io
  450. pil_img = Image.open(io.BytesIO(image_data))
  451. img_format = pil_img.format if pil_img.format else 'jpg'
  452. filename = f"image_{row}_{idx}.{img_format.lower()}"
  453. except:
  454. pass
  455. if row not in image_cache:
  456. image_cache[row] = []
  457. image_cache[row].append({
  458. 'data': image_data,
  459. 'col': col,
  460. 'format': img_format,
  461. 'filename': filename
  462. })
  463. except Exception as e:
  464. self.log(f" ⚠️ 提取图片失败: {str(e)}", "warning")
  465. wb.close()
  466. total = sum(len(imgs) for imgs in image_cache.values())
  467. self.log(f" ✅ 成功提取 {total} 张图片到缓存,分布在 {len(image_cache)} 行", "success")
  468. except Exception as e:
  469. self.log(f" ❌ 提取图片失败: {str(e)}", "error")
  470. return image_cache
  471. def build_request_body(self, row_dict, row_index):
  472. """根据Excel行数据构建请求体"""
  473. try:
  474. # 获取各列数据
  475. name = str(row_dict.get("姓名", "")) if pd.notna(row_dict.get("姓名")) else ""
  476. gender = str(row_dict.get("性别", "")) if pd.notna(row_dict.get("性别")) else ""
  477. phone = str(row_dict.get("手机号码", "")) if pd.notna(row_dict.get("手机号码")) else ""
  478. remark = str(row_dict.get("备注", "")) if pd.notna(row_dict.get("备注")) else ""
  479. institution = str(row_dict.get("机构", "")) if pd.notna(row_dict.get("机构")) else ""
  480. target_school_text = str(row_dict.get("意向学校", "")) if pd.notna(row_dict.get("意向学校")) else ""
  481. consulting_text = str(row_dict.get("咨询项目", "")) if pd.notna(row_dict.get("咨询项目")) else ""
  482. product_text = str(row_dict.get("产品", "")) if pd.notna(row_dict.get("产品")) else ""
  483. source = str(row_dict.get("线索来源", "")) if pd.notna(row_dict.get("线索来源")) else ""
  484. market_person = str(row_dict.get("市场人员", "")) if pd.notna(row_dict.get("市场人员")) else ""
  485. channel_code = str(row_dict.get("渠道代码", "")) if pd.notna(row_dict.get("渠道代码")) else ""
  486. # 去掉数字的小数点
  487. phone = phone.split('.')[0]
  488. self.log(f" 📝 提取数据: 姓名={name}, 手机={phone}, 渠道代码={channel_code}, 意向学校={target_school_text}, 咨询项目={consulting_text}, 产品={product_text}", "debug")
  489. # 意向校区映射字典
  490. school_mapping = {
  491. "上海": "optqw2jaJ5",
  492. "徐汇": "optTD4UQsM",
  493. "人广": "opt7hQjSZQ",
  494. "长宁": "opt7A8WBtE",
  495. "浦东": "optnyoxnTK",
  496. "杨浦": "optgArj17r",
  497. "闵行": "optCIwo1J1",
  498. "松江": "optuZzXsYm",
  499. "锦秋个人学校": "optLQYDW3S",
  500. "封闭学院": "optitJpd5G",
  501. "大学生-市区": "optHlvKsKy",
  502. "大学生-曹崇杨": "optdcoQXBt",
  503. "大学生-临港": "opt3i4fOKJ",
  504. "大学生-松江": "optG7eGFUg",
  505. "大学生-奉贤": "optJJqnLgY",
  506. "常州": "opt5wuiYjW"
  507. }
  508. # 咨询项目映射字典
  509. consulting_mapping = {
  510. "语培": "opt96MRele",
  511. "留学": "optQFQsXIe",
  512. "考研": "opti3wbRF7",
  513. "AF艺术": "optaZC2VCL",
  514. "美行音乐": "optzSqwgLp",
  515. "锦秋个人学校": "opt9N4AGbJ",
  516. "研学考团": "optdYBLknN",
  517. "尚思": "optf8lTDcV"
  518. }
  519. # 语培产品映射字典(完整版)
  520. product_mapping = {
  521. "ACT": "optlGkVm5n",
  522. "AEAS": "optqX3b1rJ",
  523. "ALEVEL": "optgMNcV8D",
  524. "AP": "optWKWYQgo",
  525. "BC": "opt8huX4Nv",
  526. "DSE": "optxFBYmUs",
  527. "ESL": "optaYj9RZM",
  528. "GMAT": "optgwu03Nf",
  529. "GRE": "optEOyf5TR",
  530. "IB": "optBhWIw7x",
  531. "IGCSE": "optIuoUFpo",
  532. "KET": "optjcLdrsB",
  533. "PET": "optY42DNFo",
  534. "PTE": "optOrHJvTX",
  535. "SAT": "optTxT8NEu",
  536. "SSAT": "optJ2a0tkB",
  537. "Toefl Junior": "optEGInE0d",
  538. "国际备考": "optgwn1azI",
  539. "国际研学及考团": "optAmxtqGN",
  540. "国家地理": "opttXZvoj3",
  541. "剑桥英语": "optQkkhzD5",
  542. "锦秋竞赛": "optUgXXmpF",
  543. "考研": "optgQrGHTS",
  544. "留学预备": "optWxtOU8b",
  545. "美高": "opt36E5u0t",
  546. "硕果": "optNKeSnho",
  547. "硕果竞赛": "optMzk3TpL",
  548. "腾飞计划": "optYTD9h04",
  549. "团企培": "optW5UDF6G",
  550. "托福": "optKuZ2zCq",
  551. "雅思": "optWsal1MB",
  552. "用英语讲中国故事": "optinda27s",
  553. "在线": "opt2X07PY4",
  554. "浙大国际本科": "optZFmVTTC",
  555. "语培待定/未知": "optTNitLA5",
  556. "大学四级": "optAqYPFmN",
  557. "大学六级": "optpdfKgdl",
  558. "菁英树": "optBFhBHFX",
  559. "其它": "opt698ww1H"
  560. }
  561. # ========== 渠道代码映射(从你提供的列表构建) ==========
  562. channel_mapping = {}
  563. # 这里从你提供的列表中构建映射
  564. # 注意:由于你提供的列表非常长,我在这里使用一个简化的构建方式
  565. # 实际使用中,你可以将下面这段替换为直接从JSON文件读取
  566. # 构建渠道映射(从你提供的列表中提取)
  567. channel_list = [
  568. {"id": "optLmJRYaG", "name": "78060017"},
  569. {"id": "optMGa0026", "name": "常州01070120"},
  570. {"id": "optLgvJqZ7", "name": "78010006"},
  571. {"id": "opt17YSXOf", "name": "78060026"},
  572. {"id": "optqpwKkwU", "name": "11030001"},
  573. {"id": "optkss2y0D", "name": "11030005"},
  574. {"id": "optDo1EMFF", "name": "11030007"},
  575. {"id": "optt88Do20", "name": "11050008"},
  576. {"id": "optwHPudWZ", "name": "11050010"},
  577. {"id": "optAEI150b", "name": "11010002"},
  578. {"id": "optQQnMHIp", "name": "11010016"},
  579. {"id": "optWs6H2Xp", "name": "11050018"},
  580. {"id": "optZBKRejf", "name": "11070020"},
  581. {"id": "opt4TOjMb3", "name": "11010022"},
  582. {"id": "optRmgEkX8", "name": "11070024"},
  583. {"id": "optY4p3Owx", "name": "11030026"},
  584. {"id": "optraQKM8E", "name": "11030028"},
  585. {"id": "opt6mzweJS", "name": "11030030"},
  586. {"id": "optl41JGHT", "name": "11090031"},
  587. {"id": "optbrq8qkL", "name": "11010034"},
  588. {"id": "optwxtq8FP", "name": "11010037"},
  589. {"id": "optqZAHaJJ", "name": "11010040"},
  590. {"id": "opto4kY2lR", "name": "11010042"},
  591. {"id": "opt2KXjnP1", "name": "94010031"},
  592. {"id": "opttB06MWK", "name": "32010135"},
  593. {"id": "optiV3G6yE", "name": "20010045"},
  594. {"id": "optW56vGxS", "name": "培训妙杀网(考研)"},
  595. {
  596. "id": "optDYPrsIR",
  597. "name": "50070120"
  598. }, {
  599. "id": "opt7UiNtsf",
  600. "name": "38010048"
  601. }, {
  602. "id": "opt9qq8sL7",
  603. "name": "79050024"
  604. }, {
  605. "id": "optd10ESsL",
  606. "name": "98010008"
  607. }, {
  608. "id": "optt4SGOm0",
  609. "name": "32010047"
  610. }, {
  611. "id": "optSSf87v6",
  612. "name": "33040011"
  613. }, {
  614. "id": "optrrMaCZA",
  615. "name": "86050115"
  616. }, {
  617. "id": "optjuG5sSz",
  618. "name": "82010094"
  619. }, {
  620. "id": "optcqGyWbq",
  621. "name": "96010015"
  622. }, {
  623. "id": "optLNGv7r6",
  624. "name": "78060004"
  625. }, {
  626. "id": "optsPFaBv4",
  627. "name": "50010094"
  628. }, {
  629. "id": "optC3ju66z",
  630. "name": "78060007"
  631. }, {
  632. "id": "optMqGkAFn",
  633. "name": "37050109"
  634. }, {
  635. "id": "optJF6X0rf",
  636. "name": "61010175"
  637. }, {
  638. "id": "optXlen3Wz",
  639. "name": "78010005"
  640. }, {
  641. "id": "opt182292475",
  642. "name": "教育宝"
  643. }, {
  644. "id": "optuwfOVMX",
  645. "name": "37010207"
  646. }, {
  647. "id": "optG7T87wx",
  648. "name": "35060002"
  649. }, {
  650. "id": "optkeQefk1",
  651. "name": "79010065"
  652. }, {
  653. "id": "optCnpJ1bm",
  654. "name": "86050147"
  655. }, {
  656. "id": "optjsv83Yp",
  657. "name": "37010140"
  658. }, {
  659. "id": "optGoeaPKe",
  660. "name": "104010008"
  661. }, {
  662. "id": "optSnDBaNc",
  663. "name": "79080155"
  664. }, {
  665. "id": "optYDCkcTy",
  666. "name": "常州05010012"
  667. }, {
  668. "id": "optEWdbb9i",
  669. "name": "66010028"
  670. }, {
  671. "id": "opt3GKnqpZ",
  672. "name": "104010009"
  673. }, {
  674. "id": "optdyRHrph",
  675. "name": "66010029"
  676. }, {
  677. "id": "optQYMdKSN",
  678. "name": "94010028"
  679. }, {
  680. "id": "optKqEJ1K4",
  681. "name": "94010024"
  682. }, {
  683. "id": "optmdAP6vN",
  684. "name": "86030892"
  685. }, {
  686. "id": "optSlNFycr",
  687. "name": "35010016"
  688. }, {
  689. "id": "opt3LNpnVp",
  690. "name": "110010001"
  691. }, {
  692. "id": "optrE3WUDe",
  693. "name": "110010002"
  694. }, {
  695. "id": "optjiE0knO",
  696. "name": "110010003"
  697. }, {
  698. "id": "optZxtkjK4",
  699. "name": "110010004"
  700. }, {
  701. "id": "opttWFSgbj",
  702. "name": "110010005"
  703. }, {
  704. "id": "optDZwMaOL",
  705. "name": "110010006"
  706. }, {
  707. "id": "optYMrGHYd",
  708. "name": "110010007"
  709. }, {
  710. "id": "opt9XIP7EA",
  711. "name": "110010008"
  712. }, {
  713. "id": "optkGLTHYo",
  714. "name": "110010009"
  715. }, {
  716. "id": "optf09PlYA",
  717. "name": "72010233"
  718. }, {
  719. "id": "optO3OYC31",
  720. "name": "52040003"
  721. }, {
  722. "id": "optCt8Q6LI",
  723. "name": "50010183"
  724. }, {
  725. "id": "optZ0EnmoV",
  726. "name": "32010204"
  727. }, {
  728. "id": "optcmhO4of",
  729. "name": "33010006"
  730. }, {
  731. "id": "optltWUGkn",
  732. "name": "66010030"
  733. }, {
  734. "id": "optrL6Hlc3",
  735. "name": "66010031"
  736. }, {
  737. "id": "optcaABEu4",
  738. "name": "112010034"
  739. }, {
  740. "id": "opt8Ve0t4u",
  741. "name": "94010067"
  742. }, {
  743. "id": "optw4hAQzm",
  744. "name": "99010020"
  745. }, {
  746. "id": "opteD1QrMn",
  747. "name": "79080146"
  748. }, {
  749. "id": "optfe7sj8g",
  750. "name": "112010035"
  751. }, {
  752. "id": "optkQVZrrf",
  753. "name": "32010112"
  754. }, {
  755. "id": "optcg1MExb",
  756. "name": "尚师推荐"
  757. }, {
  758. "id": "optYhNWIwc",
  759. "name": "72010084"
  760. }, {
  761. "id": "opt4xUCuFY",
  762. "name": "79050166"
  763. }, {
  764. "id": "opt02ZStXE",
  765. "name": "37010333"
  766. }, {
  767. "id": "optymUCmEr",
  768. "name": "37010334"
  769. }, {
  770. "id": "optYV0cij9",
  771. "name": "124010001"
  772. }, {
  773. "id": "optJS276iq",
  774. "name": "110010059"
  775. }, {
  776. "id": "optZdK6CmS",
  777. "name": "37010335"
  778. }, {
  779. "id": "opt1699614650",
  780. "name": "留学监理网"
  781. }, {
  782. "id": "optw48FC3V",
  783. "name": "88010022"
  784. }, {
  785. "id": "optbKcwrJq",
  786. "name": "37010336"
  787. }, {
  788. "id": "opt3xtKDt5",
  789. "name": "86050152"
  790. }, {
  791. "id": "optQYd0KK5",
  792. "name": "86010889"
  793. }, {
  794. "id": "opt0rOraD7",
  795. "name": "86030137"
  796. }, {
  797. "id": "optHuGR4Eq",
  798. "name": "86030139"
  799. }, {
  800. "id": "optrM7Wdsr",
  801. "name": "86030138"
  802. }, {
  803. "id": "optU5i7ype",
  804. "name": "80010102"
  805. }, {
  806. "id": "opt0Lmg4Uo",
  807. "name": "53040001"
  808. }, {
  809. "id": "opt7vuWnmi",
  810. "name": "20010025"
  811. }, {
  812. "id": "optqVcTHb0",
  813. "name": "52050024"
  814. }, {
  815. "id": "opt7iSnls3",
  816. "name": "94010052"
  817. }, {
  818. "id": "optZALHOHF",
  819. "name": "37010101"
  820. }, {
  821. "id": "optzm19SkW",
  822. "name": "20010096"
  823. }, {
  824. "id": "opt1u3ntO6",
  825. "name": "94010073"
  826. }, {
  827. "id": "optvjrwpjv",
  828. "name": "20010032"
  829. }, {
  830. "id": "opt9z28X3s",
  831. "name": "37010133"
  832. }, {
  833. "id": "optEJ62vts",
  834. "name": "常州01010082"
  835. }, {
  836. "id": "optcD7Vnwl",
  837. "name": "20010047"
  838. }, {
  839. "id": "optah8WxeW",
  840. "name": "79040167"
  841. }, {
  842. "id": "opt5z8vt00",
  843. "name": "79040168"
  844. }, {
  845. "id": "opt308501188",
  846. "name": "培训指南网"
  847. }, {
  848. "id": "opt0DUCf4K",
  849. "name": "50010067"
  850. }, {
  851. "id": "optlcdAcS2",
  852. "name": "86080162"
  853. }, {
  854. "id": "optbvM7HzX",
  855. "name": "44040024"
  856. }, {
  857. "id": "optWZ205SY",
  858. "name": "78050002"
  859. }, {
  860. "id": "optlcDf2Hc",
  861. "name": "37010337"
  862. }, {
  863. "id": "optmJ0m6p9",
  864. "name": "123010003"
  865. }, {
  866. "id": "optF6UqoCY",
  867. "name": "86050093"
  868. }, {
  869. "id": "opt5yXEZf7",
  870. "name": "20010061"
  871. }, {
  872. "id": "optlxhoaiQ",
  873. "name": "86050135"
  874. }, {
  875. "id": "optUTSnRGk",
  876. "name": "20010132"
  877. }, {
  878. "id": "optVIhx9gK",
  879. "name": "79040169"
  880. }, {
  881. "id": "optoV4dCts",
  882. "name": "37010338"
  883. }, {
  884. "id": "optMHxE3Mr",
  885. "name": "110010060"
  886. }, {
  887. "id": "optHU0qhvx",
  888. "name": "20010133"
  889. }, {
  890. "id": "opt182474874",
  891. "name": "新课网"
  892. }, {
  893. "id": "optiz07nV8",
  894. "name": "94010060"
  895. }, {
  896. "id": "optMBkkEKU",
  897. "name": "20010134"
  898. }, {
  899. "id": "optMAqZC9c",
  900. "name": "80010014"
  901. }, {
  902. "id": "optGsAe8s1",
  903. "name": "86010014"
  904. }, {
  905. "id": "optR9gLsLL",
  906. "name": "55080016"
  907. }, {
  908. "id": "optB8JH1pO",
  909. "name": "55010014"
  910. }, {
  911. "id": "optwAKXYyb",
  912. "name": "50010161"
  913. }, {
  914. "id": "optI3wk2T8",
  915. "name": "92040056"
  916. }, {
  917. "id": "optPDv70jT",
  918. "name": "41080138"
  919. }, {
  920. "id": "opti5cmCMl",
  921. "name": "20010043"
  922. }, {
  923. "id": "optyTY79vN",
  924. "name": "94010046"
  925. }, {
  926. "id": "optogH6eoo",
  927. "name": "86050142"
  928. }, {
  929. "id": "optfBIbvgZ",
  930. "name": "常州01080083"
  931. }, {
  932. "id": "optThymT3v",
  933. "name": "常州01080084"
  934. }, {
  935. "id": "optEiKu5vl",
  936. "name": "常州04080013"
  937. }, {
  938. "id": "optDVH5ZSL",
  939. "name": "50010130"
  940. }, {
  941. "id": "optv3kaEy7",
  942. "name": "86030894"
  943. }, {
  944. "id": "optXbsT2GR",
  945. "name": "88010075"
  946. }, {
  947. "id": "optxEeogL7",
  948. "name": "20060003"
  949. }, {
  950. "id": "opteUZSd9Q",
  951. "name": "52060025"
  952. }, {
  953. "id": "optlrtZMKE",
  954. "name": "锦秋渠道007"
  955. }, {
  956. "id": "optC77JIHO",
  957. "name": "82010042"
  958. }, {
  959. "id": "opt3Hno3BZ",
  960. "name": "94010074"
  961. }, {
  962. "id": "optGR0AA2t",
  963. "name": "125040001"
  964. }, {
  965. "id": "optR0jwzXW",
  966. "name": "125040002"
  967. }, {
  968. "id": "optY7rA2oW",
  969. "name": "94010075"
  970. }, {
  971. "id": "optFkKWOm7",
  972. "name": "94010023"
  973. }, {
  974. "id": "optJgSKTMQ",
  975. "name": "94010036"
  976. }, {
  977. "id": "optcvsTbWf",
  978. "name": "50010019"
  979. }, {
  980. "id": "optDmg5e7Z",
  981. "name": "37010275"
  982. }, {
  983. "id": "optUX4n6mt",
  984. "name": "37010122"
  985. }, {
  986. "id": "optKHcZD5h",
  987. "name": "112060001"
  988. }, {
  989. "id": "optRzRGkxn",
  990. "name": "37010339"
  991. }, {
  992. "id": "optVlHoneP",
  993. "name": "37010340"
  994. }, {
  995. "id": "optgfud6Fe",
  996. "name": "110010061"
  997. }, {
  998. "id": "optd3Gl5kE",
  999. "name": "66030032"
  1000. }, {
  1001. "id": "optvV9hBoB",
  1002. "name": "66030033"
  1003. }, {
  1004. "id": "opt8tWm6QB",
  1005. "name": "37010341"
  1006. }, {
  1007. "id": "optiUt6F10",
  1008. "name": "50010023"
  1009. }, {
  1010. "id": "optHVSJ53X",
  1011. "name": "86050111"
  1012. }, {
  1013. "id": "optpxj67eR",
  1014. "name": "86050141"
  1015. }, {
  1016. "id": "optv6vw4lz",
  1017. "name": "79040170"
  1018. }, {
  1019. "id": "optfiMFOIP",
  1020. "name": "锦秋渠道008"
  1021. }, {
  1022. "id": "opt089LdIK",
  1023. "name": "20010135"
  1024. }, {
  1025. "id": "optUBfgEU4",
  1026. "name": "124070002"
  1027. }, {
  1028. "id": "opt8yNu6Fj",
  1029. "name": "110010062"
  1030. }, {
  1031. "id": "optKLwVO1T",
  1032. "name": "37010342"
  1033. }, {
  1034. "id": "optwcQENOQ",
  1035. "name": "86080880"
  1036. }, {
  1037. "id": "optesP729q",
  1038. "name": "37010343"
  1039. }, {
  1040. "id": "optFPdhA9n",
  1041. "name": "常州05080041"
  1042. }, {
  1043. "id": "opt9W0M5NY",
  1044. "name": "123010004"
  1045. }, {
  1046. "id": "optWTqU9iD",
  1047. "name": "86050149"
  1048. }, {
  1049. "id": "optsfLM8Mu",
  1050. "name": "寻校网"
  1051. }, {
  1052. "id": "opteerBBEX",
  1053. "name": "50010012"
  1054. }, {
  1055. "id": "optpcOIOZ0",
  1056. "name": "20010136"
  1057. }, {
  1058. "id": "opttqkd7bz",
  1059. "name": "50010004"
  1060. }, {
  1061. "id": "optktsRRSU",
  1062. "name": "79010042"
  1063. }, {
  1064. "id": "opteGj35SA",
  1065. "name": "37010344"
  1066. }, {
  1067. "id": "optGckQgsv",
  1068. "name": "86030140"
  1069. }, {
  1070. "id": "optXQTSDzA",
  1071. "name": "72080176"
  1072. }, {
  1073. "id": "opt8Z3Bpw9",
  1074. "name": "79010061"
  1075. }, {
  1076. "id": "optT0xWriP",
  1077. "name": "52010026"
  1078. }, {
  1079. "id": "opt458007492",
  1080. "name": "常州01080114"
  1081. }, {
  1082. "id": "opt62WW7jz",
  1083. "name": "86030141"
  1084. }, {
  1085. "id": "optjNSCfjl",
  1086. "name": "54010013"
  1087. }, {
  1088. "id": "optvK9TAe9",
  1089. "name": "52010027"
  1090. }, {
  1091. "id": "optdW6sJPo",
  1092. "name": "86050101"
  1093. }, {
  1094. "id": "optQVDcB2B",
  1095. "name": "32010062"
  1096. }, {
  1097. "id": "optxf9O9Xt",
  1098. "name": "20010087"
  1099. }, {
  1100. "id": "optxQA1lXh",
  1101. "name": "37010195"
  1102. }, {
  1103. "id": "optRp86IVz",
  1104. "name": "32010071"
  1105. }, {
  1106. "id": "opts108I1t",
  1107. "name": "37010232"
  1108. }, {
  1109. "id": "opt8Jcy8iO",
  1110. "name": "301010011"
  1111. }, {
  1112. "id": "optnuCtAkh",
  1113. "name": "20010073"
  1114. }, {
  1115. "id": "optQicp1vd",
  1116. "name": "37010123"
  1117. }, {
  1118. "id": "optxvYXuoQ",
  1119. "name": "86030142"
  1120. }, {
  1121. "id": "optKpK2Y3l",
  1122. "name": "124070003"
  1123. }, {
  1124. "id": "opt9SMhGCV",
  1125. "name": "80080027"
  1126. }, {
  1127. "id": "opt0QMLyW0",
  1128. "name": "52010028"
  1129. }, {
  1130. "id": "optuqSm1K8",
  1131. "name": "78060011"
  1132. }, {
  1133. "id": "optN5leUyl",
  1134. "name": "37010127"
  1135. }, {
  1136. "id": "optfMNN6YX",
  1137. "name": "27010027"
  1138. }, {
  1139. "id": "optnLmC0dm",
  1140. "name": "32010029"
  1141. }, {
  1142. "id": "optWW7T4Lj",
  1143. "name": "37010345"
  1144. }, {
  1145. "id": "optXTeaCBw",
  1146. "name": "50010013"
  1147. }, {
  1148. "id": "opt0BWDUXE",
  1149. "name": "126010001"
  1150. }, {
  1151. "id": "optCByVwts",
  1152. "name": "37010346"
  1153. }, {
  1154. "id": "optrThaJAH",
  1155. "name": "常州06080007"
  1156. }, {
  1157. "id": "optuQQ4d4Q",
  1158. "name": "38010001"
  1159. }, {
  1160. "id": "optIFyg444",
  1161. "name": "86050136"
  1162. }, {
  1163. "id": "optKlKEI8S",
  1164. "name": "72010202"
  1165. }, {
  1166. "id": "optIEaT8A5",
  1167. "name": "110010063"
  1168. }, {
  1169. "id": "optOQcMTdR",
  1170. "name": "37070347"
  1171. }, {
  1172. "id": "optfJwaRGt",
  1173. "name": "37010348"
  1174. }, {
  1175. "id": "optVnsUM9g",
  1176. "name": "20010076"
  1177. }, {
  1178. "id": "optDHalZA4",
  1179. "name": "37010349"
  1180. }, {
  1181. "id": "optzcA91rk",
  1182. "name": "126010002"
  1183. }, {
  1184. "id": "optrHuogIc",
  1185. "name": "35010019"
  1186. }, {
  1187. "id": "optmpWcfzo",
  1188. "name": "52010029"
  1189. }, {
  1190. "id": "optNHer42k",
  1191. "name": "66030034"
  1192. }, {
  1193. "id": "optdlQmLEE",
  1194. "name": "123010005"
  1195. }, {
  1196. "id": "optLN6TSRZ",
  1197. "name": "35010017"
  1198. }, {
  1199. "id": "optYEMCc09",
  1200. "name": "72010209"
  1201. }, {
  1202. "id": "optnkpWAf3",
  1203. "name": "20010137"
  1204. }, {
  1205. "id": "optFRCDOHR",
  1206. "name": "常州01030120"
  1207. }, {
  1208. "id": "optX0SSHyw",
  1209. "name": "86030143"
  1210. }, {
  1211. "id": "optNRiIs1j",
  1212. "name": "37010350"
  1213. }, {
  1214. "id": "optUjDbY9K",
  1215. "name": "86010144"
  1216. }, {
  1217. "id": "optn8ich2d",
  1218. "name": "61010040"
  1219. }, {
  1220. "id": "opteQQtW52",
  1221. "name": "90040019"
  1222. }, {
  1223. "id": "optszm7N4q",
  1224. "name": "37010351"
  1225. }, {
  1226. "id": "optGwledsv",
  1227. "name": "66030035"
  1228. }, {
  1229. "id": "optPt0pW5u",
  1230. "name": "61010056"
  1231. }, {
  1232. "id": "optWOaupUR",
  1233. "name": "112050032"
  1234. }, {
  1235. "id": "optoRVfHD4",
  1236. "name": "82010028"
  1237. }, {
  1238. "id": "optGDv0zTP",
  1239. "name": "72010115"
  1240. }, {
  1241. "id": "optB2UQdFn",
  1242. "name": "94030076"
  1243. }, {
  1244. "id": "optee3XkkT",
  1245. "name": "110010064"
  1246. }, {
  1247. "id": "optSUGKlXg",
  1248. "name": "79070170"
  1249. }, {
  1250. "id": "optapPGTOu",
  1251. "name": "31070006"
  1252. }, {
  1253. "id": "opt7MWXbnf",
  1254. "name": "50010033"
  1255. }, {
  1256. "id": "optjSMtWuo",
  1257. "name": "66010036"
  1258. }, {
  1259. "id": "opt7Qjokwx",
  1260. "name": "86010145"
  1261. }, {
  1262. "id": "optRC8nz4A",
  1263. "name": "55010018"
  1264. }, {
  1265. "id": "optJcB9duc",
  1266. "name": "61010074"
  1267. }, {
  1268. "id": "optBjhkFAj",
  1269. "name": "20010138"
  1270. }, {
  1271. "id": "optKjLgzMc",
  1272. "name": "110010031"
  1273. }, {
  1274. "id": "opt3hoJVyW",
  1275. "name": "72010234"
  1276. }, {
  1277. "id": "optRUBPj40",
  1278. "name": "79010171"
  1279. }, {
  1280. "id": "optoi9RDqC",
  1281. "name": "常州04080014"
  1282. }, {
  1283. "id": "optXt9SR3v",
  1284. "name": "94010070"
  1285. }, {
  1286. "id": "optvAKytjF",
  1287. "name": "37010352"
  1288. }, {
  1289. "id": "optFYaMWwC",
  1290. "name": "10070010"
  1291. }, {
  1292. "id": "optoWES6nx",
  1293. "name": "86030877"
  1294. }, {
  1295. "id": "optJefog2D",
  1296. "name": "52040004"
  1297. }, {
  1298. "id": "optQomOxGm",
  1299. "name": "99010001"
  1300. }, {
  1301. "id": "optsEb9Z7a",
  1302. "name": "110010065"
  1303. }, {
  1304. "id": "opt73FJKEl",
  1305. "name": "79010119"
  1306. }, {
  1307. "id": "optJO64N1I",
  1308. "name": "84010003"
  1309. }, {
  1310. "id": "optJpt3BrS",
  1311. "name": "84010004"
  1312. }, {
  1313. "id": "opty6yJV2y",
  1314. "name": "84010005"
  1315. }, {
  1316. "id": "opt8rfqzHJ",
  1317. "name": "84060001"
  1318. }, {
  1319. "id": "optXHRejgx",
  1320. "name": "84010006"
  1321. }, {
  1322. "id": "optZENW4Ec",
  1323. "name": "84010007"
  1324. }, {
  1325. "id": "optHZARh3T",
  1326. "name": "55010019"
  1327. }, {
  1328. "id": "opt3YNAoO4",
  1329. "name": "80010113"
  1330. }, {
  1331. "id": "optboi4jG4",
  1332. "name": "110010066"
  1333. }, {
  1334. "id": "optsxwb9uV",
  1335. "name": "79080151"
  1336. }, {
  1337. "id": "optRub6nSG",
  1338. "name": "84010008"
  1339. }, {
  1340. "id": "opty3GXSYy",
  1341. "name": "84010009"
  1342. }, {
  1343. "id": "optBKEfzsr",
  1344. "name": "37010105"
  1345. }, {
  1346. "id": "optI3K0fKv",
  1347. "name": "95010010"
  1348. }, {
  1349. "id": "optmvgoCDv",
  1350. "name": "84010010"
  1351. }, {
  1352. "id": "optuCccgTp",
  1353. "name": "33010001"
  1354. }, {
  1355. "id": "optSyDHvNn",
  1356. "name": "110010067"
  1357. }, {
  1358. "id": "opt9QMlB8B",
  1359. "name": "61010119"
  1360. }, {
  1361. "id": "optwiSBzio",
  1362. "name": "79080154"
  1363. }, {
  1364. "id": "optbUq8Kug",
  1365. "name": "84010011"
  1366. }, {
  1367. "id": "opt308mW6a",
  1368. "name": "110010068"
  1369. }, {
  1370. "id": "optBV8u5OH",
  1371. "name": "84010012"
  1372. }, {
  1373. "id": "optrPNPdM9",
  1374. "name": "112030033"
  1375. }, {
  1376. "id": "optCYZ0bpF",
  1377. "name": "84010013"
  1378. }, {
  1379. "id": "optSKUvXl4",
  1380. "name": "84010014"
  1381. }, {
  1382. "id": "optnL2tWtV",
  1383. "name": "112030034"
  1384. }, {
  1385. "id": "opt20Q9lJh",
  1386. "name": "69010007"
  1387. }, {
  1388. "id": "optI5zBEGH",
  1389. "name": "37010170"
  1390. }, {
  1391. "id": "optC6dJSPa",
  1392. "name": "98010016"
  1393. }, {
  1394. "id": "optxYvmGs4",
  1395. "name": "84010015"
  1396. }, {
  1397. "id": "optVnt8lnt",
  1398. "name": "84010016"
  1399. }, {
  1400. "id": "optfQqC69k",
  1401. "name": "80010114"
  1402. }, {
  1403. "id": "optHFKLlEB",
  1404. "name": "84010017"
  1405. }, {
  1406. "id": "optdenCz0O",
  1407. "name": "37010353"
  1408. }, {
  1409. "id": "optG4CHv5t",
  1410. "name": "66010037"
  1411. }, {
  1412. "id": "optP62go89",
  1413. "name": "110010069"
  1414. }, {
  1415. "id": "optint7rru",
  1416. "name": "112030035"
  1417. }, {
  1418. "id": "optV6yV0Ha",
  1419. "name": "66010038"
  1420. }, {
  1421. "id": "optffH2X63",
  1422. "name": "94010063"
  1423. }, {
  1424. "id": "optJCrOefS",
  1425. "name": "84010018"
  1426. }, {
  1427. "id": "optgqwsm07",
  1428. "name": "37010354"
  1429. }, {
  1430. "id": "opt4dzcFQy",
  1431. "name": "37010355"
  1432. }, {
  1433. "id": "optqR3Hebh",
  1434. "name": "78050028"
  1435. }, {
  1436. "id": "optsRj7Vrx",
  1437. "name": "38010021"
  1438. }, {
  1439. "id": "optkDY08Xw",
  1440. "name": "37010356"
  1441. }, {
  1442. "id": "optba8eFOW",
  1443. "name": "76010016"
  1444. }, {
  1445. "id": "optougf2x4",
  1446. "name": "37010357"
  1447. }, {
  1448. "id": "optpPJeWS4",
  1449. "name": "84010019"
  1450. }, {
  1451. "id": "optfIeW2JZ",
  1452. "name": "常州01070121"
  1453. }, {
  1454. "id": "optuKNP6d6",
  1455. "name": "常州01030122"
  1456. }, {
  1457. "id": "optq52TspK",
  1458. "name": "20030001"
  1459. }, {
  1460. "id": "optdTUXkoy",
  1461. "name": "86010146"
  1462. }, {
  1463. "id": "optpI0m4dL",
  1464. "name": "37010358"
  1465. }, {
  1466. "id": "opteY5O2r7",
  1467. "name": "86050131"
  1468. }, {
  1469. "id": "opt3LYmZRB",
  1470. "name": "89010017"
  1471. }, {
  1472. "id": "opt1XjtNIx",
  1473. "name": "84010020"
  1474. }, {
  1475. "id": "optMVE41er",
  1476. "name": "84010021"
  1477. }, {
  1478. "id": "optosmRU04",
  1479. "name": "52010030"
  1480. }, {
  1481. "id": "optrUBqwRr",
  1482. "name": "37010359"
  1483. }, {
  1484. "id": "optl3IyGo0",
  1485. "name": "84010022"
  1486. }, {
  1487. "id": "opt5hrbEwN",
  1488. "name": "52010031"
  1489. }, {
  1490. "id": "optT3NxVKR",
  1491. "name": "37010215"
  1492. }, {
  1493. "id": "optmrFmrf8",
  1494. "name": "84010023"
  1495. }, {
  1496. "id": "optyF4Wwrk",
  1497. "name": "79070072"
  1498. }, {
  1499. "id": "optgZXt7Ho",
  1500. "name": "127010001"
  1501. }, {
  1502. "id": "opt3S3maUI",
  1503. "name": "20010139"
  1504. }, {
  1505. "id": "opttOwoaJ5",
  1506. "name": "123010006"
  1507. }, {
  1508. "id": "opt5vgLSiI",
  1509. "name": "127010002"
  1510. }, {
  1511. "id": "optH5BTcVw",
  1512. "name": "103010003"
  1513. }, {
  1514. "id": "optSFxQ6aj",
  1515. "name": "常州01030123"
  1516. }, {
  1517. "id": "optEatGesh",
  1518. "name": "72010235"
  1519. }, {
  1520. "id": "optn5k61l4",
  1521. "name": "37010360"
  1522. }, {
  1523. "id": "optebaGnU5",
  1524. "name": "常州01050124"
  1525. }, {
  1526. "id": "optKDtHm70",
  1527. "name": "37010186"
  1528. }, {
  1529. "id": "optUDhDzFr",
  1530. "name": "126080002"
  1531. }, {
  1532. "id": "optRkUm4RH",
  1533. "name": "32010178"
  1534. }, {
  1535. "id": "optzhgpIDI",
  1536. "name": "126080003"
  1537. }, {
  1538. "id": "optxoU3C22",
  1539. "name": "94010077"
  1540. }, {
  1541. "id": "opt22nJfpw",
  1542. "name": "80010115"
  1543. }, {
  1544. "id": "optTZRFzyU",
  1545. "name": "80010100"
  1546. }, {
  1547. "id": "optb6l4EtN",
  1548. "name": "82010078"
  1549. }, {
  1550. "id": "opt1id2YpW",
  1551. "name": "37010361"
  1552. }, {
  1553. "id": "optXZdeaR2",
  1554. "name": "常州01050125"
  1555. }, {
  1556. "id": "optgW4IMtn",
  1557. "name": "128010001"
  1558. }, {
  1559. "id": "optmPcKQYa",
  1560. "name": "常州01030126"
  1561. }, {
  1562. "id": "optlYZT4ux",
  1563. "name": "50010068"
  1564. }, {
  1565. "id": "optJjDIEbu",
  1566. "name": "86050114"
  1567. }, {
  1568. "id": "optmHq6cmu",
  1569. "name": "122010003"
  1570. }, {
  1571. "id": "opt4hbNqTC",
  1572. "name": "84010024"
  1573. }, {
  1574. "id": "optmqDgpbU",
  1575. "name": "127010003"
  1576. }, {
  1577. "id": "opt9ZjT2QA",
  1578. "name": "37010362"
  1579. }, {
  1580. "id": "optRUPph7q",
  1581. "name": "37010363"
  1582. }, {
  1583. "id": "opt2XpRj93",
  1584. "name": "66010039"
  1585. }, {
  1586. "id": "optuqoQXOd",
  1587. "name": "84010025"
  1588. }, {
  1589. "id": "opti49hWLq",
  1590. "name": "84010026"
  1591. }, {
  1592. "id": "optjojtoPp",
  1593. "name": "55010020"
  1594. }, {
  1595. "id": "optDOQoVyv",
  1596. "name": "112010036"
  1597. }, {
  1598. "id": "optsgFcpJ1",
  1599. "name": "常州01010127"
  1600. }, {
  1601. "id": "opt0K3Pnic",
  1602. "name": "常州01070128"
  1603. }, {
  1604. "id": "optH3vLNeR",
  1605. "name": "72010142"
  1606. }, {
  1607. "id": "optWs8J54I",
  1608. "name": "110070070"
  1609. }, {
  1610. "id": "optCUviEyZ",
  1611. "name": "89010019"
  1612. }, {
  1613. "id": "opt9YBDR3B",
  1614. "name": "110010071"
  1615. }, {
  1616. "id": "optmaWqlni",
  1617. "name": "84010027"
  1618. }, {
  1619. "id": "opt8W2hPKo",
  1620. "name": "37050364"
  1621. }, {
  1622. "id": "optfdPZPvt",
  1623. "name": "38010041"
  1624. }, {
  1625. "id": "optoNxXwGB",
  1626. "name": "94010078"
  1627. }, {
  1628. "id": "opt2dRMdCH",
  1629. "name": "84010028"
  1630. }, {
  1631. "id": "optkvoa6oe",
  1632. "name": "常州01080129"
  1633. }, {
  1634. "id": "optdVBK32x",
  1635. "name": "110050072"
  1636. }, {
  1637. "id": "optELWn9lC",
  1638. "name": "79080148"
  1639. }, {
  1640. "id": "opt1285720668",
  1641. "name": "学雅思网"
  1642. }, {
  1643. "id": "optXK5GQCw",
  1644. "name": "79010173"
  1645. }, {
  1646. "id": "optuhjNTP4",
  1647. "name": "常州01080085"
  1648. }, {
  1649. "id": "optPcdusJK",
  1650. "name": "常州01080130"
  1651. }, {
  1652. "id": "optCnXfQoO",
  1653. "name": "29010004"
  1654. }, {
  1655. "id": "optIAF7uop",
  1656. "name": "86010147"
  1657. }, {
  1658. "id": "optbxT8a22",
  1659. "name": "86010148"
  1660. }, {
  1661. "id": "optBKEZGxV",
  1662. "name": "常州02080042"
  1663. }, {
  1664. "id": "opt82CopOX",
  1665. "name": "37010365"
  1666. }, {
  1667. "id": "optjllXBCm",
  1668. "name": "66010040"
  1669. }, {
  1670. "id": "optboLfbo5",
  1671. "name": "66010041"
  1672. }, {
  1673. "id": "optMD9OIyF",
  1674. "name": "129010001"
  1675. }, {
  1676. "id": "optPmonvMt",
  1677. "name": "常州04080025"
  1678. }, {
  1679. "id": "opts3XkkLt",
  1680. "name": "127010004"
  1681. }, {
  1682. "id": "optVpK1iNu",
  1683. "name": "84010029"
  1684. }, {
  1685. "id": "optEfAYNP0",
  1686. "name": "61010176"
  1687. }, {
  1688. "id": "optsfgK3aQ",
  1689. "name": "66010042"
  1690. }, {
  1691. "id": "optYQ1WHWx",
  1692. "name": "常州01070130"
  1693. }, {
  1694. "id": "optXzdrBPT",
  1695. "name": "常州01070131"
  1696. }, {
  1697. "id": "optk3ZYoUA",
  1698. "name": "19070001"
  1699. }, {
  1700. "id": "optCTJ7KeT",
  1701. "name": "84010030"
  1702. }, {
  1703. "id": "optPaOv5un",
  1704. "name": "84010031"
  1705. }, {
  1706. "id": "optQIoTwZy",
  1707. "name": "130010001"
  1708. }, {
  1709. "id": "optep1w6TG",
  1710. "name": "130010002"
  1711. }, {
  1712. "id": "optaZ6MVjA",
  1713. "name": "130010003"
  1714. }, {
  1715. "id": "optUsgsf5p",
  1716. "name": "79010174"
  1717. }, {
  1718. "id": "optUlrZtGb",
  1719. "name": "110010073"
  1720. }, {
  1721. "id": "optMDlLA6P",
  1722. "name": "常州01080132"
  1723. }, {
  1724. "id": "optJrjrkry",
  1725. "name": "130010004"
  1726. }, {
  1727. "id": "optdYAT6GL",
  1728. "name": "130010005"
  1729. }, {
  1730. "id": "optsdei4oR",
  1731. "name": "131010001"
  1732. }, {
  1733. "id": "optORnPM6O",
  1734. "name": "130010006"
  1735. }, {
  1736. "id": "optq4v5Vqn",
  1737. "name": "126010004"
  1738. }, {
  1739. "id": "optkB4FhvX",
  1740. "name": "130010007"
  1741. }, {
  1742. "id": "optkIbsg6R",
  1743. "name": "37010366"
  1744. }, {
  1745. "id": "optSuK825p",
  1746. "name": "84010032"
  1747. }, {
  1748. "id": "opt1wnnwlF",
  1749. "name": "55040021"
  1750. }, {
  1751. "id": "optGZCwiK3",
  1752. "name": "52010032"
  1753. }, {
  1754. "id": "optOZwIB1K",
  1755. "name": "66010043"
  1756. }, {
  1757. "id": "opto4d05oc",
  1758. "name": "37010367"
  1759. }, {
  1760. "id": "optpdDP96y",
  1761. "name": "99010024"
  1762. }, {
  1763. "id": "opt9Bhbsze",
  1764. "name": "37010368"
  1765. }, {
  1766. "id": "opttelQRFt",
  1767. "name": "132010001"
  1768. }, {
  1769. "id": "optavXqB8G",
  1770. "name": "50010101"
  1771. }, {
  1772. "id": "opthXax1KY",
  1773. "name": "130010008"
  1774. }, {
  1775. "id": "optH0bkpS1",
  1776. "name": "86050129"
  1777. }, {
  1778. "id": "optgnJiyHa",
  1779. "name": "129010002"
  1780. }, {
  1781. "id": "optlcoiTuM",
  1782. "name": "86010149"
  1783. }, {
  1784. "id": "optBWgQy7M",
  1785. "name": "130010009"
  1786. }, {
  1787. "id": "optOUHu7rd",
  1788. "name": "72030236"
  1789. }, {
  1790. "id": "optVr305S2",
  1791. "name": "126010005"
  1792. }, {
  1793. "id": "opt2n4s9dX",
  1794. "name": "94010079"
  1795. }, {
  1796. "id": "optLqf2TWH",
  1797. "name": "94010080"
  1798. }, {
  1799. "id": "optKnVnmyt",
  1800. "name": "94010081"
  1801. }, {
  1802. "id": "optTyHEoNP",
  1803. "name": "37070369"
  1804. }, {
  1805. "id": "optW91zT4z",
  1806. "name": "127010005"
  1807. }, {
  1808. "id": "optV15qsK0",
  1809. "name": "126010006"
  1810. }, {
  1811. "id": "optKpqB4hi",
  1812. "name": "37010159"
  1813. }, {
  1814. "id": "optg1bGZIs",
  1815. "name": "86050128"
  1816. }, {
  1817. "id": "optGsBbMZG",
  1818. "name": "常州01080133"
  1819. }, {
  1820. "id": "optYZwxK1b",
  1821. "name": "110010074"
  1822. }, {
  1823. "id": "optQyqBz0i",
  1824. "name": "20010140"
  1825. }, {
  1826. "id": "optqtd5NCa",
  1827. "name": "94010082"
  1828. }, {
  1829. "id": "optffGYFG2",
  1830. "name": "133010001"
  1831. }, {
  1832. "id": "opt0Tgt7Vy",
  1833. "name": "133010002"
  1834. }, {
  1835. "id": "optXSg8z14",
  1836. "name": "20010105"
  1837. }, {
  1838. "id": "opt6XYvNuF",
  1839. "name": "80010074"
  1840. }, {
  1841. "id": "optRlP4Ygy",
  1842. "name": "66010044"
  1843. }, {
  1844. "id": "optJQWgP35",
  1845. "name": "常州05050046"
  1846. }, {
  1847. "id": "opt5ZI2l9u",
  1848. "name": "常州05050047"
  1849. }, {
  1850. "id": "optACnWPjC",
  1851. "name": "84010033"
  1852. }, {
  1853. "id": "optP5XY3yR",
  1854. "name": "66010045"
  1855. }, {
  1856. "id": "optKQ2AiD7",
  1857. "name": "66010046"
  1858. }, {
  1859. "id": "optt2IU4IP",
  1860. "name": "20010106"
  1861. }, {
  1862. "id": "optlbK4aOk",
  1863. "name": "86010150"
  1864. }, {
  1865. "id": "optAyWhYo1",
  1866. "name": "94010083"
  1867. }, {
  1868. "id": "optHfJWDS7",
  1869. "name": "79060175"
  1870. }, {
  1871. "id": "opt4o9mC1i",
  1872. "name": "79010176"
  1873. }, {
  1874. "id": "optGZcAxal",
  1875. "name": "130010012"
  1876. }, {
  1877. "id": "optWp1ehwC",
  1878. "name": "130010011"
  1879. }, {
  1880. "id": "opt6vVwtkO",
  1881. "name": "86050132"
  1882. }, {
  1883. "id": "optXrs72iR",
  1884. "name": "37010369"
  1885. }, {
  1886. "id": "optQDvY7Zn",
  1887. "name": "66010047"
  1888. }, {
  1889. "id": "optuDK6bvg",
  1890. "name": "80010106"
  1891. }, {
  1892. "id": "optMniKJ69",
  1893. "name": "55010022"
  1894. }, {
  1895. "id": "optxVLaUJz",
  1896. "name": "79010177"
  1897. }, {
  1898. "id": "optG9lQsZg",
  1899. "name": "66010048"
  1900. }, {
  1901. "id": "optpX4CaKz",
  1902. "name": "20010141"
  1903. }, {
  1904. "id": "optahTxDHk",
  1905. "name": "94010084"
  1906. }, {
  1907. "id": "optGOOAOpp",
  1908. "name": "130010013"
  1909. }, {
  1910. "id": "optOUcfe7r",
  1911. "name": "常州01070134"
  1912. }, {
  1913. "id": "opt9sMySxb",
  1914. "name": "134010001"
  1915. }, {
  1916. "id": "optCEzD46z",
  1917. "name": "130010014"
  1918. }, {
  1919. "id": "optGXsobSm",
  1920. "name": "98010017"
  1921. }, {
  1922. "id": "optc3kqlcl",
  1923. "name": "常州01030135"
  1924. }, {
  1925. "id": "optND1VqXc",
  1926. "name": "常州01070136"
  1927. }, {
  1928. "id": "optm4yeL8O",
  1929. "name": "86010151"
  1930. }, {
  1931. "id": "opt1ihJvJ3",
  1932. "name": "134010002"
  1933. }, {
  1934. "id": "optkX0Zxc9",
  1935. "name": "126010007"
  1936. }, {
  1937. "id": "optvfe9Vs9",
  1938. "name": "37070370"
  1939. }, {
  1940. "id": "optKyA8VXy",
  1941. "name": "94010085"
  1942. }, {
  1943. "id": "optsiGdh4M",
  1944. "name": "79060178"
  1945. }, {
  1946. "id": "optyKP5BJX",
  1947. "name": "122010004"
  1948. }, {
  1949. "id": "optFt7busK",
  1950. "name": "54010016"
  1951. }, {
  1952. "id": "optQNiwQbN",
  1953. "name": "66010049"
  1954. }, {
  1955. "id": "optU81DGKw",
  1956. "name": "130010015"
  1957. }, {
  1958. "id": "optl9tUOSa",
  1959. "name": "50010184"
  1960. }, {
  1961. "id": "optV1cZKCo",
  1962. "name": "20010142"
  1963. }, {
  1964. "id": "optargXKeE",
  1965. "name": "126010008"
  1966. }, {
  1967. "id": "optXyTchWs",
  1968. "name": "86050098"
  1969. }, {
  1970. "id": "optdtlwS3G",
  1971. "name": "20010109"
  1972. }, {
  1973. "id": "optClTpepv",
  1974. "name": "86010152"
  1975. }, {
  1976. "id": "opt7skfX3x",
  1977. "name": "37010371"
  1978. }, {
  1979. "id": "optchsnoHO",
  1980. "name": "135010001"
  1981. }, {
  1982. "id": "optG4ZGeQO",
  1983. "name": "66010050"
  1984. }, {
  1985. "id": "optk5gO5Bu",
  1986. "name": "126060009"
  1987. }, {
  1988. "id": "opt5A4LJC6",
  1989. "name": "86010153"
  1990. }, {
  1991. "id": "opt2DtQ5Uu",
  1992. "name": "126060010"
  1993. }, {
  1994. "id": "optiD2yqel",
  1995. "name": "136010001"
  1996. }, {
  1997. "id": "opt4ThV68K",
  1998. "name": "79010139"
  1999. }, {
  2000. "id": "optr7DOvIa",
  2001. "name": "72010237"
  2002. }, {
  2003. "id": "optzEHE4ss",
  2004. "name": "86010887"
  2005. }, {
  2006. "id": "opt09lT40O",
  2007. "name": "82010033"
  2008. }, {
  2009. "id": "optSnI23AU",
  2010. "name": "55080009"
  2011. }, {
  2012. "id": "optzoSyi6P",
  2013. "name": "127070006"
  2014. }, {
  2015. "id": "optv0Pskp2",
  2016. "name": "52070033"
  2017. }, {
  2018. "id": "optZCokTmO",
  2019. "name": "37010245"
  2020. }, {
  2021. "id": "optS6wmy3z",
  2022. "name": "126060011"
  2023. }, {
  2024. "id": "optry11hW2",
  2025. "name": "20010090"
  2026. }, {
  2027. "id": "opt0lBZu0R",
  2028. "name": "20010143"
  2029. }, {
  2030. "id": "optGa3t8Rg",
  2031. "name": "130010016"
  2032. }, {
  2033. "id": "optrfHBPTA",
  2034. "name": "86050156"
  2035. }, {
  2036. "id": "optWNN7MRl",
  2037. "name": "20080144"
  2038. }, {
  2039. "id": "optTkRZuwk",
  2040. "name": "112070037"
  2041. }, {
  2042. "id": "optSbvaRtj",
  2043. "name": "52070034"
  2044. }, {
  2045. "id": "optTjkdojW",
  2046. "name": "61010101"
  2047. }, {
  2048. "id": "opt6rvLdYK",
  2049. "name": "72010017"
  2050. }, {
  2051. "id": "optmI0puuz",
  2052. "name": "84010034"
  2053. }, {
  2054. "id": "optQUVxUen",
  2055. "name": "79060179"
  2056. }, {
  2057. "id": "optSNmpZh8",
  2058. "name": "110010075"
  2059. }, {
  2060. "id": "optl8PJbbs",
  2061. "name": "常州05070048"
  2062. }, {
  2063. "id": "opt2eqsCgi",
  2064. "name": "137080013"
  2065. }, {
  2066. "id": "optqokB94d",
  2067. "name": "37010153"
  2068. }, {
  2069. "id": "opttOuI6jm",
  2070. "name": "110010076"
  2071. }, {
  2072. "id": "optxnkFn15",
  2073. "name": "79060180"
  2074. }, {
  2075. "id": "optYTbVT0Z",
  2076. "name": "20010144"
  2077. }, {
  2078. "id": "opt9abQItt",
  2079. "name": "20010145"
  2080. }, {
  2081. "id": "optZ7G8URR",
  2082. "name": "86010154"
  2083. }, {
  2084. "id": "optAc4pOGX",
  2085. "name": "134010003"
  2086. }, {
  2087. "id": "opt7DMmcKv",
  2088. "name": "126060012"
  2089. }, {
  2090. "id": "optvwlaGOc",
  2091. "name": "110010077"
  2092. }, {
  2093. "id": "optfm7ae1r",
  2094. "name": "66010052"
  2095. }, {
  2096. "id": "optKmYdu87",
  2097. "name": "66010051"
  2098. }, {
  2099. "id": "opt0k6XfsT",
  2100. "name": "37010178"
  2101. }, {
  2102. "id": "opttFBKjqo",
  2103. "name": "138010001"
  2104. }, {
  2105. "id": "optC0S5yry",
  2106. "name": "139010001"
  2107. }, {
  2108. "id": "opt8NIUnuR",
  2109. "name": "37010372"
  2110. }, {
  2111. "id": "optCkoRFPf",
  2112. "name": "80010116"
  2113. }, {
  2114. "id": "optXtsyxWY",
  2115. "name": "110010078"
  2116. }, {
  2117. "id": "optrcnkNBV",
  2118. "name": "37010373"
  2119. }, {
  2120. "id": "optP4Dy2IB",
  2121. "name": "常州01010137"
  2122. }, {
  2123. "id": "optDlXSCHN",
  2124. "name": "127080007"
  2125. }, {
  2126. "id": "optp5CcFO6",
  2127. "name": "86010155"
  2128. }, {
  2129. "id": "opto8abzlx",
  2130. "name": "20030146"
  2131. }, {
  2132. "id": "optmSVjeAj",
  2133. "name": "37070374"
  2134. }, {
  2135. "id": "opt5ibhzde",
  2136. "name": "110010079"
  2137. }, {
  2138. "id": "optscJyzAl",
  2139. "name": "126040013"
  2140. }, {
  2141. "id": "optOEw3hjp",
  2142. "name": "140010001"
  2143. }, {
  2144. "id": "opt1hGVA4y",
  2145. "name": "140010002"
  2146. }, {
  2147. "id": "optpsm7QIF",
  2148. "name": "124070004"
  2149. }, {
  2150. "id": "optT9raf3g",
  2151. "name": "127080008"
  2152. }, {
  2153. "id": "optQ0o8w55",
  2154. "name": "126080014"
  2155. }, {
  2156. "id": "optcufNrXU",
  2157. "name": "79070181"
  2158. }, {
  2159. "id": "optxfxqQii",
  2160. "name": "140010003"
  2161. }, {
  2162. "id": "optzOt8NSq",
  2163. "name": "常州04080026"
  2164. }, {
  2165. "id": "optMkYwJof",
  2166. "name": "79070182"
  2167. }, {
  2168. "id": "optHGLH9ba",
  2169. "name": "140010004"
  2170. }, {
  2171. "id": "optFNGcVDp",
  2172. "name": "130010017"
  2173. }, {
  2174. "id": "optTA4j7b2",
  2175. "name": "84010035"
  2176. }, {
  2177. "id": "opt5jhUPQS",
  2178. "name": "12030008"
  2179. }, {
  2180. "id": "optJqQuwYl",
  2181. "name": "141010002"
  2182. }, {
  2183. "id": "optMfYIrDK",
  2184. "name": "141010001"
  2185. }, {
  2186. "id": "opth7YgiVA",
  2187. "name": "127010009"
  2188. }, {
  2189. "id": "optvKH357u",
  2190. "name": "141010003"
  2191. }, {
  2192. "id": "optMwyEG58",
  2193. "name": "20010147"
  2194. }, {
  2195. "id": "optMko4Gwo",
  2196. "name": "37010005"
  2197. }, {
  2198. "id": "optCBZfyhn",
  2199. "name": "20010148"
  2200. }, {
  2201. "id": "optz6gxJRp",
  2202. "name": "126070015"
  2203. }, {
  2204. "id": "optlgraFmJ",
  2205. "name": "139010004"
  2206. }, {
  2207. "id": "opt3YhS6iM",
  2208. "name": "139010003"
  2209. }, {
  2210. "id": "opt8E1r32N",
  2211. "name": "139010002"
  2212. }, {
  2213. "id": "optrXGWBzH",
  2214. "name": "126070016"
  2215. }, {
  2216. "id": "opt5yG3TXd",
  2217. "name": "20010149"
  2218. }, {
  2219. "id": "optush9dyF",
  2220. "name": "110070080"
  2221. }, {
  2222. "id": "optDuOFYnL",
  2223. "name": "66010053"
  2224. }, {
  2225. "id": "optMG2Oz1M",
  2226. "name": "84010036"
  2227. }, {
  2228. "id": "optAXkvCFZ",
  2229. "name": "92060024"
  2230. }, {
  2231. "id": "opt4CzxTOF",
  2232. "name": "84010037"
  2233. }, {
  2234. "id": "optqOO6gIa",
  2235. "name": "141010004"
  2236. }, {
  2237. "id": "opth2auwtN",
  2238. "name": "94010086"
  2239. }, {
  2240. "id": "optsqspwfo",
  2241. "name": "140010005"
  2242. }, {
  2243. "id": "optUZke8hR",
  2244. "name": "127010010"
  2245. }, {
  2246. "id": "optfmMEWOz",
  2247. "name": "84010038"
  2248. }, {
  2249. "id": "optz83PI4m",
  2250. "name": "128010005"
  2251. }, {
  2252. "id": "optEo1qqwN",
  2253. "name": "140010006"
  2254. }, {
  2255. "id": "optH45oOjh",
  2256. "name": "20010150"
  2257. }, {
  2258. "id": "optfj8CGrt",
  2259. "name": "110010081"
  2260. }, {
  2261. "id": "opto6RZCm9",
  2262. "name": "66010054"
  2263. }, {
  2264. "id": "optMK7PqA6",
  2265. "name": "130010018"
  2266. }
  2267. ]
  2268. # 将列表转换为字典以便快速查找
  2269. for item in channel_list:
  2270. channel_mapping[item["name"]] = item["id"]
  2271. # 特殊处理:默认渠道ID(你指定的)
  2272. DEFAULT_CHANNEL_ID = "optEkk65hv"
  2273. # 查找渠道代码对应的ID
  2274. channel_id = DEFAULT_CHANNEL_ID # 默认值
  2275. if channel_code:
  2276. # 精确匹配
  2277. if channel_code in channel_mapping:
  2278. channel_id = channel_mapping[channel_code]
  2279. self.log(f" 📌 渠道代码匹配: {channel_code} -> {channel_id}", "debug")
  2280. else:
  2281. self.log(f" ⚠️ 未找到渠道代码 {channel_code} 的映射,使用默认值", "warning")
  2282. else:
  2283. self.log(f" ℹ️ 渠道代码为空,使用默认值", "debug")
  2284. # ... (后面的代码保持不变)
  2285. # 处理意向学校:根据文本查找对应的ID
  2286. target_school_id = None
  2287. if target_school_text:
  2288. # 精确匹配
  2289. if target_school_text in school_mapping:
  2290. target_school_id = school_mapping[target_school_text]
  2291. self.log(f" 🏫 意向学校: {target_school_text} -> {target_school_id}", "debug")
  2292. else:
  2293. # 尝试模糊匹配(包含关系)
  2294. matched = False
  2295. for school_name, school_id in school_mapping.items():
  2296. if school_name in target_school_text or target_school_text in school_name:
  2297. target_school_id = school_id
  2298. matched = True
  2299. self.log(f" 🏫 意向学校模糊匹配: {target_school_text} -> {school_name} ({target_school_id})", "debug")
  2300. break
  2301. if not matched:
  2302. self.log(f" ⚠️ 未找到匹配的意向学校: {target_school_text}", "warning")
  2303. # 处理咨询项目:根据文本查找对应的ID(支持多选)
  2304. consulting_ids = []
  2305. if consulting_text:
  2306. # 如果是多个项目,用分隔符分割(如逗号、顿号等)
  2307. consulting_items = re.split(r'[,,、/ ]+', consulting_text)
  2308. for item in consulting_items:
  2309. item = item.strip()
  2310. if item:
  2311. if item in consulting_mapping:
  2312. consulting_ids.append(consulting_mapping[item])
  2313. self.log(f" 📚 咨询项目: {item} -> {consulting_mapping[item]}", "debug")
  2314. else:
  2315. # 尝试模糊匹配
  2316. matched = False
  2317. for consulting_name, consulting_id in consulting_mapping.items():
  2318. if consulting_name in item or item in consulting_name:
  2319. consulting_ids.append(consulting_id)
  2320. matched = True
  2321. self.log(f" 📚 咨询项目模糊匹配: {item} -> {consulting_name} ({consulting_id})", "debug")
  2322. break
  2323. if not matched:
  2324. self.log(f" ⚠️ 未找到匹配的咨询项目: {item}", "warning")
  2325. # 处理产品:根据文本查找对应的ID(支持多选)
  2326. product_ids = []
  2327. if product_text:
  2328. product_items = re.split(r'[,,、/ ]+', product_text)
  2329. for item in product_items:
  2330. item = item.strip()
  2331. if item:
  2332. if item in product_mapping:
  2333. product_ids.append(product_mapping[item])
  2334. self.log(f" 📦 产品: {item} -> {product_mapping[item]}", "debug")
  2335. else:
  2336. # 尝试模糊匹配(支持大小写不敏感)
  2337. matched = False
  2338. item_lower = item.lower()
  2339. for product_name, product_id in product_mapping.items():
  2340. # 支持大小写不敏感的匹配
  2341. if product_name.lower() == item_lower or product_name in item or item in product_name:
  2342. product_ids.append(product_id)
  2343. matched = True
  2344. self.log(f" 📦 产品模糊匹配: {item} -> {product_name} ({product_id})", "debug")
  2345. break
  2346. if not matched:
  2347. self.log(f" ⚠️ 未找到匹配的产品: {item}", "warning")
  2348. # 构建备注文本
  2349. remark_text = f"姓名:{name},性别:{gender},手机号码:{phone}"
  2350. if remark:
  2351. remark_text += f",{remark}"
  2352. # 构建data JSON
  2353. data_obj = {
  2354. "fld43Khnuw": {
  2355. "type": 1,
  2356. "value": [{"type": "text", "text": remark_text}]
  2357. },
  2358. "fldexDPwcE": {"type": 3, "value": "optmlZt00z"} if institution else {"type": 3},
  2359. # 意向学校 - 使用映射后的ID
  2360. "fldWt6JrgK": {"type": 3, "value": target_school_id} if target_school_id else {"type": 3},
  2361. # 咨询项目 - 使用映射后的ID列表(多选)
  2362. "fldirDDoLV": {"type": 4, "value": consulting_ids} if consulting_ids else {"type": 4},
  2363. # 语培产品 - 使用映射后的ID列表(多选)
  2364. "fldudfcNVO": {"type": 4, "value": product_ids} if product_ids else {"type": 4},
  2365. "fldS90QCXo": {"type": 1, "value": [{"type": "text", "text": name}]} if name else {"type": 1},
  2366. "fldsA4YdS6": {"type": 3},
  2367. "fldSSElgkA": {"type": 13, "value": {"fullPhoneNum": phone}} if phone else {"type": 13},
  2368. "fldZPL52gS": {"type": 1},
  2369. "fldPIaD4UH": {"type": 13},
  2370. "fldUGeDVDF": {"type": 13},
  2371. "fldKZ5WKyN": {"type": 1},
  2372. "fld0MHPEaW": {"type": 3},
  2373. "fldOLvk3zZ": {"type": 3},
  2374. "fldkSVVnuu": {"type": 1},
  2375. "fldCfRL3qM": {"type": 3, "value": "optTWIvAFb"} if source else {"type": 3},
  2376. "fldodpd0fR": {
  2377. "type": 11,
  2378. "value": {
  2379. "users": [{
  2380. "userId":"7664781110135589871",
  2381. "name":"王欣",
  2382. "avatarUrl":"https://s3-imfile.feishucdn.com/static-resource/v1/v3_0013q_44a1d366-78d6-4a4b-ad37-294ff4b5d55g~?image_size=72x72&cut_type=default-face&quality=&format=jpeg&sticker_format=.webp",
  2383. "enName":"王欣",
  2384. "notify":False,
  2385. }]
  2386. }
  2387. } if market_person else {"type": 11},
  2388. # ====== 渠道代码 - 使用映射后的ID ======
  2389. "flde7thxT7": {"type": 3, "value": channel_id},
  2390. "fldaxavu52": {"type": 3, "value": "optHsn4zKU"},
  2391. "fldMpwPaI1": {"type": 17} # 图片字段,默认空
  2392. }
  2393. # ========== 检查并处理图片 ==========
  2394. if self.image_cache and row_index in self.image_cache:
  2395. images = self.image_cache[row_index]
  2396. self.log(f" 🖼️ 检测到 {len(images)} 个嵌入图片在第 {row_index} 行", "info")
  2397. # 上传第一张图片
  2398. if images:
  2399. img_info = images[0]
  2400. # 检查是否已经上传过
  2401. if row_index in self.uploaded_cache:
  2402. img_value = self.uploaded_cache[row_index]
  2403. self.log(f" ♻️ 使用已上传的图片: {img_value.get('attachmentToken')}", "debug")
  2404. else:
  2405. # 上传图片
  2406. self.log(f" 📤 开始上传图片...", "info")
  2407. uploaded = self.upload_image(img_info['data'], img_info['filename'])
  2408. if uploaded:
  2409. self.uploaded_cache[row_index] = uploaded
  2410. img_value = uploaded
  2411. self.log(f" ✅ 图片上传成功,token: {uploaded.get('attachmentToken')}", "success")
  2412. else:
  2413. self.log(f" ⚠️ 图片上传失败,跳过该图片", "warning")
  2414. img_value = None
  2415. # 如果上传成功,添加到data_obj
  2416. if img_value:
  2417. data_obj["fldMpwPaI1"] = {
  2418. "type": 17,
  2419. "value": [img_value]
  2420. }
  2421. self.log(f" 📎 图片已添加到请求中", "debug")
  2422. else:
  2423. # 没有图片,确保图片字段为空
  2424. data_obj["fldMpwPaI1"] = {"type": 17}
  2425. # 构建完整的请求体
  2426. body = {
  2427. "shareToken": self.share_token,
  2428. "data": json.dumps(data_obj, ensure_ascii=False),
  2429. "preUploadEnable": True
  2430. }
  2431. return body
  2432. except Exception as e:
  2433. self.log(f"构建请求体失败: {str(e)}", "error")
  2434. import traceback
  2435. self.log(f"详细错误: {traceback.format_exc()}", "debug")
  2436. return None
  2437. def send_request(self, row_data, row_index):
  2438. """发送单条请求"""
  2439. try:
  2440. self.log(f"\n{'='*50}", "info")
  2441. self.log(f"📤 准备发送第 {row_index} 行数据", "info")
  2442. cookie_string = self.cookie_text.get(1.0, tk.END).strip()
  2443. if not cookie_string:
  2444. self.log("❌ Cookie为空,请先配置Cookie", "error")
  2445. return False, "Cookie为空"
  2446. # 构建请求体
  2447. body = self.build_request_body(row_data, row_index)
  2448. if body is None:
  2449. self.log("❌ 构建请求体失败", "error")
  2450. return False, "构建请求体失败"
  2451. # 记录请求体大小
  2452. body_str = json.dumps(body, ensure_ascii=False)
  2453. self.log(f"📦 请求体大小: {len(body_str)} 字节", "debug")
  2454. # 准备请求
  2455. headers = self.default_headers.copy()
  2456. cookies = self.parse_cookie(cookie_string)
  2457. # 更新动态头
  2458. headers["x-csrftoken"] = self._get_csrf_token()
  2459. headers["f-version"] = "docs-6-17-1781628518399"
  2460. self.log(f"🌐 发送请求到: {self.url}", "debug")
  2461. # 发送请求
  2462. response = requests.post(
  2463. self.url,
  2464. headers=headers,
  2465. cookies=cookies,
  2466. json=body,
  2467. timeout=30
  2468. )
  2469. self.log(f"📡 响应状态码: {response.status_code}", "debug")
  2470. # 解析响应
  2471. try:
  2472. resp_data = response.json()
  2473. resp_text = json.dumps(resp_data, ensure_ascii=False, indent=2)
  2474. if isinstance(resp_data, dict):
  2475. if resp_data.get('code') != 0 and resp_data.get('code') is not None:
  2476. self.log(f"⚠️ 服务器返回错误码: {resp_data.get('code')}", "warning")
  2477. self.log(f" 错误信息: {resp_data.get('msg', '未知错误')}", "error")
  2478. if 'data' in resp_data:
  2479. self.log(f" 📊 响应数据: {json.dumps(resp_data['data'], ensure_ascii=False)[:200]}...", "debug")
  2480. except:
  2481. resp_text = response.text
  2482. self.log("⚠️ 响应不是有效的JSON格式", "warning")
  2483. if response.status_code == 200:
  2484. self.log(f"✅ 第{row_index}行 发送成功", "success")
  2485. return True, resp_text
  2486. else:
  2487. self.log(f"❌ 第{row_index}行 发送失败 (HTTP {response.status_code})", "error")
  2488. self.log(f" 响应内容: {resp_text[:500]}...", "error")
  2489. return False, resp_text
  2490. except requests.exceptions.Timeout:
  2491. self.log(f"⏱️ 第{row_index}行 请求超时", "error")
  2492. return False, "请求超时"
  2493. except requests.exceptions.ConnectionError:
  2494. self.log(f"🔌 第{row_index}行 连接失败,请检查网络", "error")
  2495. return False, "连接失败"
  2496. except Exception as e:
  2497. self.log(f"💥 第{row_index}行 异常: {str(e)}", "error")
  2498. import traceback
  2499. self.log(f"详细错误: {traceback.format_exc()}", "debug")
  2500. return False, str(e)
  2501. finally:
  2502. self.log(f"{'='*50}\n", "info")
  2503. def send_all(self):
  2504. """发送所有数据的主循环"""
  2505. try:
  2506. excel_file = self.file_path_var.get()
  2507. sheet_name = self.sheet_var.get()
  2508. min_interval = float(self.min_interval_var.get())
  2509. max_interval = float(self.max_interval_var.get())
  2510. start_row = int(self.start_row_var.get()) - 1
  2511. if not excel_file:
  2512. self.log("❌ 请先选择Excel文件", "error")
  2513. self.status_var.set("❌ 请先选择Excel文件")
  2514. return
  2515. # 清空上次上传缓存
  2516. self.uploaded_cache = {}
  2517. # ========== 自动提取所有图片到缓存 ==========
  2518. self.log(f"🔍 正在自动提取Excel中的嵌入图片...", "info")
  2519. self.image_cache = self.extract_images_to_cache(excel_file, sheet_name)
  2520. if self.image_cache:
  2521. total_images = sum(len(imgs) for imgs in self.image_cache.values())
  2522. self.log(f"📊 共提取 {total_images} 张图片,分布在 {len(self.image_cache)} 行", "info")
  2523. rows_with_images = sorted(self.image_cache.keys())
  2524. if len(rows_with_images) <= 20:
  2525. self.log(f"📋 有图片的行: {rows_with_images}", "debug")
  2526. else:
  2527. self.log(f"📋 有图片的行: {rows_with_images[:20]} ... (共{len(rows_with_images)}行)", "debug")
  2528. else:
  2529. self.log(f"📷 未检测到任何嵌入图片", "info")
  2530. # ========== 读取Excel数据 ==========
  2531. try:
  2532. df = pd.read_excel(excel_file, sheet_name=sheet_name)
  2533. self.log(f"📊 成功读取Excel: {len(df)} 行数据", "info")
  2534. self.log(f"📋 列名: {', '.join(df.columns.tolist())}", "info")
  2535. except Exception as e:
  2536. self.log(f"❌ 读取Excel失败: {str(e)}", "error")
  2537. self.status_var.set(f"❌ 读取失败: {str(e)}")
  2538. return
  2539. if len(df) == 0:
  2540. self.log("⚠️ Excel中没有数据", "warning")
  2541. self.status_var.set("⚠️ 没有数据")
  2542. return
  2543. df = df.iloc[start_row:]
  2544. total = len(df)
  2545. success_count = 0
  2546. fail_count = 0
  2547. self.log(f"🚀 开始发送,共 {total} 条数据", "info")
  2548. self.status_var.set(f"🔄 发送中... 0/{total}")
  2549. for idx, (_, row) in enumerate(df.iterrows()):
  2550. if self.stop_flag:
  2551. self.log("⏹️ 已停止发送", "warning")
  2552. self.status_var.set("⏹️ 已停止")
  2553. break
  2554. # ===== 关键修复:计算Excel实际行号 =====
  2555. # DataFrame的索引 + 2(因为第1行是表头,DataFrame从0开始)
  2556. # 再加上start_row(起始行的偏移)
  2557. excel_row_number = idx + 2 + start_row
  2558. self.log(f" 📍 DataFrame索引: {idx}, Excel行号: {excel_row_number}", "debug")
  2559. # 检查该行是否有图片(使用Excel实际行号)
  2560. if self.image_cache and excel_row_number in self.image_cache:
  2561. img_count = len(self.image_cache[excel_row_number])
  2562. self.log(f" 🖼️ 第{excel_row_number}行有 {img_count} 个嵌入图片,将自动上传并添加", "info")
  2563. success, resp_text = self.send_request(row.to_dict(), excel_row_number)
  2564. if success:
  2565. success_count += 1
  2566. else:
  2567. fail_count += 1
  2568. self.status_var.set(f"🔄 发送中... {idx+1}/{total} (成功:{success_count} 失败:{fail_count})")
  2569. if idx < total - 1 and not self.stop_flag:
  2570. interval = random.uniform(min_interval, max_interval)
  2571. self.log(f"⏳ 等待 {interval:.1f} 秒...", "info")
  2572. time.sleep(interval)
  2573. self.log(f"🏁 发送完成!成功: {success_count}, 失败: {fail_count}", "success" if fail_count == 0 else "warning")
  2574. self.status_var.set(f"✅ 完成 成功:{success_count} 失败:{fail_count}")
  2575. except Exception as e:
  2576. self.log(f"💥 程序异常: {str(e)}", "error")
  2577. import traceback
  2578. self.log(f"详细错误: {traceback.format_exc()}", "debug")
  2579. self.status_var.set(f"❌ 异常: {str(e)}")
  2580. finally:
  2581. self.is_running = False
  2582. self.start_btn.config(state=tk.NORMAL)
  2583. self.stop_btn.config(state=tk.DISABLED)
  2584. def start_send(self):
  2585. """启动发送线程"""
  2586. if self.is_running:
  2587. return
  2588. if not self.file_path_var.get():
  2589. messagebox.showwarning("提示", "请先选择Excel文件")
  2590. return
  2591. cookie = self.cookie_text.get(1.0, tk.END).strip()
  2592. if not cookie:
  2593. messagebox.showwarning("提示", "请先配置Cookie")
  2594. return
  2595. try:
  2596. float(self.min_interval_var.get())
  2597. float(self.max_interval_var.get())
  2598. int(self.start_row_var.get())
  2599. except ValueError:
  2600. messagebox.showerror("错误", "间隔或行号请输入有效数字")
  2601. return
  2602. self.is_running = True
  2603. self.stop_flag = False
  2604. self.start_btn.config(state=tk.DISABLED)
  2605. self.stop_btn.config(state=tk.NORMAL)
  2606. self.status_var.set("🔄 正在发送...")
  2607. thread = threading.Thread(target=self.send_all, daemon=True)
  2608. thread.start()
  2609. def stop_send(self):
  2610. """停止发送"""
  2611. self.stop_flag = True
  2612. self.log("⏹️ 正在停止...", "warning")
  2613. self.stop_btn.config(state=tk.DISABLED)
  2614. # ========== 提取图片功能(手动) ==========
  2615. def extract_images_to_folder(self, file_path, sheet_name, output_folder=None):
  2616. """提取Excel中的所有图片并保存到文件夹"""
  2617. try:
  2618. if output_folder is None:
  2619. base_dir = os.path.dirname(file_path)
  2620. base_name = os.path.splitext(os.path.basename(file_path))[0]
  2621. output_folder = os.path.join(base_dir, f"{base_name}_提取的图片")
  2622. if not os.path.exists(output_folder):
  2623. os.makedirs(output_folder)
  2624. mapping_file = os.path.join(output_folder, "图片映射表.txt")
  2625. wb = load_workbook(file_path, data_only=True)
  2626. ws = wb[sheet_name]
  2627. image_count = 0
  2628. error_count = 0
  2629. with open(mapping_file, 'w', encoding='utf-8') as f:
  2630. f.write("="*60 + "\n")
  2631. f.write("Excel图片提取映射表\n")
  2632. f.write(f"源文件: {file_path}\n")
  2633. f.write(f"工作表: {sheet_name}\n")
  2634. f.write(f"提取时间: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n")
  2635. f.write("="*60 + "\n\n")
  2636. f.write("行号\t列号\t列字母\t文件名\t尺寸\t格式\n")
  2637. f.write("-"*60 + "\n")
  2638. if hasattr(ws, '_images') and ws._images:
  2639. self.log(f" 📸 开始提取 {len(ws._images)} 张图片...", "debug")
  2640. for idx, img in enumerate(ws._images):
  2641. try:
  2642. if hasattr(img, 'anchor') and hasattr(img.anchor, '_from'):
  2643. anchor_from = img.anchor._from
  2644. row = anchor_from.row + 1
  2645. col = anchor_from.col + 1
  2646. col_letter = get_column_letter(col)
  2647. else:
  2648. row = idx + 1
  2649. col = 0
  2650. col_letter = '?'
  2651. image_data = None
  2652. if hasattr(img, '_data') and callable(img._data):
  2653. image_data = img._data()
  2654. elif hasattr(img, '_data') and not callable(img._data):
  2655. image_data = img._data
  2656. elif hasattr(img, 'image'):
  2657. if hasattr(img.image, '_data') and callable(img.image._data):
  2658. image_data = img.image._data()
  2659. elif hasattr(img.image, '_data'):
  2660. image_data = img.image._data
  2661. if image_data is None:
  2662. error_count += 1
  2663. continue
  2664. # 检测格式并保存
  2665. img_format = 'jpg'
  2666. width, height = 0, 0
  2667. try:
  2668. from PIL import Image
  2669. import io
  2670. pil_img = Image.open(io.BytesIO(image_data))
  2671. img_format = pil_img.format if pil_img.format else 'jpg'
  2672. width, height = pil_img.size
  2673. filename = f"第{row}行_列{col_letter}_{idx+1}.{img_format.lower()}"
  2674. filepath = os.path.join(output_folder, filename)
  2675. pil_img.save(filepath)
  2676. except:
  2677. filename = f"第{row}行_列{col_letter}_{idx+1}.jpg"
  2678. filepath = os.path.join(output_folder, filename)
  2679. with open(filepath, 'wb') as f_out:
  2680. f_out.write(image_data)
  2681. f.write(f"{row}\t{col}\t{col_letter}\t{filename}\t{width}x{height}\t{img_format}\n")
  2682. image_count += 1
  2683. if image_count % 50 == 0:
  2684. self.log(f" 📸 已提取 {image_count} 张图片...", "debug")
  2685. except Exception as e:
  2686. error_count += 1
  2687. self.log(f" ⚠️ 提取图片失败: {str(e)}", "warning")
  2688. wb.close()
  2689. with open(mapping_file, 'a', encoding='utf-8') as f:
  2690. f.write("\n" + "="*60 + "\n")
  2691. f.write(f"提取完成: 成功 {image_count} 张, 失败 {error_count} 张\n")
  2692. f.write("="*60 + "\n")
  2693. self.log(f"✅ 成功提取 {image_count} 张图片到: {output_folder}", "success")
  2694. if error_count > 0:
  2695. self.log(f"⚠️ 有 {error_count} 张图片提取失败", "warning")
  2696. self.log(f"📋 映射文件: {mapping_file}", "info")
  2697. return output_folder
  2698. except Exception as e:
  2699. self.log(f"❌ 提取图片失败: {str(e)}", "error")
  2700. return None
  2701. def extract_images(self):
  2702. """手动提取图片的入口方法"""
  2703. excel_file = self.file_path_var.get()
  2704. if not excel_file:
  2705. messagebox.showwarning("提示", "请先选择Excel文件")
  2706. return
  2707. sheet_name = self.sheet_var.get()
  2708. if not messagebox.askyesno("确认",
  2709. f"即将提取Excel中的所有图片\n\n"
  2710. f"文件: {os.path.basename(excel_file)}\n"
  2711. f"工作表: {sheet_name}\n\n"
  2712. f"是否继续?"):
  2713. return
  2714. def extract_thread():
  2715. self.log("📸 开始提取图片...", "info")
  2716. self.status_var.set("🔄 正在提取图片...")
  2717. self.start_btn.config(state=tk.DISABLED)
  2718. output_folder = self.extract_images_to_folder(excel_file, sheet_name)
  2719. if output_folder:
  2720. self.status_var.set(f"✅ 图片已提取到: {output_folder}")
  2721. messagebox.showinfo("提取成功",
  2722. f"图片已成功提取!\n\n"
  2723. f"保存位置: {output_folder}\n\n"
  2724. f"请查看文件夹中的 '图片映射表.txt' 文件")
  2725. else:
  2726. self.status_var.set("❌ 提取失败")
  2727. messagebox.showerror("提取失败", "图片提取失败,请查看日志了解详情。")
  2728. self.start_btn.config(state=tk.NORMAL)
  2729. thread = threading.Thread(target=extract_thread, daemon=True)
  2730. thread.start()
  2731. if __name__ == "__main__":
  2732. root = tk.Tk()
  2733. app = FeishuSubmitApp(root)
  2734. root.mainloop()