From 21a1af7d31d0459032241f63376806cfa3e24a2b Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Sat, 16 Jun 2018 12:37:31 -0400 Subject: [PATCH] Twitter ripper no longer errors out on some videos --- .../rarchives/ripme/ripper/rippers/TwitterRipper.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/TwitterRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/TwitterRipper.java index 94ab41a3..52c7e16f 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/TwitterRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/TwitterRipper.java @@ -194,9 +194,13 @@ public class TwitterRipper extends AlbumRipper { // Loop over all the video options and find the biggest video for (int j = 0; j < medias.length(); j++) { JSONObject variant = (JSONObject) variants.get(i); - if (variant.getInt("bitrate") > largestBitrate) { - largestBitrate = variant.getInt("bitrate"); - urlToDownload = variant.getString("url"); + LOGGER.info(variant); + // If the video doesn't have a bitrate it's a m3u8 file we can't download + if (variant.has("bitrate")) { + if (variant.getInt("bitrate") > largestBitrate) { + largestBitrate = variant.getInt("bitrate"); + urlToDownload = variant.getString("url"); + } } } if (urlToDownload != null) {