forked from matrix1001/glibc-all-in-one
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_list
executable file
·31 lines (21 loc) · 888 Bytes
/
update_list
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python
import re
import requests
common_url = 'https://mirror.tuna.tsinghua.edu.cn/ubuntu/pool/main/g/glibc/'
# url = 'http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/'
old_url = 'http://old-releases.ubuntu.com/ubuntu/pool/main/g/glibc/'
def get_list(url, arch):
content = str(requests.get(url).content)
return re.findall('libc6_(2\.[0-9][0-9]-[0-9]ubuntu[0-9\.]*_{}).deb'.format(arch), content)
common_list = get_list(common_url, 'amd64')
common_list += get_list(common_url, 'i386')
with open('list', 'w') as f:
for l in sorted(set(common_list)):
f.write(l + '\n')
print('[+] Common list has been save to "list"')
old_list = get_list(old_url, 'amd64')
old_list += get_list(old_url, 'i386')
with open('old_list', 'w') as f:
for l in sorted(set(old_list)):
f.write(l + '\n')
print('[+] Old-release list has been save to "old_list"')