Fix Google Drive URL

This commit is contained in:
Calvin Montgomery 2016-10-20 19:07:03 -07:00
parent 3c11ac6cf5
commit afa18c4749
4 changed files with 20 additions and 5 deletions

12
NEWS.md
View File

@ -1,3 +1,15 @@
2016-10-20
==========
Google Drive changed the URL schema for retrieving video metadata, which broke
CyTube's Google Drive support, even with the userscript. I have updated the
userscript source with the new URL, so server administrators will have to
regenerate the userscript for their site and users will be prompted to install
the newer version.
Additionally, fixing Drive lookups required an update to the `mediaquery`
module, so you will have to do an `npm install` to pull that fix in.
2016-08-23 2016-08-23
========== ==========

View File

@ -7,7 +7,7 @@
// @grant GM_xmlhttpRequest // @grant GM_xmlhttpRequest
// @connect docs.google.com // @connect docs.google.com
// @run-at document-end // @run-at document-end
// @version 1.2.0 // @version 1.3.0
// ==/UserScript== // ==/UserScript==
try { try {
@ -50,7 +50,10 @@ try {
}; };
function getVideoInfo(id, cb) { function getVideoInfo(id, cb) {
var url = 'https://docs.google.com/file/d/' + id + '/get_video_info'; var url = 'https://docs.google.com/get_video_info?authuser='
+ '&docid=' + id
+ '&sle=true'
+ '&hl=en';
debug('Fetching ' + url); debug('Fetching ' + url);
GM_xmlhttpRequest({ GM_xmlhttpRequest({
@ -201,7 +204,7 @@ try {
unsafeWindow.console.log('Initialized userscript Google Drive player'); unsafeWindow.console.log('Initialized userscript Google Drive player');
unsafeWindow.hasDriveUserscript = true; unsafeWindow.hasDriveUserscript = true;
unsafeWindow.driveUserscriptVersion = '1.2'; unsafeWindow.driveUserscriptVersion = '1.3';
} catch (error) { } catch (error) {
unsafeWindow.console.error(error); unsafeWindow.console.error(error);
} }

View File

@ -2,7 +2,7 @@
"author": "Calvin Montgomery", "author": "Calvin Montgomery",
"name": "CyTube", "name": "CyTube",
"description": "Online media synchronizer and chat", "description": "Online media synchronizer and chat",
"version": "3.23.4", "version": "3.23.5",
"repository": { "repository": {
"url": "http://github.com/calzoneman/sync" "url": "http://github.com/calzoneman/sync"
}, },

View File

@ -3215,7 +3215,7 @@ function maybePromptToUpgradeUserscript() {
return; return;
} }
var currentVersion = [1, 2]; var currentVersion = [1, 3];
var userscriptVersion = window.driveUserscriptVersion; var userscriptVersion = window.driveUserscriptVersion;
if (!userscriptVersion) { if (!userscriptVersion) {
userscriptVersion = '1.0'; userscriptVersion = '1.0';