sealedtx / java-youtube-downloader

Simple, almost zero-dependency java parser for retrieving youtube video metadata
Other
430 stars 119 forks source link

Unable to import classes with version 3.2.6 #133

Open StevenDieu opened 1 month ago

StevenDieu commented 1 month ago

Hi,

I recently upgraded to version 3.2.6 of the java-youtube-downloader library, and I’m facing issues with importing the necessary classes. In version 3.2.3, I was able to use the following imports:

import com.github.kiulian.downloader.YoutubeDownloader;
import com.github.kiulian.downloader.downloader.request.RequestVideoFileDownload;
import com.github.kiulian.downloader.downloader.request.RequestVideoInfo;
import com.github.kiulian.downloader.downloader.response.Response;
import com.github.kiulian.downloader.model.videos.VideoInfo;
import com.github.kiulian.downloader.model.videos.formats.AudioFormat;
import com.github.kiulian.downloader.model.videos.formats.Format;
import com.github.kiulian.downloader.model.videos.formats.VideoFormat;

After upgrading to version 3.2.6, I’m receiving the following error:

package com.github.kiulian.downloader does not exist

It seems like the package structure has changed, and I cannot find an equivalent package or classes in version 3.2.6. I have also explored the new package path, but couldn't find a suitable replacement (e.g., I checked com.github.sealedtx.downloader).

Steps Taken:

  1. Verified the library in IntelliJ to check the package structure.
  2. Checked the documentation and README.md file but found no information on this change.
  3. Forced a Maven dependency update using mvn clean install.

Here is the relevant part of my pom.xml file:

<dependency>
    <groupId>com.github.sealedtx</groupId>
    <artifactId>java-youtube-downloader</artifactId>
    <version>3.2.6</version>
</dependency>
<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>

Expected behavior: I expect to be able to import the classes like I did with version 3.2.3. Is there a change in the package structure that I am missing? If so, could you please provide the correct imports for version 3.2.6?

Environment:

Thank you for your assistance!

sealedtx commented 1 month ago

@StevenDieu Hi, I just checked with empty project - works fine, probably issue is somewhere with your maven. Try removing .m2 cache.

my pom.xml:

<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>org.example</groupId>
    <artifactId>test-project</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.github.sealedtx</groupId>
            <artifactId>java-youtube-downloader</artifactId>
            <version>3.2.6</version>
        </dependency>
    </dependencies>

</project>
package org.example;

import com.github.kiulian.downloader.YoutubeDownloader;

public class Main {
    public static void main(String[] args) {
        YoutubeDownloader downloader = new YoutubeDownloader();
        System.out.println("Hello world!");
    }
}