mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-01-18 05:08:15 +01:00
This commit is contained in:
parent
5912eb9c8a
commit
fad35d1afb
@ -183,6 +183,7 @@ public abstract class AbstractRipper
|
||||
if (!subdirectory.equals("")) {
|
||||
subdirectory = File.separator + subdirectory;
|
||||
}
|
||||
prefix = Utils.filesystemSanitized(prefix);
|
||||
saveFileAs = new File(
|
||||
workingDir.getCanonicalPath()
|
||||
+ subdirectory
|
||||
|
@ -144,6 +144,7 @@ public class InstagramRipper extends AbstractHTMLRipper {
|
||||
Long epoch = data.getLong("date");
|
||||
Instant instant = Instant.ofEpochSecond(epoch);
|
||||
String image_date = DateTimeFormatter.ofPattern("yyyy_MM_dd_hh:mm_").format(ZonedDateTime.ofInstant(instant, ZoneOffset.UTC));
|
||||
|
||||
try {
|
||||
if (!data.getBoolean("is_video")) {
|
||||
if (imageURLs.size() == 0) {
|
||||
@ -158,8 +159,8 @@ public class InstagramRipper extends AbstractHTMLRipper {
|
||||
} catch (MalformedURLException e) {
|
||||
return imageURLs;
|
||||
}
|
||||
nextPageID = data.getString("id");
|
||||
|
||||
nextPageID = data.getString("id");
|
||||
|
||||
if (isThisATest()) {
|
||||
break;
|
||||
|
@ -355,6 +355,11 @@ public class Utils {
|
||||
+ path.substring(path.length() - SHORTENED_PATH_LENGTH);
|
||||
}
|
||||
|
||||
public static String filesystemSanitized(String text) {
|
||||
text = text.replaceAll("[^a-zA-Z0-9.-]", "_");
|
||||
return text;
|
||||
}
|
||||
|
||||
public static String filesystemSafe(String text) {
|
||||
text = text.replaceAll("[^a-zA-Z0-9.-]", "_")
|
||||
.replaceAll("__", "_")
|
||||
|
Loading…
x
Reference in New Issue
Block a user