File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -187,9 +187,7 @@ def getdomains(arg):
187187
188188
189189def find_domain_id (domain_name ):
190- found = False
191190 page = 1
192- names = []
193191 ids = []
194192 html = req .get (
195193 "https://freedns.afraid.org/domain/registry/?page="
@@ -213,17 +211,13 @@ def find_domain_id(domain_name):
213211 "sec-ch-ua-platform" : "Linux" ,
214212 },
215213 ).text
216- pattern = r"<a href=/subdomain/edit\.php\?edit_domain_id=\d+>([\w.-]+)</a>.*?<td>public</td>"
217- names .extend (re .findall (pattern , html ))
218214 pattern = r"<a href=\/subdomain\/edit\.php\?edit_domain_id=([0-9]+)><font color=red>(?:.+\..+)<\/font><\/a>"
219215 matches = re .findall (pattern , html )
220- ids .extend ([match [0 ] for match in matches ])
221- if len (ids ) > 0 :
222- found = True
223- checkprint (f"Found domain ID: { ids [0 ]} " )
216+ if len (matches ) > 0 :
217+ checkprint (f"Found domain ID: { matches [0 ]} " )
224218 else :
225219 raise Exception ("Domain ID not found" )
226- return ids [0 ]
220+ return matches [0 ]
227221
228222
229223
You can’t perform that action at this time.
0 commit comments