mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Fix images download from magiccards.info
This commit is contained in:
parent
3cd9dc3bf6
commit
61cad91f9b
1 changed files with 2 additions and 1 deletions
|
@ -24,6 +24,7 @@ import java.util.HashSet;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import javax.imageio.IIOImage;
|
||||
|
@ -572,7 +573,7 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
|
|||
// Logger.getLogger(this.getClass()).info(url.toString());
|
||||
URLConnection httpConn = url.openConnection(p);
|
||||
// images download from magiccards.info may not work with default 'User-Agent: Java/1.x.x' request header
|
||||
httpConn.setRequestProperty("User-Agent", "");
|
||||
httpConn.setRequestProperty("User-Agent", UUID.randomUUID().toString());
|
||||
httpConn.connect();
|
||||
int responseCode = ((HttpURLConnection) httpConn).getResponseCode();
|
||||
if (responseCode == 200) {
|
||||
|
|
Loading…
Reference in a new issue