Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playlist extraction error #67

Closed
BrdEase opened this issue Nov 18, 2020 · 15 comments
Closed

Playlist extraction error #67

BrdEase opened this issue Nov 18, 2020 · 15 comments

Comments

@BrdEase
Copy link

BrdEase commented Nov 18, 2020

Trying the example code from the "usage" section, as follows:

import com.github.kiulian.downloader.YoutubeDownloader;
import com.github.kiulian.downloader.YoutubeException;
import com.github.kiulian.downloader.model.YoutubeVideo;
import com.github.kiulian.downloader.model.playlist.PlaylistDetails;
import com.github.kiulian.downloader.model.playlist.PlaylistVideoDetails;
import com.github.kiulian.downloader.model.playlist.YoutubePlaylist;

public class Youtube {

public static void main(String[] args) throws YoutubeException {
	
	YoutubeDownloader downloader = new YoutubeDownloader(); 
	// downloader configurations
	downloader.setParserRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36");
	downloader.setParserRetryOnFailure(1);
	
	String playlistId = "PLjhaAcnXuuftpJKWB21uRzqe-4_d4Uuoj"; // for url https://www.youtube.com/playlist?list=abc12345
	YoutubePlaylist playlist = downloader.getPlaylist(playlistId);
	
	// playlist details
	PlaylistDetails details = playlist.details();
	System.out.println(details.title());
	
	System.out.println(details.videoCount());
	
	// get video details
	PlaylistVideoDetails videoDetails = playlist.videos().get(0);
	System.out.println(videoDetails.title());
	
	System.out.println(videoDetails.index());
	
	// get video
	YoutubeVideo video = downloader.getVideo(videoDetails.videoId());
}

The playlist link is: https://www.youtube.com/playlist?list=PLjhaAcnXuuftpJKWB21uRzqe-4_d4Uuoj
I'm using it's id: PLjhaAcnXuuftpJKWB21uRzqe-4_d4Uuoj

throws this:

Exception in thread "main" java.lang.NullPointerException at com.github.kiulian.downloader.model.AbstractVideoDetails.<init>(AbstractVideoDetails.java:28) 
at com.github.kiulian.downloader.model.playlist.PlaylistVideoDetails.<init>(PlaylistVideoDetails.java:19) 
at com.github.kiulian.downloader.parser.DefaultParser.populatePlaylist(DefaultParser.java:354) 
at com.github.kiulian.downloader.parser.DefaultParser.getPlaylistVideos(DefaultParser.java:271) 
at com.github.kiulian.downloader.YoutubeDownloader.getPlaylist(YoutubeDownloader.java:70) 
at spotify.youtube.Youtube.main(Youtube.java:20)

You should really consider making this library more usable, better docs, better examples and explanations, and of couse better Null Pointer Exception avoiding.

@Dolanpls
Copy link

Dolanpls commented Nov 18, 2020

Calm down @BrdEase 😢 this is a free library maked for an only person on his free time, its not perfect, but rememmber that its free and @sealedtx do a great job on his free time

@BrdEase
Copy link
Author

BrdEase commented Nov 18, 2020

unnecessary rudeness v2.0

@Dolanpls
Copy link

You are a Java developer, then why you don't fix the problem and create a new PR with the fix?
This is an open community and all are welcome to improve the code

@BrdEase
Copy link
Author

BrdEase commented Nov 18, 2020

unnecessary rudeness v3.0

@BrdEase BrdEase closed this as completed Nov 18, 2020
@Shabinder
Copy link

@BrdEase vey rude and demotivating , despite of all the free efforts by developer.
😑

@sealedtx you are doing a great job ,keep up the good work.👍

@BrdEase
Copy link
Author

BrdEase commented Nov 18, 2020

Yeah i was rude af for no reason, I ended using youtube api.

@Dolanpls
Copy link

GL with api key limit

@BrdEase
Copy link
Author

BrdEase commented Nov 19, 2020

Enough for non-comercial use, according to this table (https://developers.google.com/youtube/v3/determine_quota_cost)

@Dolanpls
Copy link

Dolanpls commented Nov 19, 2020

Then you are very lucky 😂 I had 15 keys and I would need 100 if I use his api because youtube reduced the api key limit one day 90% 🤦🏻‍♂️

@BrdEase
Copy link
Author

BrdEase commented Nov 19, 2020

If I have some free time I'll try to fix this library, and add a search video mechanism. Is there any way to get in touch with the dev?

@sealedtx
Copy link
Owner

sealedtx commented Nov 19, 2020

@BrdEase Hi. Sorry for your bad experience. Please, notice that:

  1. this library is web scrapper
  2. youtube often changes web structure of its pages
  3. I don't use this library every minute or even every day to find the errors

THIS DON'T WORK, DON'T LOOSE YOUR TIME TRYING TO MAKE THIS SHIT WORK

Thats why errors are fixed as soon as someone finds it and opens an issue. After reviewing I try to fix it when I have spare time or review PR. I will add something similar to your idea to README, to make people aware of this.

Is there any way to get in touch with the dev?

Sure, PRs are welcomed

@BrdEase
Copy link
Author

BrdEase commented Nov 19, 2020

What PR stands for?

@sealedtx
Copy link
Owner

What PR stands for?

PR - Pull Request

@sealedtx sealedtx changed the title Nothing works Playlist extraction error Nov 20, 2020
@sealedtx sealedtx reopened this Nov 20, 2020
@sealedtx sealedtx added the bug label Nov 20, 2020
@sealedtx
Copy link
Owner

sealedtx commented Nov 20, 2020

There was a problem with extraction of continuationItems (playlist pagination). Fixed in f8cebea available in 2.4.5 release

@BrdEase
Copy link
Author

BrdEase commented Nov 20, 2020

Yeah you are fucking awesome dude

@BrdEase BrdEase closed this as completed Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants