From 337e8cd1d33e993db2c853016f9fbdaa86a7df09 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Sun, 8 Aug 2021 09:49:20 -0700 Subject: [PATCH] Add some big ol nags about no support for gdrive --- package.json | 2 +- player/gdrive-player.coffee | 27 +++++++++++++++++++++++++++ player/videojs.coffee | 7 +++++-- templates/google_drive_userscript.pug | 27 +++++++++++++++------------ 4 files changed, 48 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 41e75de4..b8e9bf9c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.78.0", + "version": "3.78.1", "repository": { "url": "http://github.com/calzoneman/sync" }, diff --git a/player/gdrive-player.coffee b/player/gdrive-player.coffee index fd4a1db5..ab82e174 100644 --- a/player/gdrive-player.coffee +++ b/player/gdrive-player.coffee @@ -57,3 +57,30 @@ a userscript in order to play the video.""" alertBox.parentNode.removeChild(alertBox) alertBox.insertBefore(closeButton, alertBox.firstChild) removeOld($('
').append(alertBox)) + +window.tellUserNotToContactMeAboutThingsThatAreNotSupported = -> + if document.getElementById('prompt-no-gdrive-support') + return + alertBox = document.createElement('div') + alertBox.id = 'prompt-no-gdrive-support' + alertBox.className = 'alert alert-danger' + alertBox.innerHTML = """ +CyTube has detected an error in Google Drive playback. Please note that the +staff in CyTube support channels DO NOT PROVIDE SUPPORT FOR GOOGLE DRIVE. It +is left in the code as-is for existing users, but we will not assist in +troubleshooting any errors that occur.
""" + alertBox.appendChild(document.createElement('br')) + infoLink = document.createElement('a') + infoLink.className = 'btn btn-danger' + infoLink.href = 'https://github.com/calzoneman/sync/wiki/Frequently-Asked-Questions#why-dont-you-support-google-drive-anymore' + infoLink.textContent = 'Click here for details' + infoLink.target = '_blank' + alertBox.appendChild(infoLink) + + closeButton = document.createElement('button') + closeButton.className = 'close pull-right' + closeButton.innerHTML = '×' + closeButton.onclick = -> + alertBox.parentNode.removeChild(alertBox) + alertBox.insertBefore(closeButton, alertBox.firstChild) + removeOld($('
').append(alertBox)) diff --git a/player/videojs.coffee b/player/videojs.coffee index 088cf4d2..6c1a8943 100644 --- a/player/videojs.coffee +++ b/player/videojs.coffee @@ -130,8 +130,11 @@ window.VideoJSPlayer = class VideoJSPlayer extends Player @player.src(@sources[@sourceIdx]) else console.error('Out of sources, video will not play') - if @mediaType is 'gd' and not window.hasDriveUserscript - window.promptToInstallDriveUserscript() + if @mediaType is 'gd' + if not window.hasDriveUserscript + window.promptToInstallDriveUserscript() + else + window.tellUserNotToContactMeAboutThingsThatAreNotSupported() ) @setVolume(VOLUME) @player.on('ended', -> diff --git a/templates/google_drive_userscript.pug b/templates/google_drive_userscript.pug index e7e15ea4..381f5141 100644 --- a/templates/google_drive_userscript.pug +++ b/templates/google_drive_userscript.pug @@ -3,18 +3,21 @@ extends layout.pug block content .col-md-8.col-md-offset-2 h1 Google Drive Userscript - h2 Why? - p. - Since Google Drive support was launched in early 2014, it has broken - at least 4-5 times, requiring increasing effort to get it working again - and disrupting many channels. This is because there is no official API - for it like there is for YouTube videos, which means support for it - relies on undocumented tricks. In August 2016, the decision was made - to phase out the native support for Google Drive and instead require - users to install a userscript, which allows to bypass certain browser - restrictions and make the code easier, simpler, and less prone to failure - (it could still break due to future Google Drive changes, but is less - likely to be difficult to fix). + h2 Disclaimer + .alert.alert-danger.messagebox + strong Unsupported + p. + This functionality is provided as-is for backwards + compatibility for existing users for whom it already is known to work. + There are many reasons, known and unknown, for which it may + not work for you; please note the staff in CyTube + support channels cannot provide any troubleshooting assistance and you + will be asked to simply use a different video provider. + p. + This functionality was originally added so that users could share their + own personal videos stored in their Drive. No support whatsoever will + be provided to users attempting to use it to circumvent copyright + restrictions on third-party video hosts. h2 How It Works p. The userscript is a short script that you can install using a browser