# -*- coding: utf-8 -*- import os import requests import xml.etree.ElementTree as ET import json from requests.exceptions import RequestException from loguru import logger github_headers = { 'Authorization': f"token {github_token}" } # 抓取本年的 year = datetime.datetime.now().year api = "https://api.github.com/search/repositories?q=CVE-{}&sort=updated".format(year) json_str = requests.get(api, headers=github_headers, timeout=10).json()