postaddictme/instagram-java-scraper

carousel Media dont work

emami7495 opened this issue · 5 comments

carousel Media function from Media class don't work , and it has null pointer Exception

@emami7495 could you provide more details: media code, exception and stacktrace?
For me all works fine!

instagram = null; Thread thread = new Thread(new Runnable() { @Override public void run() { try { instagram = new Instagram(new OkHttpClient()); url = e1.getText().toString(); if (url.charAt(url.length() - 1) == '/') { url = url.substring(0, url.length() - 1); } Media media = instagram.getMediaByUrl(url); // Media.ImageUrls imageUrls = media.imageUrls; System.out.println(imageUrls); url = imageUrls.high; Media.VideoUrls videoUrls = media.videoUrls; videoUrl = videoUrls.standard; if (videoUrl != null) { System.out.println("videoUrl"); } // System.out.println(media.type); System.out.println(media.carouselMedia.size()); } catch (Exception e) { e.printStackTrace(); } } });

When I write the address of a carouselMedia as a url And I want to see the size of CarouselMadia, The error is that list of CarouselMadia is null

@emami7495 you use old library version.
Try lates com.github.igor-suhorukov:instagramscraper:2.0 it works with carousel Media

thanks a lot ;)

image

last version has this error