Skip to content

Commit

Permalink
尝试修复部分系统在import bili_ticket_gt_python时出错导致的问题 (#125)
Browse files Browse the repository at this point in the history
尝试修复部分系统在import bili_ticket_gt_python时出错导致即便使用rrocr也无效的问题
  • Loading branch information
ZianTT authored Jun 29, 2024
2 parents d2e2100 + a7f8306 commit a8073a5
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions geetest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,19 @@

import requests

import bili_ticket_gt_python

from loguru import logger

from globals import *
# REF: https://github.com/mikumifa/biliTickerBuy
# REF: https://github.com/Amorter/biliTicker_gt
# LICENSE: GPL-3.0

class Validator():
def __init__(self):
self.click = bili_ticket_gt_python.ClickPy()
pass

def validate(self, gt, challenge) -> str:
try:
validate = self.click.simple_match_retry(gt, challenge)
return validate
except Exception as e:
return ""


def run(gt, challenge, token, mode="local_gt", key=None):
if mode == "local_gt":
import bili_ticket_gt_python
try:
validator = Validator()
validate_string = validator.validate(gt, challenge)
Expand Down Expand Up @@ -80,7 +70,24 @@ def run(gt, challenge, token, mode="local_gt", key=None):
}
return data
else:

logger.critical("暂不支持该验证码模式")



class Validator():
import bili_ticket_gt_python
def __init__(self):
import bili_ticket_gt_python
self.click = bili_ticket_gt_python.ClickPy()
pass

def validate(self, gt, challenge) -> str:
try:
validate = self.click.simple_match_retry(gt, challenge)
return validate
except Exception as e:
return ""


if __name__ == "__main__":
Expand Down

0 comments on commit a8073a5

Please sign in to comment.