-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
461 changed files
with
17,125 additions
and
20,927 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created | ||
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path | ||
|
||
name: Maven Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml | ||
settings-path: ${{ github.workspace }} # location for the settings.xml file | ||
|
||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
|
||
- name: Publish to GitHub Packages Apache Maven | ||
run: mvn deploy -B -s $GITHUB_WORKSPACE/settings.xml | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,19 @@ | ||
# 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 for [vipergirls.to](https://vipergirls.to). | ||
|
||
## How to build | ||
|
||
You need a recent version of maven 3.6.1+. | ||
You need JDK 17 and a recent version of maven 3.6.1+ | ||
|
||
The application support 2 build modes: | ||
To build run the following: | ||
|
||
- 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. | ||
mvn clean install | ||
|
||
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. | ||
Build artifact is located under | ||
|
||
To build the server app: | ||
vripper-project\vripper-gui\target\vripper-gui-4.0.0.jar | ||
|
||
mvn clean install -DskipTests | ||
Copy the artifact into any other folder and run: | ||
|
||
To build the desktop app: | ||
|
||
mvn clean install -Pelectron -DskipTests | ||
|
||
Maven will automatically handle front end compilation. However, for development, you will need to install a recent | ||
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 [PayPal](https://www.paypal.com/myaccount/transfer/homepage/buy/preview) donations, following is my email | ||
address | ||
|
||
[email protected] | ||
java -jar vripper-gui-4.0.0.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>tn.mnlr</groupId> | ||
<artifactId>vripper</artifactId> | ||
<version>3.5.4</version> | ||
<packaging>pom</packaging> | ||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.4.5</version> | ||
<relativePath/> | ||
</parent> | ||
<modules> | ||
<module>vripper-server</module> | ||
<module>vripper-ui</module> | ||
<module>vripper-electron</module> | ||
</modules> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>me.mnlr</groupId> | ||
<artifactId>vripper-project</artifactId> | ||
<modules> | ||
<module>vripper-core</module> | ||
<module>vripper-gui</module> | ||
</modules> | ||
<packaging>pom</packaging> | ||
<version>4.0.0</version> | ||
<properties> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
</properties> | ||
</project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<groupId>org.springframework.boot</groupId> | ||
<relativePath/> | ||
<version>3.0.6</version> | ||
</parent> | ||
<groupId>me.mnlr.vripper</groupId> | ||
<artifactId>vripper-core</artifactId> | ||
<version>4.0.0</version> | ||
<name>vripper-core</name> | ||
<description>vripper-core</description> | ||
<properties> | ||
<java.version>17</java.version> | ||
<kotlin.version>1.8.21</kotlin.version> | ||
<maven.deploy.skip>false</maven.deploy.skip> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<artifactId>kotlin-reflect</artifactId> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
</dependency> | ||
<dependency> | ||
<artifactId>kotlin-stdlib</artifactId> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
</dependency> | ||
<dependency> | ||
<artifactId>jackson-module-kotlin</artifactId> | ||
<groupId>com.fasterxml.jackson.module</groupId> | ||
</dependency> | ||
<dependency> | ||
<artifactId>spring-boot-starter-jdbc</artifactId> | ||
<groupId>org.springframework.boot</groupId> | ||
</dependency> | ||
<dependency> | ||
<artifactId>liquibase-core</artifactId> | ||
<groupId>org.liquibase</groupId> | ||
</dependency> | ||
<dependency> | ||
<artifactId>hsqldb</artifactId> | ||
<groupId>org.hsqldb</groupId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<artifactId>httpclient</artifactId> | ||
<groupId>org.apache.httpcomponents</groupId> | ||
</dependency> | ||
<dependency> | ||
<artifactId>htmlcleaner</artifactId> | ||
<groupId>net.sourceforge.htmlcleaner</groupId> | ||
<version>2.26</version> | ||
</dependency> | ||
<dependency> | ||
<artifactId>reactor-core</artifactId> | ||
<groupId>io.projectreactor</groupId> | ||
</dependency> | ||
<dependency> | ||
<artifactId>failsafe</artifactId> | ||
<groupId>net.jodah</groupId> | ||
<version>2.4.4</version> | ||
</dependency> | ||
<dependency> | ||
<artifactId>caffeine</artifactId> | ||
<groupId>com.github.ben-manes.caffeine</groupId> | ||
</dependency> | ||
<dependency> | ||
<artifactId>jackson-databind</artifactId> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.dataformat</groupId> | ||
<artifactId>jackson-dataformat-yaml</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.datatype</groupId> | ||
<artifactId>jackson-datatype-jsr310</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<groupId>org.springframework.boot</groupId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<artifactId>spring-restdocs-mockmvc</artifactId> | ||
<groupId>org.springframework.restdocs</groupId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory> | ||
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-maven-plugin</artifactId> | ||
<configuration> | ||
<args> | ||
<arg>-Xjsr305=strict</arg> | ||
</args> | ||
<compilerPlugins> | ||
<plugin>spring</plugin> | ||
</compilerPlugins> | ||
</configuration> | ||
<dependencies> | ||
<dependency> | ||
<artifactId>kotlin-maven-allopen</artifactId> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<version>${kotlin.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<distributionManagement> | ||
<repository> | ||
<id>github</id> | ||
<name>GitHub death-claw Apache Maven Packages</name> | ||
<url>https://maven.pkg.github.com/death-claw/vripper-project</url> | ||
</repository> | ||
</distributionManagement> | ||
</project> |
111 changes: 111 additions & 0 deletions
111
vripper-core/src/main/kotlin/me/mnlr/vripper/AppEndpointService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
package me.mnlr.vripper | ||
|
||
import org.springframework.stereotype.Service | ||
import me.mnlr.vripper.delegate.LoggerDelegate | ||
import me.mnlr.vripper.download.DownloadService | ||
import me.mnlr.vripper.exception.PostParseException | ||
import me.mnlr.vripper.model.PostItem | ||
import me.mnlr.vripper.repositories.LogEventRepository | ||
import me.mnlr.vripper.repositories.ThreadRepository | ||
import me.mnlr.vripper.services.* | ||
import me.mnlr.vripper.tasks.LinkScanRunnable | ||
import java.util.* | ||
import java.util.regex.Pattern | ||
|
||
@Service | ||
class AppEndpointService( | ||
private val downloadService: DownloadService, | ||
private val dataTransaction: DataTransaction, | ||
private val threadRepository: ThreadRepository, | ||
private val threadCacheService: ThreadCacheService, | ||
private val eventRepository: LogEventRepository, | ||
private val threadPoolService: ThreadPoolService, | ||
) { | ||
private val log by LoggerDelegate() | ||
|
||
@Synchronized | ||
fun scanLinks(postLinks: String) { | ||
if (postLinks.isBlank()) { | ||
log.warn("Nothing to scan") | ||
return | ||
} | ||
val urlList = postLinks.split(Pattern.compile("\\r?\\n")).dropLastWhile { it.isEmpty() }.map { it.trim() } | ||
.filter { it.isNotEmpty() } | ||
threadPoolService.generalExecutor.submit(LinkScanRunnable(urlList)) | ||
} | ||
|
||
@Synchronized | ||
fun restartAll(posIds: List<String> = listOf()) { | ||
downloadService.restartAll(posIds) | ||
} | ||
|
||
@Synchronized | ||
fun download(posts: List<Pair<String, String>>) { | ||
downloadService.download(posts) | ||
} | ||
|
||
@Synchronized | ||
fun stopAll(postIdList: List<String>?) { | ||
downloadService.stopAll(postIdList) | ||
} | ||
|
||
@Synchronized | ||
fun remove(postIdList: List<String>) { | ||
downloadService.stopAll(postIdList) | ||
dataTransaction.removeAll(postIdList) | ||
} | ||
|
||
@Synchronized | ||
fun clearCompleted(): List<String> { | ||
return dataTransaction.clearCompleted() | ||
} | ||
|
||
@Synchronized | ||
@Throws(PostParseException::class) | ||
fun grab(threadId: String): List<PostItem> { | ||
return try { | ||
val thread = threadRepository.findByThreadId(threadId).orElseThrow { | ||
PostParseException( | ||
String.format( | ||
"Unable to find links for threadId = %s", threadId | ||
) | ||
) | ||
} | ||
val threadLookupResult = threadCacheService[thread.threadId] | ||
threadLookupResult.postItemList.ifEmpty { | ||
log.error( | ||
String.format( | ||
"Failed to get links for threadId = %s", threadId | ||
) | ||
) | ||
throw PostParseException( | ||
String.format( | ||
"Failed to get links for threadId = %s", threadId | ||
) | ||
) | ||
} | ||
} catch (e: Exception) { | ||
throw PostParseException( | ||
String.format( | ||
"Failed to get links for threadId = %s, %s", threadId, e.message | ||
) | ||
) | ||
} | ||
} | ||
|
||
@Synchronized | ||
fun threadRemove(threadIdList: List<String>) { | ||
threadIdList.forEach { | ||
dataTransaction.removeThread(it) | ||
} | ||
} | ||
|
||
@Synchronized | ||
fun threadClear() { | ||
dataTransaction.clearQueueLinks() | ||
} | ||
|
||
fun logClear() { | ||
eventRepository.deleteAll() | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
vripper-core/src/main/kotlin/me/mnlr/vripper/EventListenerBean.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package me.mnlr.vripper | ||
|
||
import org.springframework.context.event.ContextRefreshedEvent | ||
import org.springframework.context.event.EventListener | ||
import org.springframework.stereotype.Component | ||
import me.mnlr.vripper.repositories.PostDownloadStateRepository | ||
import me.mnlr.vripper.services.DataTransaction | ||
|
||
@Component | ||
class EventListenerBean( | ||
private val postDownloadStateRepository: PostDownloadStateRepository, | ||
private val dataTransaction: DataTransaction | ||
) { | ||
@EventListener | ||
fun onApplicationEvent(event: ContextRefreshedEvent?) { | ||
postDownloadStateRepository.setDownloadingToStopped() | ||
dataTransaction.sortPostsByRank() | ||
} | ||
} |
Oops, something went wrong.