forked from public/mirror-checker
parent
6b0d3f4de9
commit
3428e81cec
@ -1,17 +0,0 @@ |
||||
""" |
||||
Contains CPAN class |
||||
""" |
||||
|
||||
import requests |
||||
from distro import Distro |
||||
from shared import CSC_MIRROR |
||||
|
||||
class CPAN(Distro): |
||||
"""CPAN class""" |
||||
@staticmethod |
||||
def check(data, distro, current_time): |
||||
res_json = requests.get("http://mirrors.cpan.org/cpan-json.txt").json() |
||||
for mirror in res_json: |
||||
if mirror["url"] == f"{CSC_MIRROR}CPAN/": |
||||
return current_time - int(mirror["age"]) <= data[distro]["out_of_sync_interval"] |
||||
return False |
@ -1,181 +1,181 @@ |
||||
{ |
||||
"AlmaLinux": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://repo.almalinux.org/", |
||||
"file": "almalinux/TIME" |
||||
}, |
||||
"Alpine": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://uk.alpinelinux.org/", |
||||
"file": "alpine/last-updated" |
||||
}, |
||||
"Apache": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "apache/", |
||||
"upstream": "https://downloads.apache.org/", |
||||
"file": "zzz/time.txt" |
||||
}, |
||||
"Arch": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "archlinux/", |
||||
"upstream": "http://arch.mirror.constant.com/", |
||||
"file": "lastupdate" |
||||
}, |
||||
"CentOS": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://mirrors.edge.kernel.org/", |
||||
"file": "centos/TIME" |
||||
}, |
||||
"Ceph": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "ceph/", |
||||
"upstream": "https://download.ceph.com/", |
||||
"file": "timestamp" |
||||
}, |
||||
"CPAN": { |
||||
"out_of_sync_interval": 172800 |
||||
}, |
||||
"Cygwin": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "cygwin/", |
||||
"upstream": "https://cygwin.mirror.globo.tech/", |
||||
"file": "x86/sha512.sum" |
||||
}, |
||||
"Debian": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://ftp-master.debian.org/", |
||||
"file": "debian/project/trace/master" |
||||
}, |
||||
"DebianCD": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "http://debian.mirror.estruxture.net/", |
||||
"file": "debian-cd/project/trace/cdimage.debian.org" |
||||
}, |
||||
"DebianMultimedia": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "debian-multimedia/", |
||||
"upstream": "http://debian-mirrors.sdinet.de/deb-multimedia/", |
||||
"file": "project/trace/deb-multimedia.org" |
||||
}, |
||||
"DebianPorts": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://deb.debian.org/", |
||||
"file": "debian-ports/project/trace/porta.debian.org" |
||||
}, |
||||
"DebianSecurity": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "http://debian.mirror.iweb.ca/", |
||||
"file": "debian-security/project/trace/master" |
||||
}, |
||||
"Eclipse": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 172800, |
||||
"csc": "eclipse/", |
||||
"upstream": "http://download.eclipse.org/", |
||||
"file": "TIME" |
||||
}, |
||||
"Fedora": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "fedora/", |
||||
"upstream": "http://fedora.mirror.iweb.com/", |
||||
"file": "linux/development/rawhide/COMPOSE_ID" |
||||
}, |
||||
"FreeBSD": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "http://ftp4.freebsd.org/pub/", |
||||
"file": "FreeBSD/TIMESTAMP" |
||||
}, |
||||
"GentooDistfiles": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "gentoo-distfiles", |
||||
"upstream": "http://gentoo.mirrors.tera-byte.com/", |
||||
"file": "distfiles/timestamp.dev-local" |
||||
}, |
||||
"GentooPortage": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "rsync://rsync4.ca.gentoo.org/", |
||||
"upstream1": "rsync://rsync1.de.gentoo.org/", |
||||
"upstream2": "rsync://rsync8.de.gentoo.org/", |
||||
"file": "gentoo-portage/Manifest" |
||||
}, |
||||
"GNOME": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "gnome/", |
||||
"upstream1": "https://download.gnome.org/", |
||||
"upstream2": "https://mirrors.dotsrc.org/gnome/", |
||||
"upstream3": "https://muug.ca/mirror/gnome/", |
||||
"file1": "core/", |
||||
"file2": "cache.json" |
||||
}, |
||||
"GNU": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://mirrors.kernel.org/", |
||||
"file": "gnu/mirror-updated-timestamp.txt" |
||||
}, |
||||
"Gutenberg": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 172800, |
||||
"csc": "gutenberg/", |
||||
"upstream": "https://gutenberg.pglaf.org/", |
||||
"file": "gutenberg.dcs" |
||||
}, |
||||
"IPFire": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 172800 |
||||
}, |
||||
"KDE": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "kde/", |
||||
"upstream": "https://kde.c3sl.ufpr.br/", |
||||
"file": "ls-lR" |
||||
}, |
||||
"KDEApplicationData": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "kde-applicationdata/", |
||||
"upstream": "https://cdn.files.kde.org/", |
||||
"file": "last-updated" |
||||
}, |
||||
"Kernel": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "kernel.org/", |
||||
"upstream": "https://mirrors.edge.kernel.org/pub/", |
||||
"file": "linux/kernel/next/sha256sums.asc" |
||||
}, |
||||
"OpenBSD": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://ftp.openbsd.org/pub/", |
||||
"file": "OpenBSD/timestamp" |
||||
} |
||||
"AlmaLinux": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://repo.almalinux.org/", |
||||
"file": "almalinux/TIME" |
||||
}, |
||||
"Alpine": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://uk.alpinelinux.org/", |
||||
"file": "alpine/last-updated" |
||||
}, |
||||
"Apache": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "apache/", |
||||
"upstream": "https://downloads.apache.org/", |
||||
"file": "zzz/time.txt" |
||||
}, |
||||
"Arch": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "archlinux/", |
||||
"upstream": "http://arch.mirror.constant.com/", |
||||
"file": "lastupdate" |
||||
}, |
||||
"CentOS": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://mirrors.edge.kernel.org/", |
||||
"file": "centos/TIME" |
||||
}, |
||||
"Ceph": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "ceph/", |
||||
"upstream": "https://download.ceph.com/", |
||||
"file": "timestamp" |
||||
}, |
||||
"CPAN": { |
||||
"out_of_sync_interval": 172800 |
||||
}, |
||||
"Cygwin": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "cygwin/", |
||||
"upstream": "https://cygwin.mirror.globo.tech/", |
||||
"file": "x86/sha512.sum" |
||||
}, |
||||
"Debian": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://ftp-master.debian.org/", |
||||
"file": "debian/project/trace/master" |
||||
}, |
||||
"DebianCD": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "http://debian.mirror.estruxture.net/", |
||||
"file": "debian-cd/project/trace/cdimage.debian.org" |
||||
}, |
||||
"DebianMultimedia": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "debian-multimedia/", |
||||
"upstream": "http://debian-mirrors.sdinet.de/deb-multimedia/", |
||||
"file": "project/trace/deb-multimedia.org" |
||||
}, |
||||
"DebianPorts": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://deb.debian.org/", |
||||
"file": "debian-ports/project/trace/porta.debian.org" |
||||
}, |
||||
"DebianSecurity": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "http://debian.mirror.iweb.ca/", |
||||
"file": "debian-security/project/trace/master" |
||||
}, |
||||
"Eclipse": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 172800, |
||||
"csc": "eclipse/", |
||||
"upstream": "http://download.eclipse.org/", |
||||
"file": "TIME" |
||||
}, |
||||
"Fedora": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "fedora/", |
||||
"upstream": "http://fedora.mirror.iweb.com/", |
||||
"file": "linux/development/rawhide/COMPOSE_ID" |
||||
}, |
||||
"FreeBSD": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "http://ftp4.freebsd.org/pub/", |
||||
"file": "FreeBSD/TIMESTAMP" |
||||
}, |
||||
"GentooDistfiles": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "gentoo-distfiles", |
||||
"upstream": "http://gentoo.mirrors.tera-byte.com/", |
||||
"file": "distfiles/timestamp.dev-local" |
||||
}, |
||||
"GentooPortage": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "rsync://rsync4.ca.gentoo.org/", |
||||
"upstream1": "rsync://rsync1.de.gentoo.org/", |
||||
"upstream2": "rsync://rsync8.de.gentoo.org/", |
||||
"file": "gentoo-portage/Manifest" |
||||
}, |
||||
"GNOME": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "gnome/", |
||||
"upstream1": "https://download.gnome.org/", |
||||
"upstream2": "https://mirrors.dotsrc.org/gnome/", |
||||
"upstream3": "https://muug.ca/mirror/gnome/", |
||||
"file1": "core/", |
||||
"file2": "cache.json" |
||||
}, |
||||
"GNU": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://mirrors.kernel.org/", |
||||
"file": "gnu/mirror-updated-timestamp.txt" |
||||
}, |
||||
"Gutenberg": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 172800, |
||||
"csc": "gutenberg/", |
||||
"upstream": "https://gutenberg.pglaf.org/", |
||||
"file": "gutenberg.dcs" |
||||
}, |
||||
"IPFire": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 172800 |
||||
}, |
||||
"KDE": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "kde/", |
||||
"upstream": "https://kde.c3sl.ufpr.br/", |
||||
"file": "ls-lR" |
||||
}, |
||||
"KDEApplicationData": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "kde-applicationdata/", |
||||
"upstream": "https://cdn.files.kde.org/", |
||||
"file": "last-updated" |
||||
}, |
||||
"Kernel": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "kernel.org/", |
||||
"upstream": "https://mirrors.edge.kernel.org/pub/", |
||||
"file": "linux/kernel/next/sha256sums.asc" |
||||
}, |
||||
"OpenBSD": { |
||||
"out_of_sync_since": null, |
||||
"out_of_sync_interval": 86400, |
||||
"csc": "", |
||||
"upstream": "https://ftp.openbsd.org/pub/", |
||||
"file": "OpenBSD/timestamp" |
||||
} |
||||
} |
||||
|
@ -1,5 +1,20 @@ |
||||
[ |
||||
["OpenBSD", "https://mirror.csclub.uwaterloo.ca/OpenBSD/", "https://ftp.openbsd.org/pub/OpenBSD/", "timestamp"], |
||||
["kernel", "http://mirror.csclub.uwaterloo.ca/kernel.org/linux/kernel/next/", "https://mirrors.edge.kernel.org/pub/linux/kernel/next/", "sha256sums.asc"], |
||||
["debian", "http://mirror.csclub.uwaterloo.ca/debian/project/trace/", "https://ftp-master.debian.org/debian/project/trace/", "master"] |
||||
] |
||||
[ |
||||
"OpenBSD", |
||||
"https://mirror.csclub.uwaterloo.ca/OpenBSD/", |
||||
"https://ftp.openbsd.org/pub/OpenBSD/", |
||||
"timestamp" |
||||
], |
||||
[ |
||||
"kernel", |
||||
"http://mirror.csclub.uwaterloo.ca/kernel.org/linux/kernel/next/", |
||||
"https://mirrors.edge.kernel.org/pub/linux/kernel/next/", |
||||
"sha256sums.asc" |
||||
], |
||||
[ |
||||
"debian", |
||||
"http://mirror.csclub.uwaterloo.ca/debian/project/trace/", |
||||
"https://ftp-master.debian.org/debian/project/trace/", |
||||
"master" |
||||
] |
||||
] |
||||
|
@ -1,29 +0,0 @@ |
||||
""" |
||||
Contains GentooPortage class |
||||
""" |
||||
|
||||
import os |
||||
from distro import Distro |
||||
|
||||
class GentooPortage(Distro): |
||||
"""GentooPortage class""" |
||||
@staticmethod |
||||
def check(data, distro): |
||||
rsync_command = "rsync -q {}{} {}" |
||||
os.system(rsync_command.format(data[distro]["csc"], |
||||
data[distro]["file"], |
||||
"csc_manifest")) |
||||
os.system(rsync_command.format(data[distro]["upstream1"], |
||||
data[distro]["file"], |
||||
"upstream_manifest1")) |
||||
os.system(rsync_command.format(data[distro]["upstream2"], |
||||
data[distro]["file"], |
||||
"upstream_manifest2")) |
||||
stream1 = os.popen("diff csc_manifest upstream_manifest1") |
||||
output1 = stream1.read() |
||||
stream2 = os.popen("diff csc_manifest upstream_manifest2") |
||||
output2 = stream2.read() |
||||
os.system("rm csc_manifest") |
||||
os.system("rm upstream_manifest1") |
||||
os.system("rm upstream_manifest2") |
||||
return 0 in [len(output1), len(output2)] |
@ -1,40 +0,0 @@ |
||||
""" |
||||
Contains GNOME class |
||||
""" |
||||
|
||||
import re |
||||
import requests |
||||
from distro import Distro |
||||
from shared import CSC_MIRROR |
||||
|
||||
class GNOME(Distro): |
||||
"""GNOME class""" |
||||
@staticmethod |
||||
def check(data, distro): |
||||
file = data[distro]["file1"] |
||||
csc_versions = requests.get(CSC_MIRROR + data[distro]["csc"] + file).text |
||||
upstream_versions = requests.get(data[distro]["upstream1"] + file).text |
||||
csc_latest = re.findall(r"\"\d+\.?\d*", csc_versions)[-1].lstrip('"') |
||||
upstream_latest = re.findall(r"\"\d+\.?\d*", upstream_versions)[-1].lstrip('"') |
||||
if csc_latest != upstream_latest: |
||||
return False |
||||
file += csc_latest + "/" |
||||
csc_versions = requests.get(CSC_MIRROR + data[distro]["csc"] + file).text |
||||
upstream_versions = requests.get(data[distro]["upstream1"] + file).text |
||||
csc_latest = re.findall(r"\"\d+\.?\w*\.?\w*", csc_versions)[-1].lstrip('"') |
||||
upstream_latest = re.findall(r"\"\d+\.?\w*\.?\w*", upstream_versions)[-1].lstrip('"') |
||||
if csc_latest != upstream_latest: |
||||
return False |
||||
file += csc_latest + "/" |
||||
csc_text = requests.get(CSC_MIRROR + data[distro]["csc"] + file |
||||
+ data[distro]["file2"]).text |
||||
try: |
||||
ret = csc_text == requests.get(data[distro]["upstream2"] + file |
||||
+ data[distro]["file2"]).text |
||||
except requests.exceptions.RequestException: |
||||
ret = False |
||||
try: |
||||
return ret or csc_text == requests.get(data[distro]["upstream3"] + file |
||||
+ data[distro]["file2"]).text |
||||
except requests.exceptions.RequestException: |
||||
return False |
@ -1,14 +0,0 @@ |
||||
""" |
||||
Contains IPFire class |
||||
""" |
||||
|
||||
import requests |
||||
from distro import Distro |
||||
|
||||
class IPFire(Distro): |
||||
"""IPFire class""" |
||||
@staticmethod |
||||
def check(data, distro): |
||||
ipfire_url = "https://mirrors.ipfire.org/mirrors/mirror.csclub.uwaterloo.ca" |
||||
ipfire_text = requests.get(ipfire_url).text |
||||
return ipfire_text.find("The mirror is up") != -1 |
@ -0,0 +1,20 @@ |
||||
""" |
||||
Contains CPAN class |
||||
""" |
||||
|
||||
import requests |
||||
|
||||
from distro import Distro |
||||
from shared import CSC_MIRROR |
||||
|
||||
|
||||
class CPAN(Distro): |
||||
"""CPAN class""" |
||||
|
||||
@staticmethod |
||||
def check(data, distro, current_time): |
||||
res_json = requests.get("http://mirrors.cpan.org/cpan-json.txt").json() |
||||
for mirror in res_json: |
||||
if mirror["url"] == f"{CSC_MIRROR}CPAN/": |
||||
return current_time - int(mirror["age"]) <= data[distro]["out_of_sync_interval"] |
||||
return False |
@ -0,0 +1,32 @@ |
||||
""" |
||||
Contains GentooPortage class |
||||
""" |
||||
|
||||
import os |
||||
|
||||
from distro import Distro |
||||
|
||||
|
||||
class GentooPortage(Distro): |
||||
"""GentooPortage class""" |
||||
|
||||
@staticmethod |
||||
def check(data, distro): |
||||
rsync_command = "rsync -q {}{} {}" |
||||
os.system(rsync_command.format(data[distro]["csc"], |
||||
data[distro]["file"], |
||||
"csc_manifest")) |
||||
os.system(rsync_command.format(data[distro]["upstream1"], |
||||
data[distro]["file"], |
||||
"upstream_manifest1")) |
||||
os.system(rsync_command.format(data[distro]["upstream2"], |
||||
data[distro]["file"], |
||||
"upstream_manifest2")) |
||||
stream1 = os.popen("diff csc_manifest upstream_manifest1") |
||||
output1 = stream1.read() |
||||
stream2 = os.popen("diff csc_manifest upstream_manifest2") |
||||
output2 = stream2.read() |
||||
os.system("rm csc_manifest") |
||||
os.system("rm upstream_manifest1") |
||||
os.system("rm upstream_manifest2") |
||||
return 0 in [len(output1), len(output2)] |
@ -0,0 +1,44 @@ |
||||
""" |
||||
Contains GNOME class |
||||
""" |
||||
|
||||
import re |
||||
|
||||
import requests |
||||
|
||||
from distro import Distro |
||||
from shared import CSC_MIRROR |
||||
|
||||
|
||||
class GNOME(Distro): |
||||
"""GNOME class""" |
||||
|
||||
@staticmethod |
||||
def check(data, distro): |
||||
file = data[distro]["file1"] |
||||
csc_versions = requests.get(CSC_MIRROR + data[distro]["csc"] + file).text |
||||
upstream_versions = requests.get(data[distro]["upstream1"] + file).text |
||||
csc_latest = re.findall(r"\"\d+\.?\d*", csc_versions)[-1].lstrip('"') |
||||
upstream_latest = re.findall(r"\"\d+\.?\d*", upstream_versions)[-1].lstrip('"') |
||||
if csc_latest != upstream_latest: |
||||
return False |
||||
file += csc_latest + "/" |
||||
csc_versions = requests.get(CSC_MIRROR + data[distro]["csc"] + file).text |
||||
upstream_versions = requests.get(data[distro]["upstream1"] + file).text |
||||
csc_latest = re.findall(r"\"\d+\.?\w*\.?\w*", csc_versions)[-1].lstrip('"') |
||||
upstream_latest = re.findall(r"\"\d+\.?\w*\.?\w*", upstream_versions)[-1].lstrip('"') |
||||
if csc_latest != upstream_latest: |
||||
return False |
||||
file += csc_latest + "/" |
||||
csc_text = requests.get(CSC_MIRROR + data[distro]["csc"] + file |
||||
+ data[distro]["file2"]).text |
||||
try: |
||||
ret = csc_text == requests.get(data[distro]["upstream2"] + file |
||||
+ data[distro]["file2"]).text |
||||
except requests.exceptions.RequestException: |
||||
ret = False |
||||
try: |
||||
return ret or csc_text == requests.get(data[distro]["upstream3"] + file |
||||
+ data[distro]["file2"]).text |
||||
except requests.exceptions.RequestException: |
||||
return False |
@ -0,0 +1,17 @@ |
||||
""" |
||||
Contains IPFire class |
||||
""" |
||||
|
||||
import requests |
||||
|
||||
from distro import Distro |
||||
|
||||
|
||||
class IPFire(Distro): |
||||
"""IPFire class""" |
||||
|
||||
@staticmethod |
||||
def check(data, distro): |
||||
ipfire_url = "https://mirrors.ipfire.org/mirrors/mirror.csclub.uwaterloo.ca" |
||||
ipfire_text = requests.get(ipfire_url).text |
||||
return ipfire_text.find("The mirror is up") != -1 |
@ -0,0 +1,4 @@ |
||||
requests~=2.26.0 |
||||
datefinder~=0.7.1 |
||||
|
||||
dateparser~=1.0.0 |
Loading…
Reference in new issue