Skip to content

Commit c5254f8

Browse files
committed
JavaYoutubeDownloader 1.2.1. Working with the last YouTube html format.
1 parent fab17a3 commit c5254f8

File tree

3 files changed

+54
-6
lines changed

3 files changed

+54
-6
lines changed

pom.xml

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>io.github.gaeqs</groupId>
88
<artifactId>JavaYoutubeDownloader</artifactId>
9-
<version>1.2</version>
9+
<version>1.2.1</version>
1010
<packaging>jar</packaging>
1111

1212
<name>${project.groupId}:${project.artifactId}</name>
@@ -35,29 +35,44 @@
3535

3636
<build>
3737
<plugins>
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-resources-plugin</artifactId>
41+
<version>3.2.0</version>
42+
<configuration>
43+
<encoding>UTF-8</encoding>
44+
</configuration>
45+
</plugin>
3846
<plugin>
3947
<groupId>org.apache.maven.plugins</groupId>
4048
<artifactId>maven-compiler-plugin</artifactId>
49+
<version>3.8.1</version>
4150
<configuration>
4251
<source>8</source>
4352
<target>8</target>
53+
<encoding>UTF-8</encoding>
4454
</configuration>
4555
</plugin>
4656
<plugin>
4757
<groupId>org.apache.maven.plugins</groupId>
4858
<artifactId>maven-source-plugin</artifactId>
59+
<version>2.2.1</version>
4960
<executions>
5061
<execution>
5162
<id>attach-sources</id>
5263
<goals>
53-
<goal>jar</goal>
64+
<goal>jar-no-fork</goal>
5465
</goals>
5566
</execution>
5667
</executions>
5768
</plugin>
5869
<plugin>
5970
<groupId>org.apache.maven.plugins</groupId>
6071
<artifactId>maven-javadoc-plugin</artifactId>
72+
<version>2.9.1</version>
73+
<configuration>
74+
<encoding>UTF-8</encoding>
75+
</configuration>
6176
<executions>
6277
<execution>
6378
<id>attach-javadocs</id>
@@ -67,21 +82,51 @@
6782
</execution>
6883
</executions>
6984
</plugin>
85+
<plugin>
86+
<groupId>org.apache.maven.plugins</groupId>
87+
<artifactId>maven-gpg-plugin</artifactId>
88+
<version>1.6</version>
89+
<executions>
90+
<execution>
91+
<id>sign-artifacts</id>
92+
<phase>verify</phase>
93+
<goals>
94+
<goal>sign</goal>
95+
</goals>
96+
</execution>
97+
</executions>
98+
</plugin>
99+
<plugin>
100+
<groupId>org.sonatype.plugins</groupId>
101+
<artifactId>nexus-staging-maven-plugin</artifactId>
102+
<version>1.6.7</version>
103+
<extensions>true</extensions>
104+
<configuration>
105+
<serverId>ossrh</serverId>
106+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
107+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
108+
</configuration>
109+
</plugin>
70110
</plugins>
71111
</build>
72112

73-
<dependencies>
113+
<distributionManagement>
114+
<snapshotRepository>
115+
<id>ossrh</id>
116+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
117+
</snapshotRepository>
118+
</distributionManagement>
74119

120+
<dependencies>
75121
<dependency>
76122
<groupId>com.alibaba</groupId>
77123
<artifactId>fastjson</artifactId>
78124
<version>1.2.62</version>
79125
</dependency>
80-
81126
<dependency>
82127
<groupId>org.junit.jupiter</groupId>
83128
<artifactId>junit-jupiter</artifactId>
84-
<version>RELEASE</version>
129+
<version>5.7.0</version>
85130
<scope>test</scope>
86131
</dependency>
87132
<dependency>

src/main/java/io/github/gaeqs/javayoutubedownloader/decoder/HTMLDecoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class HTMLDecoder implements Decoder {
2929

3030
private static final String YOUTUBE_URL = "https://youtube.com";
3131

32-
private static final Pattern YT_PLAYER_RESPONSE = Pattern.compile("<script>var ytInitialPlayerResponse = (\\{.*?});");
32+
private static final Pattern YT_PLAYER_RESPONSE = Pattern.compile("var ytInitialPlayerResponse = (\\{.*?});");
3333
private static final Pattern YT_PLAYER_CONFIG = Pattern.compile("ytplayer.web_player_context_config = (\\{.*?});");
3434

3535
private static final String KEY_STREAMING_DATA = "streamingData";

src/main/java/io/github/gaeqs/javayoutubedownloader/decrypt/Decrypt.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ public interface Decrypt {
88
/**
99
* Decrypts the signature code inside the instance.
1010
*
11+
* @param jsUrl the url of the js file containing the decrypt method.
12+
* @param signature the signature to decrypt.
13+
*
1114
* @return the decrypted code.
1215
*/
1316
String decrypt(String jsUrl, String signature);

0 commit comments

Comments
 (0)