File tree 1 file changed +20
-3
lines changed
1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -365,6 +365,19 @@ public function setObeyRobots($bool = true)
365
365
366
366
return $ this ;
367
367
}
368
+
369
+ /**
370
+ * Set value to 1 to force the use of proxy IPs for the crawl.
371
+ *
372
+ * @param bool $bool
373
+ * @return $this
374
+ */
375
+ public function setUseProxies ($ bool = true )
376
+ {
377
+ $ this ->otherOptions ['useProxies ' ] = (int )(bool )$ bool ;
378
+
379
+ return $ this ;
380
+ }
368
381
369
382
/**
370
383
* Force the start of a new crawl "round" (manually repeat the crawl).
@@ -488,13 +501,17 @@ public function buildUrl()
488
501
$ url .= '&name= ' . $ this ->getName ();
489
502
490
503
// Add seeds
491
- $ url .= '&seeds= ' . implode (' ' , array_map (function ($ item ) {
504
+ if (!empty ($ this ->seeds )) {
505
+ $ url .= '&seeds= ' . implode (' ' , array_map (function ($ item ) {
492
506
return urlencode ($ item );
493
507
}, $ this ->seeds ));
508
+ }
494
509
495
510
// Add other options
496
- foreach ($ this ->otherOptions as $ option => $ value ) {
497
- $ url .= '& ' . $ option . '= ' . $ value ;
511
+ if (!empty ($ this ->otherOptions )) {
512
+ foreach ($ this ->otherOptions as $ option => $ value ) {
513
+ $ url .= '& ' . $ option . '= ' . $ value ;
514
+ }
498
515
}
499
516
500
517
// Add API link
You can’t perform that action at this time.
0 commit comments