Commit 9c0de9f6 authored by sebaro's avatar sebaro

Fix YouTube

parent 2efd0fc6
......@@ -3,6 +3,9 @@
/* SaveTube Changelog */
#2018.11.07
- fixes YouTube
#2018.09.09
- fixes YouTube, IMDb
......
......@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "SaveTube",
"version": "2018.9.9",
"version": "2018.11.7",
"description": "Download videos from video sharing web sites.",
......@@ -59,7 +59,8 @@
"https://imdb.com/*",
"https://www.imdb.com/*"
],
"js": ["savetube.user.js"]
"js": ["savetube.user.js"],
"run_at": "document_end"
}
],
......
// ==UserScript==
// @name SaveTube
// @version 2018.09.09
// @version 2018.11.07
// @description Download videos from video sharing web sites.
// @author sebaro
// @namespace http://sebaro.pro/savetube
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @downloadURL https://gitlab.com/sebaro/savetube/raw/master/savetube.user.js
// @updateURL https://gitlab.com/sebaro/savetube/raw/master/savetube.user.js
// @icon https://gitlab.com/sebaro/savetube/raw/master/savetube.png
......@@ -48,6 +47,9 @@
// @include http://www.imdb.com*
// @include https://imdb.com*
// @include https://www.imdb.com*
// @noframes
// @grant none
// @run-at document-end
// ==/UserScript==
......@@ -593,7 +595,7 @@ function SaveTube() {
var ytSignFuncName, ytSignFuncBody, ytSwapFuncName, ytSwapFuncBody, ytFuncMatch;
ytScriptSrc = ytScriptSrc.replace(/(\r\n|\n|\r)/gm, '');
ytSignFuncName = ytScriptSrc.match(/"signature"\s*,\s*([^\)]*?)\(/);
if (!ytSignFuncName) ytSignFuncName = ytScriptSrc.match(/d.set\(b,(.*?)\(/);
if (!ytSignFuncName) ytSignFuncName = ytScriptSrc.match(/d.set\(b,.*?([a-zA-Z0-9]+)\(/);
ytSignFuncName = (ytSignFuncName) ? ytSignFuncName[1] : null;
if (ytSignFuncName) {
ytFuncMatch = ytSignFuncName.replace(/\$/, '\\$') + '\\s*=\\s*function\\s*' + '\\s*\\(\\w+\\)\\s*\\{(.*?)\\}';
......@@ -1463,7 +1465,9 @@ SaveTube();
page.win.setInterval(function() {
if (page.url != page.win.location.href) {
if(saver['saverPanel']) removeMyElement(page.body, saver['saverPanel']);
if (saver['saverPanel'] && saver['saverPanel'].parentNode) {
removeMyElement(saver['saverPanel'].parentNode, saver['saverPanel']);
}
page.doc = page.win.document;
page.body = page.doc.body;
page.url = page.win.location.href;
......
Images/logo128.png

4.93 KB | W: | H:

Images/logo128.png

5.51 KB | W: | H:

Images/logo128.png
Images/logo128.png
Images/logo128.png
Images/logo128.png
  • 2-up
  • Swipe
  • Onion skin
Images/logo16.png

836 Bytes | W: | H:

Images/logo16.png

1.36 KB | W: | H:

Images/logo16.png
Images/logo16.png
Images/logo16.png
Images/logo16.png
  • 2-up
  • Swipe
  • Onion skin
Images/logo32.png

1.58 KB | W: | H:

Images/logo32.png

1.51 KB | W: | H:

Images/logo32.png
Images/logo32.png
Images/logo32.png
Images/logo32.png
  • 2-up
  • Swipe
  • Onion skin
Images/logo48.png

2.14 KB | W: | H:

Images/logo48.png

2.33 KB | W: | H:

Images/logo48.png
Images/logo48.png
Images/logo48.png
Images/logo48.png
  • 2-up
  • Swipe
  • Onion skin
Images/logo500.png

10.9 KB | W: | H:

Images/logo500.png

12.7 KB | W: | H:

Images/logo500.png
Images/logo500.png
Images/logo500.png
Images/logo500.png
  • 2-up
  • Swipe
  • Onion skin
Images/logo64.png

2.71 KB | W: | H:

Images/logo64.png

3.02 KB | W: | H:

Images/logo64.png
Images/logo64.png
Images/logo64.png
Images/logo64.png
  • 2-up
  • Swipe
  • Onion skin
Images/logo96.png

3.85 KB | W: | H:

Images/logo96.png

4.22 KB | W: | H:

Images/logo96.png
Images/logo96.png
Images/logo96.png
Images/logo96.png
  • 2-up
  • Swipe
  • Onion skin
Images/logotile.png

5.96 KB | W: | H:

Images/logotile.png

9.73 KB | W: | H:

Images/logotile.png
Images/logotile.png
Images/logotile.png
Images/logotile.png
  • 2-up
  • Swipe
  • Onion skin
savetube.png

1.58 KB | W: | H:

savetube.png

1.51 KB | W: | H:

savetube.png
savetube.png
savetube.png
savetube.png
  • 2-up
  • Swipe
  • Onion skin
// ==UserScript==
// @name SaveTube
// @version 2018.09.09
// @version 2018.11.07
// @description Download videos from video sharing web sites.
// @author sebaro
// @namespace http://sebaro.pro/savetube
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @downloadURL https://gitlab.com/sebaro/savetube/raw/master/savetube.user.js
// @updateURL https://gitlab.com/sebaro/savetube/raw/master/savetube.user.js
// @icon https://gitlab.com/sebaro/savetube/raw/master/savetube.png
......@@ -48,6 +47,9 @@
// @include http://www.imdb.com*
// @include https://imdb.com*
// @include https://www.imdb.com*
// @noframes
// @grant none
// @run-at document-end
// ==/UserScript==
......@@ -593,7 +595,7 @@ function SaveTube() {
var ytSignFuncName, ytSignFuncBody, ytSwapFuncName, ytSwapFuncBody, ytFuncMatch;
ytScriptSrc = ytScriptSrc.replace(/(\r\n|\n|\r)/gm, '');
ytSignFuncName = ytScriptSrc.match(/"signature"\s*,\s*([^\)]*?)\(/);
if (!ytSignFuncName) ytSignFuncName = ytScriptSrc.match(/d.set\(b,(.*?)\(/);
if (!ytSignFuncName) ytSignFuncName = ytScriptSrc.match(/d.set\(b,.*?([a-zA-Z0-9]+)\(/);
ytSignFuncName = (ytSignFuncName) ? ytSignFuncName[1] : null;
if (ytSignFuncName) {
ytFuncMatch = ytSignFuncName.replace(/\$/, '\\$') + '\\s*=\\s*function\\s*' + '\\s*\\(\\w+\\)\\s*\\{(.*?)\\}';
......@@ -1463,7 +1465,9 @@ SaveTube();
page.win.setInterval(function() {
if (page.url != page.win.location.href) {
if(saver['saverPanel']) removeMyElement(page.body, saver['saverPanel']);
if (saver['saverPanel'] && saver['saverPanel'].parentNode) {
removeMyElement(saver['saverPanel'].parentNode, saver['saverPanel']);
}
page.doc = page.win.document;
page.body = page.doc.body;
page.url = page.win.location.href;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment