@@ -21,13 +21,14 @@ import (
21
21
)
22
22
23
23
type Flags struct {
24
- Open bool
25
- Serve bool
26
- ServePort int
27
- UserAgent string
28
- ProxyString string
29
- Cookies bool
30
- Robots bool
24
+ Open bool
25
+ Serve bool
26
+ ServePort int
27
+ UserAgent string
28
+ ProxyString string
29
+ Cookies bool
30
+ Robots bool
31
+ BrowserEndpoint string
31
32
}
32
33
33
34
type filesBase struct {
@@ -72,6 +73,12 @@ func CloneSite(ctx context.Context, args []string, flag Flags) error {
72
73
if flag .ProxyString != "" {
73
74
geziyorOptions .ProxyFunc = client .RoundRobinProxy (flag .ProxyString )
74
75
}
76
+ if flag .BrowserEndpoint != "" {
77
+ geziyorOptions .BrowserEndpoint = flag .BrowserEndpoint
78
+ geziyorOptions .StartRequestsFunc = func (g * geziyor.Geziyor ) {
79
+ g .GetRendered (domain , g .Opt .ParseFunc )
80
+ }
81
+ }
75
82
76
83
geziyor .NewGeziyor (geziyorOptions ).Start ()
77
84
@@ -119,8 +126,7 @@ func quotesParse(g *geziyor.Geziyor, r *client.Response) {
119
126
fmt .Println ("Css found" , "-->" , parsedURL )
120
127
if ! files .css .Contains (parsedURL .Path ) {
121
128
files .css = append (files .css , parsedURL .Path )
122
- netutil .Extractor (projectURL .String ()+ parsedURL .Path , projectPath )
123
-
129
+ go netutil .Extractor (projectURL .String ()+ parsedURL .Path , projectPath )
124
130
g .Get (r .JoinURL (projectURL .String ()+ parsedURL .Path ), parseCSS )
125
131
}
126
132
@@ -142,7 +148,7 @@ func quotesParse(g *geziyor.Geziyor, r *client.Response) {
142
148
fmt .Println ("Js found" , "-->" , parsedURL )
143
149
if ! files .js .Contains (parsedURL .Path ) {
144
150
files .js = append (files .js , parsedURL .Path )
145
- netutil .Extractor (projectURL .String ()+ parsedURL .Path , projectPath )
151
+ go netutil .Extractor (projectURL .String ()+ parsedURL .Path , projectPath )
146
152
}
147
153
148
154
body = strings .Replace (body , data , "/assets/js/" + filepath .Base (data ), - 1 )
@@ -162,7 +168,7 @@ func quotesParse(g *geziyor.Geziyor, r *client.Response) {
162
168
fmt .Println ("Js found" , "-->" , parsedURL )
163
169
if ! files .js .Contains (parsedURL .Path ) {
164
170
files .js = append (files .js , parsedURL .Path )
165
- netutil .Extractor (projectURL .String ()+ parsedURL .Path , projectPath )
171
+ go netutil .Extractor (projectURL .String ()+ parsedURL .Path , projectPath )
166
172
}
167
173
168
174
body = strings .Replace (body , data , "/assets/js/" + filepath .Base (data ), - 1 )
@@ -186,7 +192,7 @@ func quotesParse(g *geziyor.Geziyor, r *client.Response) {
186
192
fmt .Println ("Img found" , "-->" , parsedURL )
187
193
if ! files .img .Contains (parsedURL .Path ) {
188
194
files .img = append (files .img , parsedURL .Path )
189
- netutil .Extractor (projectURL .String ()+ parsedURL .Path , projectPath )
195
+ go netutil .Extractor (projectURL .String ()+ parsedURL .Path , projectPath )
190
196
}
191
197
192
198
body = strings .Replace (body , data , "/assets/img/" + filepath .Base (data ), - 1 )
0 commit comments