Skip to content

Commit a779187

Browse files
Merge pull request #134 from mattwright324/develop
Develop
2 parents f598720 + b34fcb4 commit a779187

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+241
-2409
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ YouTube creators and more.
2020
* Cross-platform using Java 8 and JavaFX
2121
* Include multiple channels, playlists, and videos in a single group.
2222
* Search for comments by video, type, username, keyword, length, and date.
23-
* Export search results to handier and more consumable CSV or JSON formats.
24-
* Display stats about videos: publishes per week, most popular, most disliked, most commented, and disabled.
23+
* Display stats about videos: publishes per week, most popular, most commented, and disabled.
2524
* Display stats about comments: posts per week, most active posters, most popular posters.
2625
* Option to save thumbnails and profiles for archival and offline viewing.
27-
* Sign in to multiple YouTube accounts and choose which to reply with.
2826
* View video context when selecting a comment.
2927

3028
## Install

module-info.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
requires javafx.web;
1212
requires org.apache.commons.text;
1313
requires org.apache.logging.log4j;
14-
requires org.jsoup;
1514
requires sqlite.jdbc;
1615
requires youtube.data.list.mod;
1716
opens mattw.youtube.commentsuite to javafx.fxml;

pom.xml

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
<groupId>io.mattw.youtube</groupId>
88
<artifactId>youtube-comment-suite</artifactId>
9-
<version>1.4.8</version>
9+
<version>1.4.9</version>
1010

1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1313
<maven.compiler.source>1.8</maven.compiler.source>
1414
<maven.compiler.target>1.8</maven.compiler.target>
1515

16-
<current.year>2022</current.year>
16+
<current.year>2024</current.year>
1717
</properties>
1818

1919
<build>
@@ -30,7 +30,7 @@
3030
<plugin>
3131
<groupId>org.apache.maven.plugins</groupId>
3232
<artifactId>maven-jar-plugin</artifactId>
33-
<version>2.4</version>
33+
<version>3.4.2</version>
3434
<executions>
3535
<execution>
3636
<id>default-jar</id>
@@ -55,7 +55,7 @@
5555
<plugin>
5656
<groupId>org.apache.maven.plugins</groupId>
5757
<artifactId>maven-dependency-plugin</artifactId>
58-
<version>2.8</version>
58+
<version>3.8.0</version>
5959
<executions>
6060
<execution>
6161
<id>copy-dependencies</id>
@@ -73,7 +73,7 @@
7373
<!-- Copy additional files -->
7474
<plugin>
7575
<artifactId>maven-resources-plugin</artifactId>
76-
<version>3.1.0</version>
76+
<version>3.3.1</version>
7777
<executions>
7878
<execution>
7979
<id>copy-resource-one</id>
@@ -101,7 +101,7 @@
101101
<plugin>
102102
<groupId>org.apache.maven.plugins</groupId>
103103
<artifactId>maven-surefire-plugin</artifactId>
104-
<version>3.0.0-M5</version>
104+
<version>3.5.0</version>
105105
</plugin>
106106
</plugins>
107107
</build>
@@ -112,50 +112,40 @@
112112
<artifactId>google-api-services-youtube</artifactId>
113113
<version>v3-rev222-1.25.0</version>
114114
</dependency>
115-
<dependency>
116-
<groupId>org.apache.commons</groupId>
117-
<artifactId>commons-csv</artifactId>
118-
<version>1.9.0</version>
119-
</dependency>
120115
<dependency>
121116
<groupId>org.apache.commons</groupId>
122117
<artifactId>commons-lang3</artifactId>
123-
<version>3.12.0</version>
118+
<version>3.17.0</version>
124119
</dependency>
125120
<dependency>
126121
<groupId>org.apache.commons</groupId>
127122
<artifactId>commons-text</artifactId>
128-
<version>1.9</version>
123+
<version>1.12.0</version>
129124
</dependency>
130125
<dependency>
131126
<groupId>com.google.code.gson</groupId>
132127
<artifactId>gson</artifactId>
133-
<version>2.8.9</version>
128+
<version>2.11.0</version>
134129
</dependency>
135130
<dependency>
136131
<groupId>com.google.guava</groupId>
137132
<artifactId>guava</artifactId>
138-
<version>31.0.1-jre</version>
139-
</dependency>
140-
<dependency>
141-
<groupId>org.jsoup</groupId>
142-
<artifactId>jsoup</artifactId>
143-
<version>1.14.3</version>
133+
<version>33.3.1-jre</version>
144134
</dependency>
145135
<dependency>
146136
<groupId>org.xerial</groupId>
147137
<artifactId>sqlite-jdbc</artifactId>
148-
<version>3.36.0.3</version>
138+
<version>3.46.1.3</version>
149139
</dependency>
150140
<dependency>
151141
<groupId>org.apache.logging.log4j</groupId>
152142
<artifactId>log4j-api</artifactId>
153-
<version>2.17.1</version>
143+
<version>2.24.1</version>
154144
</dependency>
155145
<dependency>
156146
<groupId>org.apache.logging.log4j</groupId>
157147
<artifactId>log4j-core</artifactId>
158-
<version>2.17.1</version>
148+
<version>2.24.1</version>
159149
</dependency>
160150

