mirror of
https://github.com/dev-claw/vripper-project.git
synced 2026-08-19 08:35:41 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2483c5fa00 | ||
|
|
dfc5810fd3 | ||
|
|
fad418134e | ||
|
|
9dd91bfc07 | ||
|
|
5bd42e2ce5 | ||
|
|
e18832b154 | ||
|
|
41feb53a83 | ||
|
|
6f166b42c4 | ||
|
|
e8ee579a37 | ||
|
|
41ce99995b | ||
|
|
5caeef0e70 | ||
|
|
96ef0cb234 | ||
|
|
641b3e3e7b | ||
|
|
08de4dc5b0 |
+25
-1
@@ -1,12 +1,36 @@
|
||||
# Changelog
|
||||
|
||||
## [3.4.0] - 2021-05-09
|
||||
## [3.5.2] - 2021-05-24
|
||||
|
||||
### Changed
|
||||
|
||||
- Update donation infos
|
||||
|
||||
## [3.5.1] - 2021-05-22
|
||||
|
||||
### Changed
|
||||
|
||||
- Bug fix
|
||||
|
||||
## [3.5.0] - 2021-05-21
|
||||
|
||||
### Changed
|
||||
|
||||
- Download queue bug fix
|
||||
- Save window size and position
|
||||
- Resize confirmation box
|
||||
- Enhance metadata interruption
|
||||
- Add Added on and Order columns
|
||||
|
||||
## [3.4.2] - 2021-05-10
|
||||
|
||||
### Changed
|
||||
|
||||
- Fix potential issue with imagebam host
|
||||
- Enhance download queue logic
|
||||
- Code source enhancements
|
||||
- Fix app icons
|
||||
- Fix race condition bug
|
||||
|
||||
## [3.3.8] - 2021-05-05
|
||||
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
# VRipper!
|
||||
|
||||
This is my spin for a cross platform gallery ripper app for [vipergirls](https://vipergirls.to) website.
|
||||
The purpose of this project is to build a robust and clean application to conveniently download photo galleries using modern web technologies, Java + Spring boot for the back end and angular + electron for the front end.
|
||||
This is my spin for a cross platform gallery ripper app for [vipergirls](https://vipergirls.to) website. The purpose of
|
||||
this project is to build a robust and clean application to conveniently download photo galleries using modern web
|
||||
technologies, Java + Spring boot for the back end and angular + electron for the front end.
|
||||
|
||||
## How to build
|
||||
|
||||
You need a recent version of maven 3.6.1+.
|
||||
|
||||
The application support 2 build modes:
|
||||
- Desktop app: Self contained app, built with electron includes Java runtimes.
|
||||
- Server app: Depends on Java runtimes, you need a web browser to access the app UI.
|
||||
|
||||
Most people will be interested only on the desktop app, however if you have a nas or a server, the server app is there for you.
|
||||
- Desktop app: Self contained app, built with electron includes Java runtimes.
|
||||
- Server app: Depends on Java runtimes, you need a web browser to access the app UI.
|
||||
|
||||
Most people will be interested only on the desktop app, however if you have a nas or a server, the server app is there
|
||||
for you.
|
||||
|
||||
To build the server app:
|
||||
|
||||
@@ -25,6 +29,7 @@ version of nodejs on your system.
|
||||
|
||||
If you feel generous and want to support me, you can donate some coins, and I would be very grateful 🙏
|
||||
|
||||
I accept Bitcoin (BTC) for donations, following is my address
|
||||
I accept [PayPal](https://www.paypal.com/myaccount/transfer/homepage/buy/preview) donations, following is my email
|
||||
address
|
||||
|
||||
bc1q9jzzw3st49r9vmxgtylq4vrd67cl7zfclf3lsq
|
||||
dev.vripper@gmail.com
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>tn.mnlr</groupId>
|
||||
<artifactId>vripper</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<version>3.5.2</version>
|
||||
<packaging>pom</packaging>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -7,6 +7,7 @@ const {spawn} = require("child_process");
|
||||
const {ipcMain} = require("electron");
|
||||
const {dialog} = require("electron");
|
||||
const axios = require('axios');
|
||||
const windowStateKeeper = require('electron-window-state');
|
||||
|
||||
// non null value when it is an AppImage
|
||||
const appImageDir = process.env.APPDIR;
|
||||
@@ -29,18 +30,26 @@ process.on("uncaughtException", err => {
|
||||
createWindow = () => {
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
app.setAppUserModelId("tn.mnlr.vripper");
|
||||
app.setAppUserModelId('tn.mnlr.vripper');
|
||||
}
|
||||
|
||||
let icon;
|
||||
if (process.platform === "win32") {
|
||||
if (process.platform === 'win32') {
|
||||
icon = __dirname + '/icon.ico';
|
||||
} else {
|
||||
} else if (process.platform === 'linux') {
|
||||
icon = __dirname + '/icon.png';
|
||||
}
|
||||
|
||||
const mainWindowState = windowStateKeeper({
|
||||
defaultWidth: 1024,
|
||||
defaultHeight: 800
|
||||
});
|
||||
|
||||
win = new BrowserWindow({
|
||||
width: 1024,
|
||||
height: 800,
|
||||
x: mainWindowState.x,
|
||||
y: mainWindowState.y,
|
||||
width: mainWindowState.width,
|
||||
height: mainWindowState.height,
|
||||
minWidth: 800,
|
||||
minHeight: 600,
|
||||
webPreferences: {
|
||||
@@ -50,6 +59,7 @@ createWindow = () => {
|
||||
icon: icon
|
||||
});
|
||||
|
||||
mainWindowState.manage(win);
|
||||
win.removeMenu();
|
||||
win.setMenu(null);
|
||||
win.setMenuBarVisibility(false);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vripper-electron",
|
||||
"version": "3.4.0",
|
||||
"version": "3.5.2",
|
||||
"description": "A ripper for vipergirls.to built using web technolgies",
|
||||
"main": "main.js",
|
||||
"author": "death-claw <53543762+death-claw@users.noreply.github.com>",
|
||||
@@ -51,7 +51,6 @@
|
||||
"synopsis": "vipergirls.to ripper",
|
||||
"category": "Utility",
|
||||
"packageCategory": "Utility",
|
||||
"icon": "icons",
|
||||
"target": [
|
||||
"AppImage"
|
||||
]
|
||||
@@ -77,6 +76,7 @@
|
||||
"cheerio": "1.0.0-rc.3",
|
||||
"copy-dir": "1.3.0",
|
||||
"electron-context-menu": "2.1.0",
|
||||
"electron-window-state": "^5.0.3",
|
||||
"get-port": "5.1.1",
|
||||
"rimraf": "3.0.2",
|
||||
"v8-compile-cache": "2.1.1"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>tn.mnlr</groupId>
|
||||
<artifactId>vripper</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<version>3.5.2</version>
|
||||
</parent>
|
||||
<artifactId>vripper-electron</artifactId>
|
||||
<name>vripper-electron</name>
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="web" name="Web">
|
||||
<configuration>
|
||||
<webroots />
|
||||
</configuration>
|
||||
</facet>
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
|
||||
+286
-278
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>tn.mnlr</groupId>
|
||||
<artifactId>vripper</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<version>3.5.2</version>
|
||||
</parent>
|
||||
<artifactId>vripper-server</artifactId>
|
||||
<name>vripper-server</name>
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import tn.mnlr.vripper.jpa.repositories.IPostRepository;
|
||||
import tn.mnlr.vripper.services.DataService;
|
||||
|
||||
@Component
|
||||
public class EventListenerBean {
|
||||
@@ -13,15 +14,18 @@ public class EventListenerBean {
|
||||
@Getter private static boolean init = false;
|
||||
|
||||
private final IPostRepository postRepository;
|
||||
private final DataService dataService;
|
||||
|
||||
@Autowired
|
||||
public EventListenerBean(IPostRepository postRepository) {
|
||||
public EventListenerBean(IPostRepository postRepository, DataService dataService) {
|
||||
this.postRepository = postRepository;
|
||||
this.dataService = dataService;
|
||||
}
|
||||
|
||||
@EventListener
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
postRepository.setDownloadingToStopped();
|
||||
dataService.sortPostsByRank();
|
||||
init = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class DownloadJob implements CheckedRunnable {
|
||||
@Getter private final Image image;
|
||||
@Getter private final Post post;
|
||||
private volatile boolean stopped = false;
|
||||
@Getter private boolean finished = false;
|
||||
@Getter private volatile boolean finished = false;
|
||||
|
||||
DownloadJob(Post post, Image image, Settings settings) {
|
||||
this.image = image;
|
||||
|
||||
@@ -9,7 +9,7 @@ import tn.mnlr.vripper.jpa.domain.Image;
|
||||
import tn.mnlr.vripper.jpa.domain.Post;
|
||||
import tn.mnlr.vripper.jpa.domain.enums.Status;
|
||||
import tn.mnlr.vripper.services.DataService;
|
||||
import tn.mnlr.vripper.services.PostService;
|
||||
import tn.mnlr.vripper.services.MetadataService;
|
||||
import tn.mnlr.vripper.services.SettingsService;
|
||||
import tn.mnlr.vripper.services.domain.Settings;
|
||||
|
||||
@@ -20,38 +20,36 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DownloadService {
|
||||
|
||||
private static final List<Status> FINISHED =
|
||||
Arrays.asList(Status.ERROR, Status.COMPLETE, Status.STOPPED);
|
||||
private final int MAX_POOL_SIZE = 12;
|
||||
|
||||
private final ConcurrentHashMap<Host, AtomicInteger> threadCount = new ConcurrentHashMap<>();
|
||||
private final ExecutorService executor = Executors.newFixedThreadPool(MAX_POOL_SIZE);
|
||||
private final List<DownloadJob> running = Collections.synchronizedList(new ArrayList<>());
|
||||
private final List<DownloadJob> running = new ArrayList<>();
|
||||
private final List<DownloadJob> pending = new ArrayList<>();
|
||||
|
||||
private final SettingsService settingsService;
|
||||
private final DataService dataService;
|
||||
private final PostService postService;
|
||||
private final MetadataService metadataService;
|
||||
|
||||
private final List<Host> hosts;
|
||||
|
||||
private boolean pauseQ = false;
|
||||
private Thread pollThread;
|
||||
|
||||
@Autowired
|
||||
public DownloadService(
|
||||
SettingsService settingsService,
|
||||
DataService dataService,
|
||||
PostService postService,
|
||||
MetadataService metadataService,
|
||||
List<Host> hosts) {
|
||||
this.settingsService = settingsService;
|
||||
this.dataService = dataService;
|
||||
this.postService = postService;
|
||||
this.metadataService = metadataService;
|
||||
this.hosts = hosts;
|
||||
}
|
||||
|
||||
@@ -75,7 +73,7 @@ public class DownloadService {
|
||||
executor.awaitTermination(5, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
private void stopRunning(@NonNull String postId) {
|
||||
private synchronized void stopRunning(@NonNull String postId) {
|
||||
List<DownloadJob> stopping = new ArrayList<>();
|
||||
Iterator<DownloadJob> iterator = running.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -90,71 +88,73 @@ public class DownloadService {
|
||||
while (!stopping.isEmpty()) {
|
||||
stopping.removeIf(DownloadJob::isFinished);
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void stopAll(List<String> posIds) {
|
||||
if (posIds != null) {
|
||||
posIds.forEach(this::stop);
|
||||
} else {
|
||||
dataService.findAllPosts().forEach(p -> this.stop(p.getPostId()));
|
||||
}
|
||||
public void stopAll(List<String> postIds) {
|
||||
stop(
|
||||
Objects.requireNonNullElseGet(
|
||||
postIds,
|
||||
() ->
|
||||
dataService.findAllPosts().stream()
|
||||
.map(Post::getPostId)
|
||||
.collect(Collectors.toList())));
|
||||
}
|
||||
|
||||
public void restartAll(List<String> posIds) {
|
||||
if (posIds != null) {
|
||||
posIds.forEach(this::restart);
|
||||
} else {
|
||||
dataService.findAllPosts().forEach(p -> this.restart(p.getPostId()));
|
||||
}
|
||||
restart(
|
||||
Objects.requireNonNullElseGet(
|
||||
posIds,
|
||||
() ->
|
||||
dataService.findAllPosts().stream()
|
||||
.map(Post::getPostId)
|
||||
.collect(Collectors.toList())));
|
||||
}
|
||||
|
||||
private void restart(@NonNull String postId) {
|
||||
if (isPending(postId)) {
|
||||
log.warn(String.format("Cannot restart, jobs are currently running for post id %s", postId));
|
||||
return;
|
||||
private void restart(@NonNull List<String> postIds) {
|
||||
Map<Post, Collection<Image>> data = new HashMap<>();
|
||||
for (String postId : postIds) {
|
||||
if (isPending(postId)) {
|
||||
log.warn(
|
||||
String.format("Cannot restart, jobs are currently running for post id %s", postIds));
|
||||
continue;
|
||||
}
|
||||
List<Image> images = dataService.findByPostIdAndIsNotCompleted(postId);
|
||||
if (images.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
Post post = dataService.findPostByPostId(postId).orElseThrow();
|
||||
log.debug(String.format("Restarting %d jobs for post id %s", images.size(), postIds));
|
||||
data.put(post, images);
|
||||
}
|
||||
List<Image> images = dataService.findByPostIdAndIsNotCompleted(postId);
|
||||
if (images.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Post post = dataService.findPostByPostId(postId).orElseThrow();
|
||||
post.setStatus(Status.PENDING);
|
||||
dataService.updatePostStatus(post.getStatus(), post.getId());
|
||||
log.debug(String.format("Restarting %d jobs for post id %s", images.size(), postId));
|
||||
enqueue(post, images);
|
||||
enqueue(data);
|
||||
}
|
||||
|
||||
private boolean isPending(String postId) {
|
||||
private synchronized boolean isPending(String postId) {
|
||||
return pending.stream().anyMatch(p -> p.getPost().getPostId().equals(postId));
|
||||
}
|
||||
|
||||
private boolean isRunning(String postId) {
|
||||
private synchronized boolean isRunning(String postId) {
|
||||
return running.stream().anyMatch(p -> p.getPost().getPostId().equals(postId));
|
||||
}
|
||||
|
||||
private void stop(String postId) {
|
||||
try {
|
||||
pauseQ = true;
|
||||
private synchronized void stop(List<String> postIds) {
|
||||
|
||||
for (String postId : postIds) {
|
||||
final Post post = dataService.findPostByPostId(postId).orElseThrow();
|
||||
if (post == null) {
|
||||
return;
|
||||
}
|
||||
if (FINISHED.contains(post.getStatus())) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
pending.removeIf(p -> p.getPost().equals(post));
|
||||
stopRunning(postId);
|
||||
dataService.stopImagesByPostIdAndIsNotCompleted(postId);
|
||||
dataService.finishPost(post);
|
||||
postService.stopFetchingMetadata(post);
|
||||
} finally {
|
||||
pauseQ = false;
|
||||
}
|
||||
metadataService.stopFetchingMetadata(postIds);
|
||||
}
|
||||
|
||||
private boolean canRun(Host host) {
|
||||
@@ -165,7 +165,7 @@ public class DownloadService {
|
||||
&& (settingsService.getSettings().getMaxTotalThreads() == 0
|
||||
? totalRunning < MAX_POOL_SIZE
|
||||
: totalRunning < settingsService.getSettings().getMaxTotalThreads());
|
||||
if (canRun && !pauseQ) {
|
||||
if (canRun) {
|
||||
threadCount.get(host).incrementAndGet();
|
||||
return true;
|
||||
}
|
||||
@@ -204,19 +204,23 @@ public class DownloadService {
|
||||
return candidates;
|
||||
}
|
||||
|
||||
public void enqueue(Post post, Collection<Image> imageList) {
|
||||
public void enqueue(Map<Post, Collection<Image>> images) {
|
||||
synchronized (this) {
|
||||
for (Image image : imageList) {
|
||||
log.debug(String.format("Enqueuing a job for %s", image.getUrl()));
|
||||
image.init();
|
||||
dataService.updateImageStatus(image.getStatus(), image.getId());
|
||||
dataService.updateImageCurrent(image.getCurrent(), image.getId());
|
||||
DownloadJob downloadJob =
|
||||
new DownloadJob(post, image, (Settings) settingsService.getSettings().clone());
|
||||
pending.add(downloadJob);
|
||||
for (Map.Entry<Post, Collection<Image>> entry : images.entrySet()) {
|
||||
entry.getKey().setStatus(Status.PENDING);
|
||||
dataService.updatePostStatus(entry.getKey().getStatus(), entry.getKey().getId());
|
||||
for (Image image : entry.getValue()) {
|
||||
log.debug(String.format("Enqueuing a job for %s", image.getUrl()));
|
||||
image.init();
|
||||
dataService.updateImageStatus(image.getStatus(), image.getId());
|
||||
dataService.updateImageCurrent(image.getCurrent(), image.getId());
|
||||
DownloadJob downloadJob =
|
||||
new DownloadJob(
|
||||
entry.getKey(), image, (Settings) settingsService.getSettings().clone());
|
||||
pending.add(downloadJob);
|
||||
}
|
||||
}
|
||||
pending.sort(Comparator.comparing(e -> e.getPost().getAddedOn()));
|
||||
|
||||
this.notify();
|
||||
}
|
||||
}
|
||||
@@ -245,7 +249,7 @@ public class DownloadService {
|
||||
}
|
||||
}
|
||||
|
||||
private void push(DownloadJob downloadJob) {
|
||||
private synchronized void push(DownloadJob downloadJob) {
|
||||
log.debug(String.format("Scheduling a job for %s", downloadJob.getImage().getUrl()));
|
||||
executor.execute(new DownloadJobWrapper(downloadJob));
|
||||
running.add(downloadJob);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package tn.mnlr.vripper.jpa.domain;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
public class DateTimeSerializer extends StdSerializer<LocalDateTime> {
|
||||
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER =
|
||||
DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss.SSS");
|
||||
|
||||
protected DateTimeSerializer() {
|
||||
super(LocalDateTime.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(LocalDateTime value, JsonGenerator gen, SerializerProvider provider)
|
||||
throws IOException {
|
||||
gen.writeString(value.format(DATE_TIME_FORMATTER));
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,12 @@
|
||||
package tn.mnlr.vripper.jpa.domain;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -55,19 +50,3 @@ public class LogEvent {
|
||||
ERROR
|
||||
}
|
||||
}
|
||||
|
||||
class DateTimeSerializer extends StdSerializer<LocalDateTime> {
|
||||
|
||||
private static final DateTimeFormatter DATE_TIME_FORMATTER =
|
||||
DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss.SSS");
|
||||
|
||||
protected DateTimeSerializer() {
|
||||
super(LocalDateTime.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(LocalDateTime value, JsonGenerator gen, SerializerProvider provider)
|
||||
throws IOException {
|
||||
gen.writeString(value.format(DATE_TIME_FORMATTER));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package tn.mnlr.vripper.jpa.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
@@ -50,6 +51,9 @@ public class Post {
|
||||
|
||||
private Metadata metadata;
|
||||
|
||||
private int rank = Integer.MAX_VALUE;
|
||||
|
||||
@JsonSerialize(using = DateTimeSerializer.class)
|
||||
private LocalDateTime addedOn;
|
||||
|
||||
public Post(
|
||||
|
||||
@@ -33,4 +33,6 @@ public interface IPostRepository extends IRepository {
|
||||
int updateTitle(String title, Long id);
|
||||
|
||||
int updateThanked(boolean thanked, Long id);
|
||||
|
||||
int updateRank(int rank, Long id);
|
||||
}
|
||||
|
||||
+12
-2
@@ -38,7 +38,7 @@ public class PostRepository implements IPostRepository {
|
||||
public Post save(Post post) {
|
||||
long id = nextId();
|
||||
jdbcTemplate.update(
|
||||
"INSERT INTO POST (ID, DONE, FORUM, HOSTS, POST_FOLDER_NAME, POST_ID, PREVIEWS, SECURITY_TOKEN, STATUS, THANKED, THREAD_ID, THREAD_TITLE, TITLE, TOTAL, URL, ADDED_ON) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
|
||||
"INSERT INTO POST (ID, DONE, FORUM, HOSTS, POST_FOLDER_NAME, POST_ID, PREVIEWS, SECURITY_TOKEN, STATUS, THANKED, THREAD_ID, THREAD_TITLE, TITLE, TOTAL, URL, ADDED_ON, RANK) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
|
||||
id,
|
||||
post.getDone(),
|
||||
post.getForum(),
|
||||
@@ -54,7 +54,8 @@ public class PostRepository implements IPostRepository {
|
||||
post.getTitle(),
|
||||
post.getTotal(),
|
||||
post.getUrl(),
|
||||
Timestamp.valueOf(post.getAddedOn()));
|
||||
Timestamp.valueOf(post.getAddedOn()),
|
||||
post.getRank());
|
||||
post.setId(id);
|
||||
eventBus.publishEvent(Event.wrap(Event.Kind.POST_UPDATE, id));
|
||||
return post;
|
||||
@@ -172,6 +173,14 @@ public class PostRepository implements IPostRepository {
|
||||
eventBus.publishEvent(Event.wrap(Event.Kind.POST_UPDATE, id));
|
||||
return mutationCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateRank(int rank, Long id) {
|
||||
int mutationCount =
|
||||
jdbcTemplate.update("UPDATE POST AS post SET post.RANK = ? WHERE post.ID = ?", rank, id);
|
||||
eventBus.publishEvent(Event.wrap(Event.Kind.POST_UPDATE, id));
|
||||
return mutationCount;
|
||||
}
|
||||
}
|
||||
|
||||
class PostRowMapper implements RowMapper<Post> {
|
||||
@@ -201,6 +210,7 @@ class PostRowMapper implements RowMapper<Post> {
|
||||
post.setPreviews(Set.of(previews.split(DELIMITER)));
|
||||
}
|
||||
post.setAddedOn(rs.getTimestamp("post.ADDED_ON").toLocalDateTime());
|
||||
post.setRank(rs.getInt("post.RANK"));
|
||||
|
||||
Long metadataId = rs.getLong("metadata.POST_ID_REF");
|
||||
if (!rs.wasNull()) {
|
||||
|
||||
@@ -13,9 +13,9 @@ import tn.mnlr.vripper.jpa.repositories.IPostRepository;
|
||||
import tn.mnlr.vripper.jpa.repositories.IQueuedRepository;
|
||||
import tn.mnlr.vripper.jpa.repositories.impl.LogEventRepository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
@@ -68,6 +68,7 @@ public class DataService {
|
||||
image.setPostIdRef(post.getId());
|
||||
save(image);
|
||||
});
|
||||
sortPostsByRank();
|
||||
}
|
||||
|
||||
public synchronized void afterJobFinish(Image image, Post post) {
|
||||
@@ -100,6 +101,10 @@ public class DataService {
|
||||
postRepository.updateFolderName(postFolderName, id);
|
||||
}
|
||||
|
||||
public void updatePostRank(int rank, Long id) {
|
||||
postRepository.updateRank(rank, id);
|
||||
}
|
||||
|
||||
public void finishPost(@NonNull Post post) {
|
||||
if (!imageRepository.findByPostIdAndIsError(post.getPostId()).isEmpty()) {
|
||||
post.setStatus(Status.ERROR);
|
||||
@@ -112,16 +117,19 @@ public class DataService {
|
||||
post.setStatus(Status.COMPLETE);
|
||||
updatePostStatus(post.getStatus(), post.getId());
|
||||
if (settingsService.getSettings().getClearCompleted()) {
|
||||
remove(post.getPostId());
|
||||
remove(List.of(post.getPostId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void remove(@NonNull final String postId) {
|
||||
imageRepository.deleteAllByPostId(postId);
|
||||
metadataRepository.deleteByPostId(postId);
|
||||
postRepository.deleteByPostId(postId);
|
||||
private void remove(@NonNull final List<String> postIds) {
|
||||
for (String postId : postIds) {
|
||||
imageRepository.deleteAllByPostId(postId);
|
||||
metadataRepository.deleteByPostId(postId);
|
||||
postRepository.deleteByPostId(postId);
|
||||
}
|
||||
sortPostsByRank();
|
||||
}
|
||||
|
||||
public void newQueueLink(@NonNull final Queued queued) {
|
||||
@@ -134,18 +142,16 @@ public class DataService {
|
||||
|
||||
public List<String> clearCompleted() {
|
||||
List<String> completed = postRepository.findCompleted();
|
||||
completed.forEach(this::remove);
|
||||
remove(completed);
|
||||
return completed;
|
||||
}
|
||||
|
||||
public void removeAll(final List<String> postIds) {
|
||||
if (postIds != null && !postIds.isEmpty()) {
|
||||
for (String postId : postIds) {
|
||||
remove(postId);
|
||||
}
|
||||
} else {
|
||||
postRepository.findAll().forEach(p -> remove(p.getPostId()));
|
||||
}
|
||||
|
||||
remove(
|
||||
Objects.requireNonNullElse(
|
||||
postIds,
|
||||
postRepository.findAll().stream().map(Post::getPostId).collect(Collectors.toList())));
|
||||
}
|
||||
|
||||
public List<Image> findByPostIdAndIsNotCompleted(@NonNull String postId) {
|
||||
@@ -226,4 +232,13 @@ public class DataService {
|
||||
public void clearQueueLinks() {
|
||||
queuedRepository.deleteAll();
|
||||
}
|
||||
|
||||
public synchronized void sortPostsByRank() {
|
||||
List<Post> posts = findAllPosts();
|
||||
posts.sort(Comparator.comparing(Post::getAddedOn));
|
||||
for (int i = 0; i < posts.size(); i++) {
|
||||
posts.get(i).setRank(i);
|
||||
updatePostRank(i, posts.get(i).getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,79 +1,24 @@
|
||||
package tn.mnlr.vripper.services;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import com.github.benmanes.caffeine.cache.LoadingCache;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.jodah.failsafe.Failsafe;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
import reactor.core.Disposable;
|
||||
import tn.mnlr.vripper.event.Event;
|
||||
import tn.mnlr.vripper.event.EventBus;
|
||||
import tn.mnlr.vripper.exception.DownloadException;
|
||||
import tn.mnlr.vripper.exception.PostParseException;
|
||||
import tn.mnlr.vripper.jpa.domain.Metadata;
|
||||
import tn.mnlr.vripper.jpa.domain.Post;
|
||||
import tn.mnlr.vripper.tasks.MetadataRunnable;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MetadataService {
|
||||
|
||||
private static final List<String> dictionary =
|
||||
Arrays.asList("download", "link", "rapidgator", "filefactory", "filefox");
|
||||
private final LoadingCache<Key, Metadata> cache;
|
||||
private final ConnectionService cm;
|
||||
private final VGAuthService VGAuthService;
|
||||
private final HtmlProcessorService htmlProcessorService;
|
||||
private final XpathService xpathService;
|
||||
private final Map<String, MetadataRunnable> fetchingMetadata = new ConcurrentHashMap<>();
|
||||
private final ThreadPoolService threadPoolService;
|
||||
private final Disposable disposable;
|
||||
|
||||
public MetadataService(
|
||||
ConnectionService cm,
|
||||
VGAuthService VGAuthService,
|
||||
HtmlProcessorService htmlProcessorService,
|
||||
XpathService xpathService,
|
||||
ThreadPoolService threadPoolService,
|
||||
EventBus eventBus) {
|
||||
this.cm = cm;
|
||||
this.VGAuthService = VGAuthService;
|
||||
this.htmlProcessorService = htmlProcessorService;
|
||||
this.xpathService = xpathService;
|
||||
public MetadataService(ThreadPoolService threadPoolService) {
|
||||
this.threadPoolService = threadPoolService;
|
||||
cache = Caffeine.newBuilder().expireAfterWrite(30, TimeUnit.MINUTES).build(this::fetchMetadata);
|
||||
disposable =
|
||||
eventBus
|
||||
.flux()
|
||||
.filter(e -> e.getKind().equals(Event.Kind.SETTINGS_UPDATE))
|
||||
.subscribe(e -> this.cache.invalidateAll());
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
private void destroy() {
|
||||
if (disposable != null) {
|
||||
disposable.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public Metadata get(Post post) throws ExecutionException {
|
||||
Key key = new Key(post.getPostId(), post.getThreadId(), post.getUrl());
|
||||
return Metadata.from(cache.get(key));
|
||||
}
|
||||
|
||||
public void startFetchingMetadata(Post post) {
|
||||
@@ -82,138 +27,24 @@ public class MetadataService {
|
||||
fetchingMetadata.put(post.getPostId(), runnable);
|
||||
}
|
||||
|
||||
public void stopFetchingMetadata(Post post) {
|
||||
this.fetchingMetadata.forEach(
|
||||
(k, v) -> {
|
||||
if (k.equals(post.getPostId())) {
|
||||
v.setInterrupted(true);
|
||||
}
|
||||
});
|
||||
fetchingMetadata.remove(post.getPostId());
|
||||
}
|
||||
public void stopFetchingMetadata(List<String> postIds) {
|
||||
List<MetadataRunnable> stopping = new ArrayList<>();
|
||||
|
||||
private Metadata fetchMetadata(Key key) {
|
||||
HttpGet httpGet = cm.buildHttpGet(key.getUrl(), null);
|
||||
Metadata metadata = new Metadata();
|
||||
Failsafe.with(cm.getRetryPolicy())
|
||||
.onFailure(
|
||||
e -> {
|
||||
if (e.getFailure() instanceof InterruptedException
|
||||
|| e.getFailure().getCause() instanceof InterruptedException) {
|
||||
log.debug("Fetching interrupted");
|
||||
return;
|
||||
}
|
||||
log.error(
|
||||
String.format(
|
||||
"Error occurred when getting post metadata, postId %s", key.getPostId()),
|
||||
e.getFailure());
|
||||
})
|
||||
.run(
|
||||
() -> {
|
||||
HttpClient connection = cm.getClient().build();
|
||||
try (CloseableHttpResponse response =
|
||||
(CloseableHttpResponse) connection.execute(httpGet, VGAuthService.getContext())) {
|
||||
if (response.getStatusLine().getStatusCode() / 100 != 2) {
|
||||
throw new DownloadException(
|
||||
String.format(
|
||||
"Unexpected response code '%d' for %s",
|
||||
response.getStatusLine().getStatusCode(), httpGet));
|
||||
}
|
||||
try {
|
||||
if (Thread.interrupted()) {
|
||||
return;
|
||||
}
|
||||
Document document =
|
||||
htmlProcessorService.clean(EntityUtils.toString(response.getEntity()));
|
||||
Node postNode =
|
||||
xpathService.getAsNode(
|
||||
document,
|
||||
String.format(
|
||||
"//li[@id='post_%s']/div[contains(@class, 'postdetails')]",
|
||||
key.getPostId()));
|
||||
String postedBy =
|
||||
xpathService
|
||||
.getAsNode(
|
||||
postNode,
|
||||
"./div[contains(@class, 'userinfo')]//a[contains(@class, 'username')]//font")
|
||||
.getTextContent()
|
||||
.trim();
|
||||
metadata.setPostedBy(postedBy);
|
||||
|
||||
Node node =
|
||||
xpathService.getAsNode(
|
||||
document, String.format("//div[@id='post_message_%s']", key.getPostId()));
|
||||
metadata.setResolvedNames(findTitleInContent(node));
|
||||
|
||||
metadata.setPostId(key.getPostId());
|
||||
} catch (Exception e) {
|
||||
throw new PostParseException(
|
||||
String.format(
|
||||
"Failed to parse thread %s, post %s", key.getThreadId(), key.getPostId()),
|
||||
e);
|
||||
} finally {
|
||||
EntityUtils.consumeQuietly(response.getEntity());
|
||||
}
|
||||
}
|
||||
});
|
||||
return metadata;
|
||||
}
|
||||
|
||||
private List<String> findTitleInContent(Node node) {
|
||||
List<String> altTitle = new ArrayList<>();
|
||||
findTitle(node, altTitle, new AtomicBoolean(true));
|
||||
return altTitle.stream().distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private void findTitle(Node node, List<String> altTitle, AtomicBoolean keepGoing) {
|
||||
if (!keepGoing.get()) {
|
||||
return;
|
||||
}
|
||||
if (node.getNodeName().equals("a") || node.getNodeName().equals("img")) {
|
||||
keepGoing.set(false);
|
||||
return;
|
||||
}
|
||||
if (node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
for (int i = 0; i < node.getChildNodes().getLength(); i++) {
|
||||
Node item = node.getChildNodes().item(i);
|
||||
findTitle(item, altTitle, keepGoing);
|
||||
if (!keepGoing.get()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (node.getNodeType() == Node.TEXT_NODE) {
|
||||
String text = node.getTextContent().trim();
|
||||
if (!text.isBlank()
|
||||
&& dictionary.stream().noneMatch(e -> text.toLowerCase().contains(e.toLowerCase()))) {
|
||||
altTitle.add(text);
|
||||
for (Map.Entry<String, MetadataRunnable> entry : this.fetchingMetadata.entrySet()) {
|
||||
if (postIds.contains(entry.getKey())) {
|
||||
stopping.add(entry.getValue());
|
||||
entry.getValue().stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
static class Key {
|
||||
private final String postId;
|
||||
private final String threadId;
|
||||
private final String url;
|
||||
|
||||
Key(String postId, String threadId, String url) {
|
||||
this.postId = postId;
|
||||
this.threadId = threadId;
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Key key = (Key) o;
|
||||
return Objects.equals(postId, key.postId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(postId);
|
||||
while (!stopping.isEmpty()) {
|
||||
stopping.removeIf(MetadataRunnable::isFinished);
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
postIds.forEach(fetchingMetadata::remove);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import org.springframework.stereotype.Service;
|
||||
import reactor.core.Disposable;
|
||||
import tn.mnlr.vripper.event.Event;
|
||||
import tn.mnlr.vripper.event.EventBus;
|
||||
import tn.mnlr.vripper.jpa.domain.Post;
|
||||
import tn.mnlr.vripper.jpa.domain.Queued;
|
||||
import tn.mnlr.vripper.services.domain.MultiPostScanParser;
|
||||
import tn.mnlr.vripper.services.domain.MultiPostScanResult;
|
||||
@@ -26,19 +25,14 @@ public class PostService {
|
||||
|
||||
private final DataService dataService;
|
||||
private final ThreadPoolService threadPoolService;
|
||||
private final MetadataService metadataService;
|
||||
private final LoadingCache<Queued, MultiPostScanResult> cache;
|
||||
private final Disposable disposable;
|
||||
|
||||
@Autowired
|
||||
public PostService(
|
||||
DataService dataService,
|
||||
ThreadPoolService threadPoolService,
|
||||
MetadataService metadataService,
|
||||
EventBus eventBus) {
|
||||
DataService dataService, ThreadPoolService threadPoolService, EventBus eventBus) {
|
||||
this.dataService = dataService;
|
||||
this.threadPoolService = threadPoolService;
|
||||
this.metadataService = metadataService;
|
||||
cache =
|
||||
Caffeine.newBuilder()
|
||||
.expireAfterWrite(5, TimeUnit.MINUTES)
|
||||
@@ -57,10 +51,6 @@ public class PostService {
|
||||
}
|
||||
}
|
||||
|
||||
public void stopFetchingMetadata(Post post) {
|
||||
metadataService.stopFetchingMetadata(post);
|
||||
}
|
||||
|
||||
public void processMultiPost(List<Queued> queuedList) {
|
||||
for (Queued queued : queuedList) {
|
||||
if (queued.getPostId() != null) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import tn.mnlr.vripper.services.domain.PostScanParser;
|
||||
import tn.mnlr.vripper.services.domain.PostScanResult;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static tn.mnlr.vripper.jpa.domain.LogEvent.Status.ERROR;
|
||||
@@ -106,13 +107,12 @@ public class AddPostRunnable implements Runnable {
|
||||
Set<Image> images = postScanResult.getImages();
|
||||
|
||||
dataService.newPost(post, images);
|
||||
|
||||
metadataService.startFetchingMetadata(post);
|
||||
|
||||
if (settingsService.getSettings().getAutoStart()) {
|
||||
log.debug("Auto start downloads option is enabled");
|
||||
post.setStatus(Status.PENDING);
|
||||
downloadService.enqueue(post, images);
|
||||
downloadService.enqueue(Map.of(post, images));
|
||||
log.debug(String.format("Done enqueuing jobs for %s", post.getUrl()));
|
||||
} else {
|
||||
post.setStatus(Status.STOPPED);
|
||||
|
||||
@@ -2,39 +2,74 @@ package tn.mnlr.vripper.tasks;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.jodah.failsafe.Failsafe;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.AbstractExecutionAwareRequest;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.protocol.HttpClientContext;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
import tn.mnlr.vripper.SpringContext;
|
||||
import tn.mnlr.vripper.Utils;
|
||||
import tn.mnlr.vripper.download.DownloadJob;
|
||||
import tn.mnlr.vripper.exception.DownloadException;
|
||||
import tn.mnlr.vripper.exception.PostParseException;
|
||||
import tn.mnlr.vripper.jpa.domain.LogEvent;
|
||||
import tn.mnlr.vripper.jpa.domain.Metadata;
|
||||
import tn.mnlr.vripper.jpa.domain.Post;
|
||||
import tn.mnlr.vripper.jpa.repositories.ILogEventRepository;
|
||||
import tn.mnlr.vripper.services.DataService;
|
||||
import tn.mnlr.vripper.services.MetadataService;
|
||||
import tn.mnlr.vripper.services.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static tn.mnlr.vripper.jpa.domain.LogEvent.Status.ERROR;
|
||||
|
||||
@Slf4j
|
||||
public class MetadataRunnable implements Runnable {
|
||||
|
||||
private static final List<String> dictionary =
|
||||
Arrays.asList("download", "link", "rapidgator", "filefactory", "filefox");
|
||||
|
||||
@Getter private final Post post;
|
||||
|
||||
private final MetadataService metadataService;
|
||||
private final DataService dataService;
|
||||
private final ILogEventRepository eventRepository;
|
||||
|
||||
private final LogEvent logEvent;
|
||||
private final ConnectionService cm;
|
||||
private final HtmlProcessorService htmlProcessorService;
|
||||
private final XpathService xpathService;
|
||||
|
||||
@Setter private volatile boolean interrupted = false;
|
||||
private final HttpClientContext context = HttpClientContext.create();
|
||||
private final MetadataService metadataService;
|
||||
private volatile boolean stopped = false;
|
||||
@Getter private volatile boolean finished = false;
|
||||
|
||||
public MetadataRunnable(@NonNull Post post) {
|
||||
this.post = post;
|
||||
metadataService = SpringContext.getBean(MetadataService.class);
|
||||
dataService = SpringContext.getBean(DataService.class);
|
||||
eventRepository = SpringContext.getBean(ILogEventRepository.class);
|
||||
cm = SpringContext.getBean(ConnectionService.class);
|
||||
VGAuthService vgAuthService = SpringContext.getBean(VGAuthService.class);
|
||||
htmlProcessorService = SpringContext.getBean(HtmlProcessorService.class);
|
||||
xpathService = SpringContext.getBean(XpathService.class);
|
||||
metadataService = SpringContext.getBean(MetadataService.class);
|
||||
|
||||
context.setCookieStore(vgAuthService.getContext().getCookieStore());
|
||||
context.setAttribute(
|
||||
DownloadJob.ContextAttributes.OPEN_CONNECTION.toString(),
|
||||
Collections.synchronizedList(new ArrayList<AbstractExecutionAwareRequest>()));
|
||||
|
||||
logEvent =
|
||||
new LogEvent(
|
||||
LogEvent.Type.METADATA,
|
||||
@@ -50,25 +85,14 @@ public class MetadataRunnable implements Runnable {
|
||||
try {
|
||||
logEvent.setStatus(LogEvent.Status.PROCESSING);
|
||||
eventRepository.update(logEvent);
|
||||
if (interrupted) {
|
||||
String message = String.format("Fetching metadata for %s interrupted", post.getUrl());
|
||||
Metadata metadata = fetchMetadata(post.getPostId(), post.getThreadId(), post.getUrl());
|
||||
if (metadata != null && !stopped) {
|
||||
dataService.setMetadata(post, metadata);
|
||||
logEvent.setStatus(LogEvent.Status.DONE);
|
||||
logEvent.setMessage(message);
|
||||
eventRepository.update(logEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
Metadata metadata = metadataService.get(post);
|
||||
if (metadata == null) {
|
||||
String message = String.format("Fetching metadata for %s failed", post.getUrl());
|
||||
} else {
|
||||
logEvent.setStatus(ERROR);
|
||||
logEvent.setMessage(message);
|
||||
eventRepository.update(logEvent);
|
||||
return;
|
||||
logEvent.setMessage(String.format("Fetching metadata for %s failed", post.getUrl()));
|
||||
}
|
||||
dataService.setMetadata(post, metadata);
|
||||
|
||||
logEvent.setStatus(LogEvent.Status.DONE);
|
||||
eventRepository.update(logEvent);
|
||||
} catch (Exception e) {
|
||||
String message = String.format("Failed to fetch metadata for %s", post.getUrl());
|
||||
@@ -76,6 +100,147 @@ public class MetadataRunnable implements Runnable {
|
||||
logEvent.setMessage(message + "\n" + Utils.throwableToString(e));
|
||||
logEvent.setStatus(ERROR);
|
||||
eventRepository.update(logEvent);
|
||||
} finally {
|
||||
if (stopped) {
|
||||
String message = String.format("Fetching metadata for %s interrupted", post.getUrl());
|
||||
logEvent.setStatus(LogEvent.Status.DONE);
|
||||
logEvent.setMessage(message);
|
||||
eventRepository.update(logEvent);
|
||||
}
|
||||
finished = true;
|
||||
metadataService.stopFetchingMetadata(List.of(post.getPostId()));
|
||||
}
|
||||
}
|
||||
|
||||
private Metadata fetchMetadata(String postId, String threadId, String url) {
|
||||
HttpGet httpGet = cm.buildHttpGet(url, context);
|
||||
AtomicReference<Metadata> metadataReference = new AtomicReference<>();
|
||||
Failsafe.with(cm.getRetryPolicy())
|
||||
.onFailure(
|
||||
e ->
|
||||
log.error(
|
||||
String.format("Error occurred when getting post metadata, postId %s", postId),
|
||||
e.getFailure()))
|
||||
.run(
|
||||
() -> {
|
||||
if (stopped) {
|
||||
return;
|
||||
}
|
||||
HttpClient connection = cm.getClient().build();
|
||||
try (CloseableHttpResponse response =
|
||||
(CloseableHttpResponse) connection.execute(httpGet, context)) {
|
||||
if (stopped) {
|
||||
return;
|
||||
}
|
||||
if (response.getStatusLine().getStatusCode() / 100 != 2) {
|
||||
throw new DownloadException(
|
||||
String.format(
|
||||
"Unexpected response code '%d' for %s",
|
||||
response.getStatusLine().getStatusCode(), httpGet));
|
||||
}
|
||||
try {
|
||||
Document document =
|
||||
htmlProcessorService.clean(EntityUtils.toString(response.getEntity()));
|
||||
|
||||
if (stopped) {
|
||||
return;
|
||||
}
|
||||
|
||||
Node postNode =
|
||||
xpathService.getAsNode(
|
||||
document,
|
||||
String.format(
|
||||
"//li[@id='post_%s']/div[contains(@class, 'postdetails')]", postId));
|
||||
|
||||
if (stopped) {
|
||||
return;
|
||||
}
|
||||
|
||||
String postedBy =
|
||||
xpathService
|
||||
.getAsNode(
|
||||
postNode,
|
||||
"./div[contains(@class, 'userinfo')]//a[contains(@class, 'username')]//font")
|
||||
.getTextContent()
|
||||
.trim();
|
||||
|
||||
if (stopped) {
|
||||
return;
|
||||
}
|
||||
|
||||
Metadata metadata = new Metadata();
|
||||
metadata.setPostedBy(postedBy);
|
||||
|
||||
if (stopped) {
|
||||
return;
|
||||
}
|
||||
|
||||
Node node =
|
||||
xpathService.getAsNode(
|
||||
document, String.format("//div[@id='post_message_%s']", postId));
|
||||
metadata.setResolvedNames(findTitleInContent(node));
|
||||
metadata.setPostId(postId);
|
||||
|
||||
if (stopped) {
|
||||
return;
|
||||
}
|
||||
metadataReference.set(metadata);
|
||||
} catch (Exception e) {
|
||||
if (stopped) {
|
||||
log.warn(e.getMessage(), e);
|
||||
return;
|
||||
}
|
||||
throw new PostParseException(
|
||||
String.format("Failed to parse thread %s, post %s", threadId, postId), e);
|
||||
} finally {
|
||||
EntityUtils.consumeQuietly(response.getEntity());
|
||||
}
|
||||
}
|
||||
});
|
||||
return metadataReference.get();
|
||||
}
|
||||
|
||||
private List<String> findTitleInContent(Node node) {
|
||||
List<String> altTitle = new ArrayList<>();
|
||||
findTitle(node, altTitle, new AtomicBoolean(true));
|
||||
return altTitle.stream().distinct().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private void findTitle(Node node, List<String> altTitle, AtomicBoolean keepGoing) {
|
||||
if (!keepGoing.get()) {
|
||||
return;
|
||||
}
|
||||
if (node.getNodeName().equals("a") || node.getNodeName().equals("img")) {
|
||||
keepGoing.set(false);
|
||||
return;
|
||||
}
|
||||
if (node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
for (int i = 0; i < node.getChildNodes().getLength(); i++) {
|
||||
Node item = node.getChildNodes().item(i);
|
||||
findTitle(item, altTitle, keepGoing);
|
||||
if (!keepGoing.get()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (node.getNodeType() == Node.TEXT_NODE) {
|
||||
String text = node.getTextContent().trim();
|
||||
if (!text.isBlank()
|
||||
&& dictionary.stream().noneMatch(e -> text.toLowerCase().contains(e.toLowerCase()))) {
|
||||
altTitle.add(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
this.stopped = true;
|
||||
List<AbstractExecutionAwareRequest> requests =
|
||||
(List<AbstractExecutionAwareRequest>)
|
||||
this.context.getAttribute(DownloadJob.ContextAttributes.OPEN_CONNECTION.toString());
|
||||
if (requests != null) {
|
||||
for (AbstractExecutionAwareRequest request : requests) {
|
||||
request.abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import tn.mnlr.vripper.services.domain.DownloadSpeed;
|
||||
import tn.mnlr.vripper.services.domain.GlobalState;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@@ -56,7 +57,9 @@ public class DataController {
|
||||
|
||||
@SubscribeMapping("/posts")
|
||||
public Collection<Post> posts() {
|
||||
return dataService.findAllPosts();
|
||||
List<Post> posts = dataService.findAllPosts();
|
||||
posts.sort(Comparator.comparing(Post::getAddedOn));
|
||||
return posts;
|
||||
}
|
||||
|
||||
@SubscribeMapping("/images/{postId}")
|
||||
|
||||
@@ -168,4 +168,11 @@
|
||||
</column>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
<changeSet id="1621412143" author="death-claw">
|
||||
<addColumn tableName="POST">
|
||||
<column name="RANK" type="INT" defaultValue="0">
|
||||
<constraints nullable="false"/>
|
||||
</column>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vripper-ui",
|
||||
"version": "3.4.0",
|
||||
"version": "3.5.2",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>tn.mnlr</groupId>
|
||||
<artifactId>vripper</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<version>3.5.2</version>
|
||||
</parent>
|
||||
<artifactId>vripper-ui</artifactId>
|
||||
<name>vripper-ui</name>
|
||||
|
||||
@@ -48,10 +48,15 @@
|
||||
fill="currentColor"/>
|
||||
</svg><h2 class="margin-left no-bottom-margin no-top-margin inline-block">Donation</h2>
|
||||
</span>
|
||||
If you feel generous and want to support me, you can donate some coins, and I would be very grateful <span
|
||||
If you feel generous and want to support me, you can toss me some coins, and I would be very grateful <span
|
||||
style="font-size: 20px">🙏</span><br/>
|
||||
I accept Bitcoin (BTC) for donations, following is my address
|
||||
<h3>bc1q9jzzw3st49r9vmxgtylq4vrd67cl7zfclf3lsq</h3>
|
||||
You can send me donations through paypal to the following email address
|
||||
<div fxLayout="row">
|
||||
<a (click)="goTo('https://www.paypal.com/myaccount/transfer/homepage/buy/preview')" style="cursor: pointer">
|
||||
<img alt="paypal-logo" src="/assets/paypal.svg" width="64">
|
||||
</a>
|
||||
<h3>dev.vripper@gmail.com</h3>
|
||||
</div>
|
||||
</section>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
@@ -11,7 +11,9 @@ export class Post {
|
||||
public hosts: string[],
|
||||
public thanked: boolean,
|
||||
public previews: string[],
|
||||
public metadata: Metadata
|
||||
public metadata: Metadata,
|
||||
public addedOn: string,
|
||||
public rank: number
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
import {GridApi, ICellRendererComp, ICellRendererParams, RowNode} from 'ag-grid-community';
|
||||
import {PostContextMenuService} from '../services/post-context-menu.service';
|
||||
|
||||
export class PostAddedRendererNative implements ICellRendererComp {
|
||||
private gui: HTMLElement;
|
||||
private addedOn: string;
|
||||
private text: HTMLSpanElement;
|
||||
private gridApi: GridApi;
|
||||
private node: RowNode;
|
||||
private contextMenuService: PostContextMenuService;
|
||||
|
||||
destroy(): void {
|
||||
if (this.gui) {
|
||||
this.gui.removeEventListener('contextmenu', this.context.bind(this));
|
||||
}
|
||||
}
|
||||
|
||||
getGui(): HTMLElement {
|
||||
return this.gui;
|
||||
}
|
||||
|
||||
init(params: ICellRendererParams): void {
|
||||
// @ts-ignore
|
||||
this.contextMenuService = params.contextMenuService;
|
||||
this.gridApi = params.api;
|
||||
this.node = params.node;
|
||||
this.addedOn = params.node.data.addedOn;
|
||||
this.gui = document.createElement('div');
|
||||
this.gui.classList.add('text-cell');
|
||||
this.text = document.createElement('span');
|
||||
this.text.innerText = this.addedOn;
|
||||
this.text.setAttribute('title', this.addedOn);
|
||||
this.gui.append(this.text);
|
||||
this.gui.addEventListener('contextmenu', this.context.bind(this));
|
||||
}
|
||||
|
||||
refresh(params: ICellRendererParams): boolean {
|
||||
this.addedOn = params.node.data.addedOn;
|
||||
this.text.innerText = this.addedOn;
|
||||
this.text.setAttribute('title', this.addedOn);
|
||||
return true;
|
||||
}
|
||||
|
||||
context(event: MouseEvent) {
|
||||
event.preventDefault();
|
||||
this.gridApi.getSelectedNodes().forEach(e => e.setSelected(false));
|
||||
this.node.setSelected(true);
|
||||
this.contextMenuService.openPostContextMenu(event, this.node.data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import {GridApi, ICellRendererComp, ICellRendererParams, RowNode} from 'ag-grid-community';
|
||||
import {PostContextMenuService} from '../services/post-context-menu.service';
|
||||
|
||||
export class PostOrderRendererNative implements ICellRendererComp {
|
||||
private gui: HTMLElement;
|
||||
private order: number;
|
||||
private text: HTMLSpanElement;
|
||||
private gridApi: GridApi;
|
||||
private node: RowNode;
|
||||
private contextMenuService: PostContextMenuService;
|
||||
|
||||
destroy(): void {
|
||||
if (this.gui) {
|
||||
this.gui.removeEventListener('contextmenu', this.context.bind(this));
|
||||
}
|
||||
}
|
||||
|
||||
getGui(): HTMLElement {
|
||||
return this.gui;
|
||||
}
|
||||
|
||||
init(params: ICellRendererParams): void {
|
||||
// @ts-ignore
|
||||
this.contextMenuService = params.contextMenuService;
|
||||
this.gridApi = params.api;
|
||||
this.node = params.node;
|
||||
this.order = params.node.data.rank;
|
||||
this.gui = document.createElement('div');
|
||||
this.gui.classList.add('text-cell');
|
||||
this.text = document.createElement('span');
|
||||
this.text.innerText = this.order.toString(10);
|
||||
this.text.setAttribute('title', this.order.toString(10));
|
||||
this.gui.append(this.text);
|
||||
this.gui.addEventListener('contextmenu', this.context.bind(this));
|
||||
}
|
||||
|
||||
refresh(params: ICellRendererParams): boolean {
|
||||
this.order = params.node.data.rank;
|
||||
this.text.innerText = this.order.toString(10);
|
||||
this.text.setAttribute('title', this.order.toString(10));
|
||||
return true;
|
||||
}
|
||||
|
||||
context(event: MouseEvent) {
|
||||
event.preventDefault();
|
||||
this.gridApi.getSelectedNodes().forEach(e => e.setSelected(false));
|
||||
this.node.setSelected(true);
|
||||
this.contextMenuService.openPostContextMenu(event, this.node.data);
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ export class PostContextMenuComponent {
|
||||
maxHeight: '100vh',
|
||||
maxWidth: '100vw',
|
||||
height: '200px',
|
||||
width: '60%',
|
||||
width: '400px',
|
||||
data: {header: 'Confirmation', content: 'Are you sure you want to remove this item ?'}
|
||||
})
|
||||
.afterClosed()
|
||||
|
||||
@@ -11,6 +11,8 @@ import {PostAltRendererNative} from '../grid-custom-cells/post-alt-renderer.nati
|
||||
import {TitleRendererNative} from '../grid-custom-cells/title-renderer.native';
|
||||
import {Overlay, OverlayPositionBuilder} from '@angular/cdk/overlay';
|
||||
import {PostsService} from '../services/posts.service';
|
||||
import {PostAddedRendererNative} from '../grid-custom-cells/post-added-renderer.native';
|
||||
import {PostOrderRendererNative} from '../grid-custom-cells/post-order-renderer.native';
|
||||
|
||||
@Component({
|
||||
selector: 'app-posts',
|
||||
@@ -43,7 +45,6 @@ export class PostsComponent implements OnDestroy {
|
||||
overlay: this.overlay,
|
||||
zone: this.zone
|
||||
},
|
||||
sort: 'asc',
|
||||
headerCheckboxSelection: true,
|
||||
headerCheckboxSelectionFilteredOnly: true,
|
||||
flex: 2
|
||||
@@ -81,6 +82,24 @@ export class PostsComponent implements OnDestroy {
|
||||
contextMenuService: this.contextMenuService
|
||||
},
|
||||
flex: 1
|
||||
}, {
|
||||
headerName: 'Added On',
|
||||
field: 'addedOn',
|
||||
cellRenderer: 'nativeAddedCellRenderer',
|
||||
cellRendererParams: {
|
||||
contextMenuService: this.contextMenuService
|
||||
},
|
||||
flex: 1
|
||||
}, {
|
||||
headerName: 'Order',
|
||||
field: 'rank',
|
||||
cellRenderer: 'nativeOrderCellRenderer',
|
||||
cellRendererParams: {
|
||||
contextMenuService: this.contextMenuService,
|
||||
},
|
||||
width: 100,
|
||||
maxWidth: 150,
|
||||
sort: 'asc'
|
||||
}
|
||||
],
|
||||
defaultColDef: {
|
||||
@@ -99,6 +118,8 @@ export class PostsComponent implements OnDestroy {
|
||||
nativeFilesCellRenderer: PostFilesRendererNative,
|
||||
nativeAltCellRenderer: PostAltRendererNative,
|
||||
nativeTitleCellRenderer: TitleRendererNative,
|
||||
nativeAddedCellRenderer: PostAddedRendererNative,
|
||||
nativeOrderCellRenderer: PostOrderRendererNative,
|
||||
},
|
||||
overlayLoadingTemplate: '<span></span>',
|
||||
overlayNoRowsTemplate: '<span></span>',
|
||||
|
||||
@@ -82,7 +82,7 @@ export class WsConnectionService {
|
||||
if (this.electronService.isElectronApp) {
|
||||
const portRequest = setInterval(() => {
|
||||
this.electronService.ipcRenderer.send('get-port');
|
||||
}, 1000);
|
||||
}, 200);
|
||||
|
||||
// wait for MainIPC
|
||||
this.electronService.ipcRenderer.once('port', (event, port) => {
|
||||
@@ -107,7 +107,7 @@ export class WsConnectionService {
|
||||
Authorization: localStorage.getItem('auth') ? 'Bearer ' + localStorage.getItem('auth') : ''
|
||||
},
|
||||
brokerURL: this.serverService.wsBaseUrl + '/ws',
|
||||
reconnectDelay: 5000,
|
||||
reconnectDelay: 200,
|
||||
// debug: function (str) {
|
||||
// console.log('STOMP: ' + str);
|
||||
// },
|
||||
@@ -171,7 +171,7 @@ export class WsConnectionService {
|
||||
this.posts = this.rxStomp.watch('/topic/posts').pipe(
|
||||
map(e => {
|
||||
const posts: Array<Post> = [];
|
||||
(<Array<any>>JSON.parse(e.body)).forEach(element => {
|
||||
(<Array<any>>JSON.parse(e.body)).forEach((element, index) => {
|
||||
posts.push(
|
||||
new Post(
|
||||
element.postId,
|
||||
@@ -185,7 +185,9 @@ export class WsConnectionService {
|
||||
element.hosts,
|
||||
element.thanked,
|
||||
element.previews,
|
||||
element.metadata
|
||||
element.metadata,
|
||||
element.addedOn,
|
||||
element.rank + 1
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
@@ -105,7 +105,7 @@ export class ToolbarComponent implements OnInit, OnDestroy {
|
||||
maxHeight: '100vh',
|
||||
maxWidth: '100vw',
|
||||
height: '200px',
|
||||
width: '60%',
|
||||
width: '400px',
|
||||
data: {header: 'Confirmation', content: 'Are you sure you want to remove the selected items ?'}
|
||||
})
|
||||
.afterClosed()
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg id="Layer_1" style="enable-background:new 0 0 1000 1000;" version="1.1" viewBox="0 0 1000 1000" x="0px"
|
||||
xml:space="preserve" xmlns="http://www.w3.org/2000/svg" y="0px">
|
||||
<style type="text/css">
|
||||
.st0 {
|
||||
fill: #123984;
|
||||
}
|
||||
|
||||
.st1 {
|
||||
fill: #009DE2;
|
||||
}
|
||||
|
||||
.st2 {
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.st3 {
|
||||
fill: #009CDE;
|
||||
}
|
||||
|
||||
.st4 {
|
||||
fill: #002F86;
|
||||
}
|
||||
|
||||
.st5 {
|
||||
fill: #012069;
|
||||
}
|
||||
|
||||
.st6 {
|
||||
fill: #0F3572;
|
||||
}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M226.9,684.5c0,20.4-8.4,36.8-25.3,49.3c-16.9,12.5-40.5,18.7-70.8,18.7H114l-12.9,55.7H56.8l39.5-171.1h61.5
|
||||
c11.2,0,20.9,0.8,29.2,2.3c8.3,1.5,15.5,4.2,21.5,7.9c6,3.8,10.5,8.6,13.7,14.6C225.3,668.1,226.9,675.6,226.9,684.5z
|
||||
M179.8,688.8c0-6.7-2.4-11.6-7.3-14.8s-12-4.8-21.5-4.8h-17.8l-11.8,51.2h15.9c13.4,0,23.9-2.7,31.3-8.2
|
||||
C176.1,706.7,179.8,698.9,179.8,688.8z"/>
|
||||
<path class="st0" d="M308.4,794.6c-2.6,1.7-5.7,3.7-9.4,6.1s-7.1,4.3-10.2,5.7c-4.3,1.8-8.3,3.1-12.1,4c-3.8,0.9-9,1.4-15.6,1.4
|
||||
c-10.7,0-19.5-3-26.3-9c-6.8-6-10.2-13.9-10.2-23.5c0-10.2,2.4-18.8,7.2-25.9c4.8-7.1,12-12.8,21.5-17c8.9-4,19.5-6.9,31.7-8.6
|
||||
c12.3-1.8,25.6-3.1,39.9-3.9c0.1-0.5,0.3-1.2,0.5-2.2c0.3-1,0.4-2.2,0.4-3.5c0-5.4-2.5-9.2-7.6-11.4c-5.1-2.2-12.6-3.3-22.6-3.3
|
||||
c-6.8,0-14.3,1.1-22.6,3.4c-8.2,2.3-14.4,4.2-18.5,5.7h-3.8l6.1-30.6c4.8-1.2,12.3-2.6,22.4-4.1c10.1-1.5,20.2-2.3,30.2-2.3
|
||||
c20.2,0,35.1,2.6,44.5,7.9c9.5,5.3,14.2,13.5,14.2,24.6c0,1.5-0.1,3.5-0.4,6c-0.3,2.5-0.6,4.6-1.1,6.4l-20.2,87.8h-41.1
|
||||
L308.4,794.6z M319.4,747.4c-7.4,0.6-14.3,1.3-20.8,2.2c-6.5,0.8-12,2.1-16.5,3.7c-4.7,1.7-8.3,4.1-10.7,7.1
|
||||
c-2.5,3.1-3.7,7.1-3.7,12.2c0,4.4,1.6,7.6,4.9,9.4c3.3,1.8,8,2.7,14.3,2.7c4.1,0,8.4-0.9,13.1-2.8c4.7-1.9,9-4.3,13.1-7.2
|
||||
L319.4,747.4z"/>
|
||||
<path class="st0" d="M431.8,855.6h-45.5l32.9-49.9L398,679.3h42.3l11.2,84.5l49.1-84.5h43.7L431.8,855.6z"/>
|
||||
<path class="st1" d="M709.7,684.5c0,20.4-8.4,36.8-25.3,49.3c-16.9,12.5-40.5,18.7-70.8,18.7h-16.8l-12.9,55.7h-44.3L579,637.2
|
||||
h61.5c11.2,0,20.9,0.8,29.2,2.3c8.3,1.5,15.5,4.2,21.5,7.9c6,3.8,10.5,8.6,13.7,14.6C708.1,668.1,709.7,675.6,709.7,684.5z
|
||||
M662.5,688.8c0-6.7-2.4-11.6-7.3-14.8s-12-4.8-21.5-4.8h-17.8l-11.8,51.2H620c13.4,0,23.9-2.7,31.3-8.2
|
||||
C658.8,706.7,662.5,698.9,662.5,688.8z"/>
|
||||
<path class="st1" d="M791.2,794.6c-2.6,1.7-5.7,3.7-9.4,6.1s-7.1,4.3-10.2,5.7c-4.3,1.8-8.3,3.1-12.1,4c-3.8,0.9-9,1.4-15.6,1.4
|
||||
c-10.7,0-19.5-3-26.3-9c-6.8-6-10.2-13.9-10.2-23.5c0-10.2,2.4-18.8,7.2-25.9c4.8-7.1,12-12.8,21.5-17c8.9-4,19.5-6.9,31.7-8.6
|
||||
c12.3-1.8,25.6-3.1,39.9-3.9c0.1-0.5,0.3-1.2,0.5-2.2c0.3-1,0.4-2.2,0.4-3.5c0-5.4-2.5-9.2-7.6-11.4c-5.1-2.2-12.6-3.3-22.6-3.3
|
||||
c-6.8,0-14.3,1.1-22.6,3.4c-8.2,2.3-14.4,4.2-18.5,5.7h-3.8l6.1-30.6c4.8-1.2,12.3-2.6,22.4-4.1c10.1-1.5,20.2-2.3,30.2-2.3
|
||||
c20.2,0,35.1,2.6,44.5,7.9c9.5,5.3,14.2,13.5,14.2,24.6c0,1.5-0.1,3.5-0.4,6c-0.3,2.5-0.6,4.6-1.1,6.4l-20.2,87.8H788L791.2,794.6
|
||||
z M802.2,747.4c-7.4,0.6-14.3,1.3-20.8,2.2c-6.5,0.8-12,2.1-16.5,3.7c-4.7,1.7-8.3,4.1-10.7,7.1c-2.5,3.1-3.7,7.1-3.7,12.2
|
||||
c0,4.4,1.6,7.6,4.9,9.4c3.3,1.8,8,2.7,14.3,2.7c4.1,0,8.4-0.9,13.1-2.8c4.7-1.9,9-4.3,13.1-7.2L802.2,747.4z"/>
|
||||
<path class="st1" d="M949.9,629.5l-41.3,178.8h-41.6l41.3-178.8H949.9z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st2" d="M581.7,213.1c27.2,0,50.9,1.7,71.2,5.4c1,0.2,2,0.4,2.9,0.5c-1-0.2-1.9-0.4-2.9-0.5
|
||||
C632.6,214.8,608.9,213.1,581.7,213.1z"/>
|
||||
<path class="st3" d="M738,273.2c-7.6-14.6-18.7-26.5-33.3-35.6c-12.2-7.6-25.8-13.3-41.9-17.1c0.4,4.6,1.1,9.4,1.1,14.4
|
||||
c0,0,0,0,0,0c0,0,0,0,0,0c0,49.6-21.1,89.3-62.2,119.7C560.7,385,502.8,400,428.9,400h-40.7l-52.8,230h107.9l31.3-137h40.8
|
||||
c73.8,0,131.3-15,172.4-45.4c41.1-30.4,61.7-70.3,61.7-119.8C749.5,306,745.7,287.8,738,273.2z"/>
|
||||
<path class="st4" d="M581.7,214c27.2,0,50.9,1.5,71.2,5.2c1,0.2,2,0.3,2.9,0.5c2.4,0.4,4.8,0.8,7.1,1.4c-1.4-15.5-5-29-10.9-40.3
|
||||
c-7.6-14.6-18.7-26.6-33.3-35.7c-14.7-9.1-32.2-15.7-52.4-19.4c-20.2-3.7-44-5.7-71.2-5.7H345.6l-96.1,416h107.9l31.3-136h0.1
|
||||
L432,214H581.7z"/>
|
||||
<g>
|
||||
<path class="st5" d="M601.9,355.1c41.1-30.4,61.7-70.6,61.7-120.2c0-5-0.2-9.8-0.6-14.4c0,0,0,0,0,0c0,0,0,0,0,0.1
|
||||
c-2.3-0.6-4.7-1-7.2-1.5c-1-0.2-1.9,0.1-2.9-0.1c-20.2-3.7-44-5-71.2-5H432l-43.3,187h40.7C503.3,401,560.8,385.5,601.9,355.1z"
|
||||
/>
|
||||
<path class="st5" d="M429.5,401h-41.4l0.1-0.6L431.7,213h150c28.9,0,52.2,1.7,71.3,5.2c0.5,0.1,1,0.1,1.5,0.2
|
||||
c0.5,0,1,0.1,1.5,0.2c2.2,0.4,4.5,0.9,6.8,1.4l0.1,0l0.1-0.1l0.6,0.2l0,0.3c0,0.1,0,0.2,0,0.3l0,0.4l0,0
|
||||
c0.4,4.5,0.6,9.1,0.6,13.7c0,49.6-20.8,90.1-61.9,120.4C561.1,385.6,503,401,429.5,401z M389.4,400h40.1
|
||||
c73.3,0,131.2-15.3,172.1-45.6l0,0c40.8-30.1,61.4-70.4,61.5-119.6c0-4.7-0.2-9.4-0.6-13.9c-2.3-0.5-4.6-1-6.8-1.4
|
||||
c-0.5-0.1-0.9-0.1-1.4-0.2c-0.5,0-1-0.1-1.6-0.2c-19-3.5-42.2-5.2-71.1-5.2H432.4L389.4,400z"/>
|
||||
</g>
|
||||
<path class="st6" d="M602.3,354.9c41.1-30.4,61.7-70.4,61.7-120c0,0,0,0,0,0C664,284.4,643.4,324.5,602.3,354.9z"/>
|
||||
<path class="st6"
|
||||
d="M663,220.5C663,220.5,663,220.5,663,220.5c-2.4-0.6-4.7-1.1-7.2-1.5C658.2,219.5,660.6,220,663,220.5z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.0 KiB |
@@ -2,5 +2,5 @@ export const environment = {
|
||||
production: true,
|
||||
localhost: `${window.location.protocol}//${window.location.host}`,
|
||||
ws: `${window.location.protocol === 'http:' ? 'ws:' : 'wss:'}//${window.location.host}`,
|
||||
version: '3.4.0'
|
||||
version: '3.5.2'
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@ export const environment = {
|
||||
production: false,
|
||||
localhost: 'http://localhost:8080',
|
||||
ws: 'ws://localhost:8080',
|
||||
version: '3.4.0'
|
||||
version: '3.5.2'
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/vripper-ui/dist" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vripper-ui/tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
|
||||
Reference in New Issue
Block a user