Undid saveAs sanitation in album ripper

This commit is contained in:
cyian-1756 2018-02-11 10:01:21 -05:00
parent 678b810828
commit 639a0353a6

View File

@ -51,14 +51,6 @@ public abstract class AlbumRipper extends AbstractRipper {
* Queues multiple URLs of single images to download from a single Album URL * Queues multiple URLs of single images to download from a single Album URL
*/ */
public boolean addURLToDownload(URL url, File saveAs, String referrer, Map<String,String> cookies) { public boolean addURLToDownload(URL url, File saveAs, String referrer, Map<String,String> cookies) {
// TODO fix this hack
// Sanitize the saveAs file
String fileName = saveAs.getPath();
if (fileName.indexOf('?') >= 0) { fileName = fileName.substring(0, fileName.indexOf('?')); }
if (fileName.indexOf('&') >= 0) { fileName = fileName.substring(0, fileName.indexOf('&')); }
if (fileName.indexOf(':') >= 0) { fileName = fileName.substring(0, fileName.indexOf(':')); }
if (fileName.indexOf('#') >= 0) { fileName = fileName.substring(0, fileName.indexOf('#')); }
saveAs = new File(fileName);
// Only download one file if this is a test. // Only download one file if this is a test.
if (super.isThisATest() && if (super.isThisATest() &&
(itemsPending.size() > 0 || itemsCompleted.size() > 0 || itemsErrored.size() > 0)) { (itemsPending.size() > 0 || itemsCompleted.size() > 0 || itemsErrored.size() > 0)) {