2022.06.24 version, fix a tixcraft redirect url error.

master
CHUN YU YAO 2022-06-25 01:29:48 +08:00
parent dcc8dc5df9
commit 8e72932db4
2 changed files with 22 additions and 6 deletions

View File

@ -51,7 +51,7 @@ ssl._create_default_https_context = ssl._create_unverified_context
#附註1沒有寫的很好很多地方應該可以模組化。 #附註1沒有寫的很好很多地方應該可以模組化。
#附註2 #附註2
CONST_APP_VERSION = u"MaxBot (2022.03.24)" CONST_APP_VERSION = u"MaxBot (2022.06.24)"
CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom" CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom"
CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top" CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top"
@ -441,7 +441,11 @@ def load_config_from_local(driver):
driver.switch_to.window(driver.window_handles[0]) driver.switch_to.window(driver.window_handles[0])
except Exception as excSwithFail: except Exception as excSwithFail:
pass pass
driver.get(homepage)
try:
driver.get(homepage)
except Exception as exec1:
pass
else: else:
print("Config error!") print("Config error!")
@ -808,7 +812,11 @@ def tixcraft_redirect(driver, url):
# to support teamear # to support teamear
entry_url = url.replace("/activity/detail/","/activity/game/") entry_url = url.replace("/activity/detail/","/activity/game/")
#entry_url = "tixcraft.com/activity/game/%s" % (game_name,) #entry_url = "tixcraft.com/activity/game/%s" % (game_name,)
driver.get(entry_url) print("redirec to new url:", entry_url)
try:
driver.get(entry_url)
except Exception as exec1:
pass
ret = True ret = True
return ret return ret
@ -3492,13 +3500,21 @@ def main():
if 'msg.urbtix.hk' in url: if 'msg.urbtix.hk' in url:
# delay to avoid ip block. # delay to avoid ip block.
time.sleep(1.0) time.sleep(1.0)
driver.get('https://www.urbtix.hk/')
try:
driver.get('https://www.urbtix.hk/')
except Exception as exec1:
pass
pass pass
# http://busy.urbtix.hk # http://busy.urbtix.hk
if 'busy.urbtix.hk' in url: if 'busy.urbtix.hk' in url:
# delay to avoid ip block. # delay to avoid ip block.
time.sleep(1.0) time.sleep(1.0)
driver.get('https://www.urbtix.hk/') try:
driver.get('https://www.urbtix.hk/')
except Exception as exec1:
pass
pass pass
if '/performanceDetail/' in url: if '/performanceDetail/' in url:

View File

@ -17,7 +17,7 @@ import sys
import platform import platform
import json import json
CONST_APP_VERSION = u"MaxBot (2022.03.24)" CONST_APP_VERSION = u"MaxBot (2022.06.24)"
CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom" CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom"
CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top" CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top"