Skip to content

Commit 9662063

Browse files
author
nicol
committed
source clean
1 parent 4310f35 commit 9662063

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

src/main/java/org/magic/api/wallpaper/impl/DanbooruWallpaperProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private MTGWallpaper parseJson(JsonObject el) {
9494
pic.setUrl(URI.create(el.get("large_file_url").getAsString()));
9595
pic.setPublishDate(Date.from(OffsetDateTime.parse(el.get("updated_at").getAsString()).toInstant()));
9696
pic.setUserAgent(userAgent);
97-
97+
pic.setMature(true);
9898

9999
for(var s : el.get("tag_string").getAsString().split(" "))
100100
pic.getTags().add(s);

src/main/java/org/magic/services/providers/ImagePoster.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,14 @@ public class ImagePoster {
1515

1616
public static String upload(String wallUrl) throws IOException {
1717
var baseUrl = "https://postimages.org/";
18-
19-
var uploadSession = new Date().getTime() + Double.toString(Math.random()).substring(1);
2018
var client = URLTools.newClient();
21-
2219
var jsonRet = RequestBuilder.build().setClient(client).post().url(baseUrl+"/json/rr")
2320
.addHeader("x-requested-with","XMLHttpRequest")
2421
.addHeader(URLTools.ORIGIN, baseUrl)
2522
.addHeader(URLTools.REFERER, baseUrl+"/web")
2623
.addHeader(URLTools.ACCEPT, URLTools.HEADER_JSON)
2724
.addHeader("Cache-Control", "no-cache")
28-
.addContent("upload_session", uploadSession)
25+
.addContent("upload_session", new Date().getTime() + Double.toString(Math.random()).substring(1))
2926
.addContent("optsize", "0")
3027
.addContent("expire", "1")
3128
.addContent("url", wallUrl)

0 commit comments

Comments
 (0)