Merge pull request #717 from cyian-1756/twitterFix

Twitter ripper no longer errors out on some videos
This commit is contained in:
cyian-1756 2018-06-19 16:28:55 -04:00 committed by GitHub
commit a3dd967a5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -194,9 +194,13 @@ public class TwitterRipper extends AlbumRipper {
// Loop over all the video options and find the biggest video // Loop over all the video options and find the biggest video
for (int j = 0; j < medias.length(); j++) { for (int j = 0; j < medias.length(); j++) {
JSONObject variant = (JSONObject) variants.get(i); JSONObject variant = (JSONObject) variants.get(i);
if (variant.getInt("bitrate") > largestBitrate) { LOGGER.info(variant);
largestBitrate = variant.getInt("bitrate"); // If the video doesn't have a bitrate it's a m3u8 file we can't download
urlToDownload = variant.getString("url"); if (variant.has("bitrate")) {
if (variant.getInt("bitrate") > largestBitrate) {
largestBitrate = variant.getInt("bitrate");
urlToDownload = variant.getString("url");
}
} }
} }
if (urlToDownload != null) { if (urlToDownload != null) {