From 8c31df93a0ac61549d06f2c78ab07909ee491275 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Wed, 14 Feb 2024 23:04:31 +0000 Subject: [PATCH] Add support for redesigned org repo list --- github-list-repos | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/github-list-repos b/github-list-repos index 7953290..4ac522a 100755 --- a/github-list-repos +++ b/github-list-repos @@ -25,7 +25,7 @@ assert users and (mode is None or mode in MODES) and not users[0].startswith('-- def get(url): while True: logging.info(f'Fetching {url}') - r = requests.get(url, headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0'}) + r = requests.get(url, headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0', 'Accept': 'text/html'}) if r.status_code == 429: logging.warning(f'Got 429, sleeping and retrying') time.sleep(5) @@ -65,7 +65,9 @@ for user in users: while True: for m in re.finditer(r']*\s)?data-hovercard-url="/([^/>"]+/[^/>"]+)/hovercard"', r.text): p(m.group(1)) - if ']*\s)?href="/([^/>"]+/[^/>"]+)"', r.text): + p(m.group(1)) + if '