Skip to content

Commit

Permalink
fix: Fixed error when homepage_url starts with http
Browse files Browse the repository at this point in the history
fix: Pause when paper submission fails
  • Loading branch information
chettoy committed Sep 21, 2022
1 parent 076075c commit 8d22646
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion fxxkstar.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@ def load_homepage_url():
if homepage_soup.find("title").string.strip() != "个人空间":
raise MyError(0, G_STRINGS['error_response'] +
": url=" + homepage_url + "\n" + str(homepage_html))
if homepage_url.startswith("http://"):
if G_VERBOSE:
print("Rewrite homepage_url to use HTTPS")
homepage_url = "https://" + homepage_url[7:]
assert homepage_url.startswith("https://i.chaoxing.com/base")
self.homepage_url = homepage_url
return homepage_url
Expand Down Expand Up @@ -2366,7 +2370,10 @@ def module_work_submit(fxxkstar: FxxkStar, work_page_html: str, do_submit=False)
print('✅', result['msg'])
return True
else:
raise MyError(result['msg'] + " " + rsp_text)
print('💬', result['msg'])
print(G_STRINGS['press_enter_to_continue'])
input()
#raise MyError(1, result['msg'] + " " + rsp_text)

def correct_answers(self, questions: List[dict], work_id: str, card_url: str) -> List[dict]:
"Set correct answers in question dict, return a list of unprocessed questions"
Expand Down

0 comments on commit 8d22646

Please sign in to comment.