mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-11 16:34:04 +02:00
Suppress warnings in DeviantartRipper and provide justification.
This commit is contained in:
@@ -224,7 +224,6 @@ public class DeviantartRipper extends AbstractHTMLRipper {
|
|||||||
logger.info("DA Cookies: " + getDACookie());
|
logger.info("DA Cookies: " + getDACookie());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns next page Document using offset.
|
* Returns next page Document using offset.
|
||||||
*/
|
*/
|
||||||
@@ -246,7 +245,6 @@ public class DeviantartRipper extends AbstractHTMLRipper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Http.url(urlWithParams(this.offset)).referrer(referer).userAgent(userAgent).cookies(getDACookie()).get();
|
return Http.url(urlWithParams(this.offset)).referrer(referer).userAgent(userAgent).cookies(getDACookie()).get();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -258,7 +256,6 @@ public class DeviantartRipper extends AbstractHTMLRipper {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected List<String> getURLsFromPage(Document page) {
|
protected List<String> getURLsFromPage(Document page) {
|
||||||
|
|
||||||
List<String> result = new ArrayList<String>();
|
List<String> result = new ArrayList<String>();
|
||||||
|
|
||||||
Element div;
|
Element div;
|
||||||
@@ -293,6 +290,11 @@ public class DeviantartRipper extends AbstractHTMLRipper {
|
|||||||
logger.info("Downloading URL Number " + this.downloadCount);
|
logger.info("Downloading URL Number " + this.downloadCount);
|
||||||
logger.info("Deviant Art URL: " + url.toExternalForm());
|
logger.info("Deviant Art URL: " + url.toExternalForm());
|
||||||
try {
|
try {
|
||||||
|
// Suppress this warning because it is part of code that was temporarily
|
||||||
|
// commented out to disable the behavior.
|
||||||
|
// We know there's a lot about this ripper that needs to be fixed so
|
||||||
|
// we're not too worried about warnings in this file.
|
||||||
|
@SuppressWarnings("unused")
|
||||||
Response re = Http.url(urlWithParams(this.offset)).cookies(getDACookie()).referrer(referer)
|
Response re = Http.url(urlWithParams(this.offset)).cookies(getDACookie()).referrer(referer)
|
||||||
.userAgent(userAgent).response();
|
.userAgent(userAgent).response();
|
||||||
//updateCookie(re.cookies());
|
//updateCookie(re.cookies());
|
||||||
@@ -319,7 +321,6 @@ public class DeviantartRipper extends AbstractHTMLRipper {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getGID(URL url) throws MalformedURLException {
|
public String getGID(URL url) throws MalformedURLException {
|
||||||
|
|
||||||
String s = url.toExternalForm();
|
String s = url.toExternalForm();
|
||||||
String artist = "unknown";
|
String artist = "unknown";
|
||||||
String what = "unknown";
|
String what = "unknown";
|
||||||
@@ -366,7 +367,6 @@ public class DeviantartRipper extends AbstractHTMLRipper {
|
|||||||
logger.info("Album Name: " + artist + "_" + what + "_" + albumname);
|
logger.info("Album Name: " + artist + "_" + what + "_" + albumname);
|
||||||
|
|
||||||
return artist + "_" + what + "_" + albumname;
|
return artist + "_" + what + "_" + albumname;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -413,7 +413,6 @@ public class DeviantartRipper extends AbstractHTMLRipper {
|
|||||||
* @param m new Cookies
|
* @param m new Cookies
|
||||||
*/
|
*/
|
||||||
private void updateCookie(Map<String, String> m) {
|
private void updateCookie(Map<String, String> m) {
|
||||||
|
|
||||||
if (m == null) {
|
if (m == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -439,7 +438,6 @@ public class DeviantartRipper extends AbstractHTMLRipper {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -470,8 +468,13 @@ public class DeviantartRipper extends AbstractHTMLRipper {
|
|||||||
private Map<String, String> deserialize(String s) throws IOException, ClassNotFoundException {
|
private Map<String, String> deserialize(String s) throws IOException, ClassNotFoundException {
|
||||||
byte[] data = Base64.getDecoder().decode(s);
|
byte[] data = Base64.getDecoder().decode(s);
|
||||||
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data));
|
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data));
|
||||||
HashMap<String, String> o = (HashMap<String, String>) ois.readObject(); // Unchecked cast here but should never
|
|
||||||
// be something else
|
// Suppress this warning because it's part of the legacy implementation.
|
||||||
|
// We know there's a lot about this ripper that needs to be fixed so
|
||||||
|
// we're not too worried about warnings in this file.
|
||||||
|
// Unchecked cast here but should never be something else.
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
HashMap<String, String> o = (HashMap<String, String>) ois.readObject();
|
||||||
ois.close();
|
ois.close();
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user