161151
<!-- JUnit -->

src/main/java/io/mattw/youtube/commentsuite/CommentSuite.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
import com.google.api.services.youtube.YouTube;
66
import com.google.common.eventbus.EventBus;
77
import io.mattw.youtube.commentsuite.db.CommentDatabase;
8-
import io.mattw.youtube.commentsuite.oauth2.OAuth2Manager;
9-
import io.mattw.youtube.commentsuite.util.IpApiProvider;
10-
import io.mattw.youtube.commentsuite.util.Location;
118
import javafx.application.Application;
129
import javafx.application.Platform;
1310
import javafx.fxml.FXMLLoader;
@@ -33,11 +30,9 @@ public class CommentSuite extends Application {
3330

3431
private static final ConfigFile<ConfigData> config = new ConfigFile<>("commentsuite.json", new ConfigData());
3532
private static final EventBus eventBus = new EventBus();
36-
private static final Location<IpApiProvider, IpApiProvider.Location> location = new Location<>(new IpApiProvider(), IpApiProvider.Location.class);
3733

3834
private static CommentDatabase database;
3935
private static YouTube youTube;
40-
private static OAuth2Manager oauth2Manager;
4136
private static final Properties properties = new Properties();
4237

4338
public static void main(String[] args) {
@@ -57,7 +52,6 @@ public void start(final Stage stage) {
5752
.setApplicationName("youtube-comment-suite")
5853
.build();
5954
database = new CommentDatabase("commentsuite.sqlite3");
60-
oauth2Manager = new OAuth2Manager();
6155
try (InputStream is = CommentSuite.class.getResourceAsStream("/application.properties")) {
6256
properties.load(is);
6357
}
@@ -103,14 +97,6 @@ public static EventBus getEventBus() {
10397
return eventBus;
10498
}
10599

106-
public static Location<IpApiProvider, IpApiProvider.Location> getLocation() {
107-
return location;
108-
}
109-
110-
public static OAuth2Manager getOauth2Manager() {
111-
return oauth2Manager;
112-
}
113-
114100
public static CommentDatabase getDatabase() {
115101
return database;
116102
}

src/main/java/io/mattw/youtube/commentsuite/ConfigData.java

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,23 @@
11
package io.mattw.youtube.commentsuite;
22

3-
import io.mattw.youtube.commentsuite.events.AccountAddEvent;
4-
import io.mattw.youtube.commentsuite.events.AccountDeleteEvent;
5-
import io.mattw.youtube.commentsuite.oauth2.YouTubeAccount;
63
import io.mattw.youtube.commentsuite.refresh.RefreshOptions;
74
import io.mattw.youtube.commentsuite.util.StringMask;
85

96
import java.io.Serializable;
10-
import java.util.ArrayList;
11-
import java.util.List;
12-
13-
import static io.mattw.youtube.commentsuite.CommentSuite.*;
147

158
public class ConfigData implements Serializable {
169

1710
public static final transient String DEFAULT_API_KEY = "AIzaSyD9SzQFnmOn08ESZC-7gIhnHWVn0asfrKQ";
1811
public static final transient String FAST_GROUP_ADD_THUMB_PLACEHOLDER = "~";
1912

20-
private List<YouTubeAccount> accounts = new ArrayList<>();
2113
private boolean archiveThumbs = false;
2214
private boolean autoLoadStats = true;
2315
private boolean customApiKey = false;
2416
private boolean fastGroupAdd = false;
2517
private boolean filterDuplicatesOnCopy = true;
26-
private boolean grabHeldForReview = false;
27-
private boolean prefixReplies = true;
2818
private RefreshOptions refreshOptions = new RefreshOptions();
2919
private String youtubeApiKey = DEFAULT_API_KEY;
3020

31-
public List<YouTubeAccount> getAccounts() {
32-
return accounts;
33-
}
34-
35-
public void setAccounts(List<YouTubeAccount> accounts) {
36-
this.accounts = accounts;
37-
}
38-
3921
public boolean isArchiveThumbs() {
4022
return archiveThumbs;
4123
}
@@ -76,22 +58,6 @@ public void setFilterDuplicatesOnCopy(boolean filterDuplicatesOnCopy) {
7658
this.filterDuplicatesOnCopy = filterDuplicatesOnCopy;
7759
}
7860

79-
public boolean isGrabHeldForReview() {
80-
return grabHeldForReview;
81-
}
82-
83-
public void setGrabHeldForReview(boolean grabHeldForReview) {
84-
this.grabHeldForReview = grabHeldForReview;
85-
}
86-
87-
public boolean isPrefixReplies() {
88-
return prefixReplies;
89-
}
90-
91-
public void setPrefixReplies(boolean prefixReplies) {
92-
this.prefixReplies = prefixReplies;
93-
}
94-
9561
public RefreshOptions getRefreshOptions() {
9662
return refreshOptions;
9763
}
@@ -108,45 +74,18 @@ public void setYoutubeApiKey(String youtubeApiKey) {
10874
this.youtubeApiKey = youtubeApiKey;
10975
}
11076

111-
public void addAccount(final YouTubeAccount account) {
112-
if (accounts.stream().noneMatch(ac -> ac.getChannelId().equals(account.getChannelId()))) {
113-
accounts.add(account);
114-
postEvent(new AccountAddEvent(account));
115-
}
116-
}
117-
118-
public void removeAccount(final YouTubeAccount account) {
119-
if (accounts.removeIf(acc -> acc.getChannelId() != null && acc.getChannelId().equals(account.getChannelId()))) {
120-
postEvent(new AccountDeleteEvent(account));
121-
}
122-
}
123-
124-
public boolean isSignedIn(final String channelId) {
125-
return accounts.stream().anyMatch(acc -> channelId.equals(acc.getChannelId()));
126-
}
127-
128-
public YouTubeAccount getAccount(final String channelId) {
129-
return accounts.stream()
130-
.filter(acc -> channelId.equals(acc.getChannelId()))
131-
.findFirst()
132-
.orElse(null);
133-
}
134-
13577
public String getApiKeyOrDefault() {
13678
return isCustomApiKey() ? getYoutubeApiKey() : DEFAULT_API_KEY;
13779
}
13880

13981
@Override
14082
public String toString() {
14183
return "ConfigData{" +
142-
"accounts=" + accounts +
14384
", archiveThumbs=" + archiveThumbs +
14485
", autoLoadStats=" + autoLoadStats +
14586
", customApiKey=" + customApiKey +
14687
", fastGroupAdd=" + fastGroupAdd +
14788
", filterDuplicatesOnCopy=" + filterDuplicatesOnCopy +
148-
", grabHeldForReview=" + grabHeldForReview +
149-
", prefixReplies=" + prefixReplies +
15089
", refreshOptions=" + refreshOptions +
15190
", youtubeApiKey='" + StringMask.maskHalf(youtubeApiKey) + '\'' +
15291
'}';

src/main/java/io/mattw/youtube/commentsuite/ImageCache.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.google.common.cache.Cache;
44
import com.google.common.cache.CacheBuilder;
5-
import io.mattw.youtube.commentsuite.oauth2.YouTubeAccount;
65
import javafx.scene.image.Image;
76
import org.apache.logging.log4j.LogManager;
87
import org.apache.logging.log4j.Logger;
@@ -88,10 +87,6 @@ static Image findOrGetImage(final String id, final String imageUrl) {
8887
return image;
8988
}
9089

91-
static Image findOrGetImage(final YouTubeAccount account) {
92-
return findOrGetImage(account.getChannelId(), account.getThumbUrl());
93-
}
94-
9590
static boolean hasImageCached(final String id) {
9691
return thumbCache.getIfPresent(id) != null;
9792
}

src/main/java/io/mattw/youtube/commentsuite/ImageLoader.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public enum ImageLoader {
1818
GROUP("group.png"),
1919
GROUP_ICON("groupIcon.png"),
2020
LOADING("loading.png"),
21-
LOCATION("location.png"),
2221
MANAGE("manage.png"),
2322
MINUS_CIRCLE("minus-circle.png"),
2423
OOPS("oops.png"),
@@ -32,7 +31,6 @@ public enum ImageLoader {
3231
SETTINGS("settings.png"),
3332
TAGS("tag.png"),
3433
THUMBNAIL("thumbnail.png"),
35-
THUMBS_DOWN("thumbs-down.png"),
3634
THUMBS_UP("thumbs-up.png"),
3735
TIMES_CIRCLE("times-circle.png"),
3836
TOGGLE_CONTEXT("toggleContext.png"),

src/main/java/io/mattw/youtube/commentsuite/db/CommentDatabase.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ public GroupStats getGroupStats(Group group) throws SQLException {
244244
stats.setTotalVideos(rs.getLong("total_videos"));
245245
stats.setTotalViews(rs.getLong("total_views"));
246246
stats.setTotalLikes(rs.getLong("total_likes"));
247-
stats.setTotalDislikes(rs.getLong("total_dislikes"));
248247
stats.setTotalComments(rs.getLong("total_comments"));
249248
}
250249
}
@@ -258,7 +257,6 @@ public GroupStats getGroupStats(Group group) throws SQLException {
258257
}
259258
}
260259
stats.setMostViewed(this.getMostPopularVideos(group, 10));
261-
stats.setMostDisliked(this.getMostDislikedVideos(group, 10));
262260
stats.setMostCommented(this.getMostCommentedVideos(group, 10));
263261
stats.setCommentsDisabled(this.getDisabledVideos(group, 25));
264262
stats.setWeeklyUploadHistogram(this.getWeekByWeekVideoHistogram(group));
@@ -339,14 +337,6 @@ private List<YouTubeVideo> getMostPopularVideos(Group group, int limit) throws S
339337
}
340338
}
341339

342-
private List<YouTubeVideo> getMostDislikedVideos(Group group, int limit) throws SQLException {
343-
try (PreparedStatement ps = sqlite.prepareStatement(GET_GROUP_DISLIKED_VIDEOS.toString())) {
344-
ps.setString(1, group.getGroupId());
345-
ps.setInt(2, limit);
346-
return videos.toList(ps);
347-
}
348-
}
349-
350340
private List<YouTubeVideo> getMostCommentedVideos(Group group, int limit) throws SQLException {
351341
try (PreparedStatement ps = sqlite.prepareStatement(GET_GROUP_COMMENTED_VIDEOS.toString())) {
352342
ps.setString(1, group.getGroupId());

0 commit comments

Comments
 (0)