1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-19 20:21:52 +02:00

Instagram ripper renewed

Hash extraction fixed
'switch' blocks code style fixed
This commit is contained in:
taurhel
2019-06-19 00:06:31 +03:00
parent 430046e1ba
commit e62e347794

View File

@@ -120,6 +120,8 @@ public class InstagramRipper extends AbstractJSONRipper {
return "post_" + urlMatcher.group("shortcode");
case USER_PROFILE:
return urlMatcher.group("username");
default:
throw new RuntimeException("Reached unreachable");
}
}
}
@@ -175,7 +177,7 @@ public class InstagramRipper extends AbstractJSONRipper {
if ((storiesRip || pinnedReelRip) && href.contains("Consumer.js")) {
pattern = Pattern.compile(storiesRegex);
break;
} else if (href.contains("ProfilePageContainer") || href.contains("TagPageContainer")) {
} else if (href.contains("ProfilePageContainer.js") || href.contains("TagPageContainer.js")) {
pattern = Pattern.compile(pinnedRip ? pinnedRegex :
format(hashRegex, hashtagRip ? forHashtag : taggedRip ? forTagged : forUser));
break;
@@ -357,8 +359,9 @@ public class InstagramRipper extends AbstractJSONRipper {
JSONArray sideCar = getJsonArrayByPath(mediaItem, "edge_sidecar_to_children.edges");
return getStreamOfJsonArray(sideCar).map(object -> object.getJSONObject("node"))
.flatMap(this::parseRootForUrls);
default:
return Stream.empty();
}
return Stream.empty();
}
private String getVideoUrlFromPage(String videoID) {