Fixing configuration so it works from JARs

This commit is contained in:
4pr0n 2014-03-24 08:02:32 -07:00
parent 42c0473e3d
commit 01bc94ae0b
4 changed files with 9 additions and 2 deletions

View File

@ -290,6 +290,8 @@ public abstract class AbstractRipper
AbstractRipper ripper = (AbstractRipper) constructor.newInstance(url);
return ripper;
} catch (Exception e) {
System.err.println(constructor.getName());
e.printStackTrace();
// Incompatible rippers *will* throw exceptions during instantiation.
}
}

View File

@ -47,8 +47,9 @@ public class MotherlessRipper extends AbstractRipper {
@Override
public String getGID(URL url) throws MalformedURLException {
Pattern p = Pattern.compile("^https?://(www\\.)?motherless\\.com/G([VI][A-F0-9]{6,8}).*$");
Pattern p = Pattern.compile("^https?://(www\\.)?motherless\\.com/G([MVI][A-F0-9]{6,8}).*$");
Matcher m = p.matcher(url.toExternalForm());
System.err.println(url.toExternalForm());
if (!m.matches()) {
throw new MalformedURLException("Expected URL format: http://motherless.com/GIXXXXXXX, got: " + url);
}

View File

@ -356,6 +356,10 @@ public class MainWindow implements Runnable, RipStatusHandler {
} catch (Exception e) {
logger.error("[!] Error while ripping: " + e.getMessage(), e);
status("Error: " + e.getMessage());
ripButton.setEnabled(true);
ripTextfield.setEnabled(true);
statusProgress.setValue(0);
mainFrame.pack();
return null;
}
}

View File

@ -20,7 +20,7 @@ import org.apache.log4j.Logger;
public class Utils {
public static final String RIP_DIRECTORY = "rips";
private static final File configFile = new File("src/main/resources/rip.properties");
private static final String configFile = "rip.properties";
private static final Logger logger = Logger.getLogger(Utils.class);
private static Configuration config;