Agunua is a Python library for the development of Gemini clients, by Stephane Bortzmeyer -
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
582 B

import Agunua
import Agunua.status
import sys
if len(sys.argv) <= 1:
raise Exception("Usage: %s url ..." % sys.argv[0])
for url in sys.argv[1:]:
u = Agunua.GeminiUri(url, get_content=True, parse_content=True, insecure=True)
if u.network_success:
if u.status_code == "20":
print("%i bytes" % len(u.payload))
if u.links is not None and u.links != []:
print("Links: %s" % u.links)
print("Status code is %s" %[u.status_code])