Fixed json parsing errors
This commit is contained in:
parent
5600b375b4
commit
5b5e86ed3b
@ -150,6 +150,8 @@ public class InstagramRipper extends AbstractHTMLRipper {
|
|||||||
" <body>", "");
|
" <body>", "");
|
||||||
t.replaceAll("</body>\n" +
|
t.replaceAll("</body>\n" +
|
||||||
"</html>", "");
|
"</html>", "");
|
||||||
|
t = t.replaceAll("\n", "");
|
||||||
|
t = t.replaceAll("=\"\"", "");
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,6 +354,7 @@ public class InstagramRipper extends AbstractHTMLRipper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean pageHasImages(Document doc) {
|
private boolean pageHasImages(Document doc) {
|
||||||
|
logger.info("BAD DATA: " + stripHTMLTags(doc.html()));
|
||||||
JSONObject json = new JSONObject(stripHTMLTags(doc.html()));
|
JSONObject json = new JSONObject(stripHTMLTags(doc.html()));
|
||||||
int numberOfImages = json.getJSONObject("data").getJSONObject("user")
|
int numberOfImages = json.getJSONObject("data").getJSONObject("user")
|
||||||
.getJSONObject("edge_owner_to_timeline_media").getJSONArray("edges").length();
|
.getJSONObject("edge_owner_to_timeline_media").getJSONArray("edges").length();
|
||||||
|
Loading…
Reference in New Issue
Block a user