DV8FromTheWorld / JDA-Player

Extension library for JDA (or D4J) that provides an Java wrapping of Youtube-dl, FFmpeg and FFprobe for use as an AudioProvider.
Apache License 2.0
14 stars 5 forks source link

Doesn't work with YouTube links... #10

Closed FetchLeo closed 8 years ago

FetchLeo commented 8 years ago

Hi!

I'm trying to create a small Discord bot (just to see how it's done), and one of the things I wanted to add was a music player.

I got JDA and JDA-Player set up, but now I've run into a very strange issue. If I try to play a YouTube video, I get the NullPointerException stating that a "zero-length or null INFO was returned!" However, when I play from Soundcloud, it works perfectly fine.

Some details:

EDIT: Accidentally submitted this before I finished. Stupid trackpad. The rest of it is below.

I haven't tried to run this on Linux, because I don't really feel like copying the JAR files over right now.

How to reproduce (at least for me):

I'm not sure what I'm doing wrong here. If code is needed, I can provide it.

Thanks.

FetchLeo commented 8 years ago

Pinging @DV8FromTheWorld and @MinnDevelopment in case they don't see this.

MinnDevelopment commented 8 years ago

Are you sure you have the correct version of ffmpeg and ffprobe installed and accessible via terminal? Note: You need the static version for your OS and it needs to be accessible from the working directory of your bot or youtube-dl in specific. You also need the binary script version of youtube-dl

Does this happen for every youtube link?

FetchLeo commented 8 years ago

First off, I'd like to point out that I've only tested this using the Playlist.getPlaylist() method. Not sure if I should be using something different for YouTube links.

ffmpeg and ffprobe are both installed and accessible; what would the "correct version" be?

The static versions (I'm guessing those are the files that you download and place into the directory) are there as well and work fine. youtube-dl is also accessible, and I did download the binary version.

And yes, this does happen for every YouTube link.

Output of ls in the root project directory (I confirmed that the program is indeed running from there):

image

Not sure what's going on here.

If it helps, here's some output from the command line (running the different youtube-dl commands):

image

Also, upon further inspection (I created my own Playlist class), I noticed that when the Playlist class tries to read the data from the process, it thinks that there's nothing; although when I run the command that it would've run, from the command line, it obviously does return data.

Hopefully you can help!

Thanks =)

FetchLeo commented 8 years ago

pinging @DV8FromTheWorld in case he knows what I should do

freyacodes commented 8 years ago

Do you have ffmpeg and ffprobe in your path?

FetchLeo commented 8 years ago

Yes, I do. I don't think that's the problem, though; I can still play music from Soundcloud.

ffmpeg, ffprobe, and youtube-dl are all accessible.

freyacodes commented 8 years ago

What happens when you manually run this command?

python youtube-dl -x <youtube URL>
FetchLeo commented 8 years ago

Works just fine.

FetchLeo commented 8 years ago

Fixed it, I think. Turns out Youtube video IDs are case-sensitive. I was running all input through toLowerCase(). Silly me.