diff --git a/changelog.txt b/changelog.txt index 46aa1eb..b0b43c6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +v4.0.1 + - Fixed video's to be in the correct order when downloading + - Fixed invalidLogin's not being handled with the new API + + v4.0.0 - Updated cookies for normal login - Added login functionality for Floatplane.com @@ -12,16 +17,6 @@ v4.0.0 - Updated maxVideos to work with any number - Updated posters - Rewrote subChannel detection code - - Removed subChannelIgnore from settings.json - - Updated episode counting - - Added MOAR colours - - Removed youtube support (For videos on the form that were from youtube) - - Checked support for other Floatplane Creators - - Fixed spacing for downloading videos - - Updated printouts for downloads - - Updated ffmpeg error printouts - - Added checkForNewSubscriptions in settings.json - - Added Tech Deals artwork v3.8.3 - Set default user-agent to identify script diff --git a/float.js b/float.js index c19085c..4e05ed7 100644 --- a/float.js +++ b/float.js @@ -15,8 +15,8 @@ const spawn = require('child_process').spawn; const AdmZip = require('adm-zip'); process.on('uncaughtException', function(err) { // "Nice" Error handling, will obscure unknown errors, remove or comment for full debugging - if (err == "TypeError: Cannot read property '0' of undefined") { // If this error - console.log('\u001b[41mERROR> Using old session data is failing! Please set forceLogin to true in settings.json\u001b[0m') // Then print out what the user should do + if (err == "TypeError: JSON.parse(...).reverse is not a function") { // If this error + console.log('\u001b[41mERROR> Failed to login please check your login credentials!\u001b[0m') // Then print out what the user should do } if (err == "ReferenceError: thisChannel is not defined") { console.log('\u001b[41mERROR> Error with "maxVideos"! Please set "maxVideos" to something other than '+settings.maxVideos+' in settings.json\u001b[0m') } if(err.toString().indexOf('Unexpected end of JSON input') > -1 && err.toString().indexOf('partial.json') > -1) { // If this error and the error is related to this file @@ -384,7 +384,7 @@ function parseKey() { // Get the key used to download videos Cookie: settings.cookie, } }, function (err, resp, body) { - if (body.includes('')) { // Check if key is invalid + if (JSON.parse(body).message == "You must be logged-in to access this resource.") { // Check if key is invalid console.log('\u001b[31mInvalid Key! Attempting to re-authenticate...\u001b[0m'); settings.cookies.__cfduid = '' // If its invalid check authentication again, reconstruct the cookies and then try parsekey again if that goes through then resolve @@ -415,7 +415,7 @@ function getVideos() { } else { // Otherwise just log it normally console.log('\n\n=== \u001b[38;5;8m'+subscription.title+'\u001b[0m ===') } - JSON.parse(body).forEach(function(video, i) { + JSON.parse(body).reverse().forEach(function(video, i) { if (i+(page*20) >= settings.maxVideos) { // Break on max videos parsed return false } diff --git a/releases/4.0.1.zip b/releases/4.0.1.zip new file mode 100644 index 0000000..9d26776 Binary files /dev/null and b/releases/4.0.1.zip differ diff --git a/settings.json b/settings.json index fff0464..f54e594 100644 --- a/settings.json +++ b/settings.json @@ -1,5 +1,5 @@ { - "version": "4.0.0", + "version": "4.0.1", "videoFolder": "./videos/", "maxVideos": 5, "maxParallelDownloads": -1,