Prechádzať zdrojové kódy

超级鹰添加爬虫代码查询

dongzhaorui 1 rok pred
rodič
commit
219525799f
1 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 5 1
      FworkSpider/untils/get_imgcode.py

+ 5 - 1
FworkSpider/untils/get_imgcode.py

@@ -72,14 +72,18 @@ def swordfish_platform(file, mode="simple"):
         return _simple_captcha(file)
 
 
-def chaojiying_platform(file, pic_type: int):
+def chaojiying_platform(file, pic_type: int, spidercode=None):
     """
     超级鹰识别平台
 
     pic_type,详情查询地址: https://www.chaojiying.com/price.html
+    @param str spidercode: 爬虫代码
     """
     files = _pack_file(file)
     url = f"{setting.CAPTCHA_URL}/v1/images/discern?pic_type={pic_type}"
+    if spidercode is not None:
+        url = f"{setting.CAPTCHA_URL}/v1/images/discern?pic_type={pic_type}&jy_code={spidercode}"
+
     headers = {'accept': 'application/json'}
     data = {
         'grant_type': '',