INNER CODE UNIT · Python
extract_repo_time
cscnk52/wechat-windows-versions · main.py:28
def extract_repo_time():
github_api_response = httpx.get(
"https://api.github.com/repos/cscnk52/wechat-windows-versions/releases/latest"
).json()
time_text_re = re.search(r"Last Modified:\s*(.+)", github_api_response["body"])
assert time_text_re, "repo time_date match failed"
time_date = parser.parse(time_text_re.group(1))
time_date = time_date.replace(tzinfo=tz.tzutc())
return time_date
def extract_installer_version():
build_dir = Path("build")
build_dir.mkdir(exist_ok=True)
download_link = state["download_link"]
assert download_link, "Download link is not initialized"
response = httpx.get(download_link)