(String urlString)
| 1349 | } |
| 1350 | |
| 1351 | private Thread ripAlbum(String urlString) { |
| 1352 | if (!logPanel.isVisible()) { |
| 1353 | optionLog.doClick(); |
| 1354 | } |
| 1355 | urlString = urlString.trim(); |
| 1356 | if (urlString.toLowerCase().startsWith("gonewild:")) { |
| 1357 | urlString = "http://gonewild.com/user/" + urlString.substring(urlString.indexOf(':') + 1); |
| 1358 | } |
| 1359 | if (!urlString.startsWith("http")) { |
| 1360 | urlString = "http://" + urlString; |
| 1361 | } |
| 1362 | URL url; |
| 1363 | try { |
| 1364 | url = new URI(urlString).toURL(); |
| 1365 | } catch (MalformedURLException | URISyntaxException e) { |
| 1366 | LOGGER.error("[!] Could not generate URL for '" + urlString + "'", e); |
| 1367 | error("Given URL is not valid, expecting http://website.com/page/..."); |
| 1368 | return null; |
| 1369 | } |
| 1370 | stopButton.setEnabled(true); |
| 1371 | statusProgress.setValue(100); |
| 1372 | openButton.setVisible(false); |
| 1373 | statusLabel.setVisible(true); |
| 1374 | pack(); |
| 1375 | boolean failed = false; |
| 1376 | try { |
| 1377 | ripper = AbstractRipper.getRipper(url); |
| 1378 | ripper.setup(); |
| 1379 | } catch (Exception e) { |
| 1380 | failed = true; |
| 1381 | LOGGER.error("Could not find ripper for URL " + url, e); |
| 1382 | error(e.getMessage()); |
| 1383 | } |
| 1384 | if (!failed) { |
| 1385 | try { |
| 1386 | mainFrame.setTitle("Ripping - RipMe v" + UpdateUtils.getThisJarVersion()); |
| 1387 | status("Starting rip..."); |
| 1388 | ripper.setObserver(this); |
| 1389 | Thread t = new Thread(ripper); |
| 1390 | if (configShowPopup.isSelected() && (!mainFrame.isVisible() || !mainFrame.isActive())) { |
| 1391 | try { |
| 1392 | mainFrame.toFront(); |
| 1393 | mainFrame.setAlwaysOnTop(true); |
| 1394 | trayIcon.displayMessage(mainFrame.getTitle(), "Started ripping " + ripper.getURL().toExternalForm(), |
| 1395 | MessageType.INFO); |
| 1396 | mainFrame.setAlwaysOnTop(false); |
| 1397 | } catch (NullPointerException e) { |
| 1398 | LOGGER.error("Could not send popup, are tray icons supported?"); |
| 1399 | } |
| 1400 | } |
| 1401 | return t; |
| 1402 | } catch (Exception e) { |
| 1403 | LOGGER.error("[!] Error while ripping: " + e.getMessage(), e); |
| 1404 | error("Unable to rip this URL: " + e.getMessage()); |
| 1405 | } |
| 1406 | } |
| 1407 | stopButton.setEnabled(false); |
| 1408 | statusProgress.setValue(0); |
no test coverage detected