| 144 | self.ratelimit_reset = float(info['rate']['reset']) |
| 145 | |
| 146 | def authenticate(self): |
| 147 | print("Input a Github API access token.\n" |
| 148 | "Personal tokens can be created at https://github.com/settings/tokens\n" |
| 149 | "This script does not require any permissions (so don't give it any).", |
| 150 | file=sys.stderr, flush=True) |
| 151 | print("Access token: ", file=sys.stderr, end='', flush=True) |
| 152 | token = input() |
| 153 | self.headers['Authorization'] = f'token {token.strip()}' |
| 154 | |
| 155 | def urlopen(self, url, auth=None): |
| 156 | assert url.startswith('https://') |