diff --git a/package-lock.json b/package-lock.json index 07f5cb7f..1a1d54bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18590,9 +18590,9 @@ } }, "ytsr": { - "version": "2.0.0-alpha.3", - "resolved": "https://registry.npmjs.org/ytsr/-/ytsr-2.0.0-alpha.3.tgz", - "integrity": "sha512-NELl/ubEnBxxU/AofsXu8p6T2BArf/ROLOocblTgeSr7oNPPn6jPv57MCT4cIWJdzxWiHcdl6BqrypoIPejfmw==", + "version": "2.0.0-alpha.4", + "resolved": "https://registry.npmjs.org/ytsr/-/ytsr-2.0.0-alpha.4.tgz", + "integrity": "sha512-iEXOu0kFwxr9O+mpG3tnZa6TovEOZ92N0rNmyZFEv5EdcFg9FWH8MEUJVMExCFhSYu1rSFv5napQCzDCozizdg==", "requires": { "html-entities": "^1.3.1", "miniget": "^4.1.0" diff --git a/package.json b/package.json index 302e108d..20f79738 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "yt-xml2vtt": "^1.1.3", "ytdl-core": "^4.1.1", "ytpl": "^2.0.0-alpha.3", - "ytsr": "^2.0.0-alpha.3" + "ytsr": "^2.0.0-alpha.4" }, "description": "A private YouTube client", "devDependencies": { diff --git a/src/renderer/components/watch-video-info/watch-video-info.js b/src/renderer/components/watch-video-info/watch-video-info.js index 31f226b6..89c62bcf 100644 --- a/src/renderer/components/watch-video-info/watch-video-info.js +++ b/src/renderer/components/watch-video-info/watch-video-info.js @@ -197,6 +197,10 @@ export default Vue.extend({ }, handleSubscription: function () { + if (this.channelId === '') { + return + } + const currentProfile = JSON.parse(JSON.stringify(this.profileList[this.activeProfile])) const primaryProfile = JSON.parse(JSON.stringify(this.profileList[0])) diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index e9ff2a8b..58957bd5 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -195,6 +195,30 @@ export default Vue.extend({ .dispatch('ytGetVideoInformation', this.videoId) .then(async result => { console.log(result) + + const playabilityStatus = result.player_response.playabilityStatus + if (playabilityStatus.status !== 'OK') { + const errorScreen = playabilityStatus.errorScreen.playerErrorMessageRenderer + const reason = errorScreen.reason.simpleText + let subReason + let skipIndex + errorScreen.subreason.runs.forEach((message, index) => { + if (index !== skipIndex) { + if (message.text.match(//)) { + skipIndex = index + 1 + } else if (!message.text.match(/<\/a>/)) { + if (typeof subReason === 'undefined') { + subReason = message.text + } else { + subReason = subReason + message.text + } + } + } + }) + + throw new Error(`${reason}: ${subReason}`) + } + this.videoTitle = result.videoDetails.title this.videoViewCount = parseInt( result.player_response.videoDetails.viewCount, @@ -457,6 +481,10 @@ export default Vue.extend({ .then(result => { console.log(result) + if (result.error) { + throw new Error(result.error) + } + this.videoTitle = result.title this.videoViewCount = result.viewCount if (this.hideVideoLikesAndDislikes) {