Propably working Dockerfile.
This commit is contained in:
3
code/.gitignore
vendored
3
code/.gitignore
vendored
@@ -1 +1,2 @@
|
||||
__pycache__
|
||||
__pycache__
|
||||
test
|
||||
52
code/test.py
52
code/test.py
@@ -1,52 +0,0 @@
|
||||
from typing import Optional, Annotated
|
||||
import dns, dns.resolver, socket
|
||||
|
||||
|
||||
|
||||
|
||||
def ermWhatATheIpFromDomainYaCrazy(inpDomainNameOrSomething: Annotated[str, "Domain name to lookup IP for"]):
|
||||
#dns_query = Nslookup()
|
||||
"""
|
||||
Tells you what IPv4 address/es a domain point to.
|
||||
Returns:
|
||||
dict: A dictionary with IP addresses associated with that domain.
|
||||
|
||||
"""
|
||||
|
||||
# i = 0
|
||||
outDict = {}
|
||||
|
||||
#result = dns_query.dns_lookup("example.com")
|
||||
#result = Nslookup.dns_lookup(inpDomainNameOrSomething)
|
||||
result = dns.resolver.resolve(inpDomainNameOrSomething, 'A')
|
||||
# result = dns.resolver.resolve_name(inpDomainNameOrSomething)
|
||||
for i, something in enumerate(result):
|
||||
outDict[i] = something.to_text()
|
||||
# i += 1
|
||||
|
||||
return outDict
|
||||
|
||||
|
||||
# print(socket.getaddrinfo(url, "443"))
|
||||
|
||||
url = "https://data.fubukus.net/assets/"
|
||||
# url = "http://ftp.eq.uc.pt/software/Linux/debian/"
|
||||
|
||||
if "https://" in url:
|
||||
url = url[8:]
|
||||
elif "http://" in url:
|
||||
url = url[7:]
|
||||
i = 0
|
||||
for char in url:
|
||||
# print(char)
|
||||
i += 1
|
||||
if char == "/":
|
||||
url = url[:i]
|
||||
# i = 0
|
||||
|
||||
# print("skibidi")
|
||||
if char == "/":
|
||||
url = url[:-1]
|
||||
|
||||
print(url)
|
||||
# print(ermWhatATheIpFromDomainYaCrazy(url))
|
||||
Reference in New Issue
Block a user