Fix: Update ytdl-core for age restricted videos

This commit is contained in:
Preston 2018-05-14 10:39:02 -04:00
parent 6dab35b68b
commit 3a8cc4ff6e
2 changed files with 10 additions and 9 deletions

View File

@ -58,7 +58,7 @@
}
},
"devDependencies": {
"electron-forge": "^5.1.1",
"electron-forge": "^5.2.2",
"electron-prebuilt-compile": "1.8.2",
"electron-winstaller": "^2.6.4"
},
@ -71,6 +71,6 @@
"mustache": "^2.3.0",
"nedb": "^1.8.0",
"opml-to-json": "0.0.3",
"ytdl-core": "^0.20.2"
"ytdl-core": "^0.20.4"
}
}

View File

@ -218,19 +218,20 @@ function playVideo(videoId, videoThumbnail = '') {
showVideoRecommendations(videoId);
if (Object.keys(info['subtitles']).length > 0) {
let textTracks = $('.videoPlayer').get(0).textTracks;
Object.keys(textTracks).forEach((track) => {
textTracks[track].mode = 'hidden';
});
}
// Sometimes a video URL is found, but the video will not play. I believe the issue is
// that the video has yet to render for that quality, as the video will be available at a later time.
// This will check the URLs and switch video sources if there is an error.
checkVideoUrls(video480p, video720p);
// Add the video to the user's history
addToHistory(videoId);
// Hide subtitles by default
if (Object.keys(info['subtitles']).length > 0) {
let textTracks = $('.videoPlayer').get(0).textTracks;
Object.keys(textTracks).forEach((track) => {
textTracks[track].mode = 'hidden';
});
}
});
}