26
26
)
27
27
28
28
type Http struct {
29
- Url , Num string
29
+ Url string
30
30
}
31
31
32
32
func getDomains (path string ) (lines []string , Error error ) {
@@ -153,30 +153,23 @@ func Identify(url string) (service string) {
153
153
return service
154
154
}
155
155
156
- func Detect (url , num string ) {
156
+ func Detect (url string ) {
157
157
service := Identify (url )
158
158
159
- // Clears previous line -- needs to be optimized in the future.
160
- fmt .Printf ("\r %s" , strings .Repeat (" " , 100 ))
161
-
162
159
if service != "" {
163
160
result := fmt .Sprintf ("[%s] %s\n " , service , url )
164
161
165
- fmt .Printf (" \r %s" , result )
162
+ fmt .Printf (result )
166
163
167
164
if * Output != "" {
168
165
write (result )
169
166
}
170
- } else {
171
- fmt .Printf ("\r " )
172
167
}
173
-
174
- fmt .Printf ("\r [ Domains \001 b[31m%s\u001b [0m - Last Request to %s ]" , num , url )
175
168
}
176
169
177
170
func (s * Http ) DNS () {
178
171
if * Strict {
179
- Detect (s .Url , s . Num )
172
+ Detect (s .Url )
180
173
} else {
181
174
cname , err := net .LookupCNAME (s .Url )
182
175
if err != nil {
@@ -211,7 +204,7 @@ func (s *Http) DNS() {
211
204
212
205
for _ , cn := range cnames {
213
206
if strings .Contains (cname , cn ) {
214
- Detect (s .Url , s . Num )
207
+ Detect (s .Url )
215
208
}
216
209
}
217
210
}
@@ -237,16 +230,12 @@ func Process() {
237
230
}
238
231
239
232
for i := 0 ; i < len (list ); i ++ {
240
- Progress := fmt .Sprintf ("%d" , len (list ))
241
- urls <- & Http {Url : list [i ], Num : Progress }
233
+ urls <- & Http {Url : list [i ]}
242
234
}
243
235
244
236
close (urls )
245
237
246
238
wg .Wait ()
247
-
248
- fmt .Printf ("\r %s" , strings .Repeat (" " , 100 ))
249
- fmt .Printf ("\r Task completed.\n " )
250
239
}
251
240
252
241
func main () {
0 commit comments