Commit ae6a6379 authored by sebaro's avatar sebaro

Fix YouTube, IMDb

parent 180ce408
......@@ -3,8 +3,11 @@
/* SaveTube Changelog */
#2020.05.10
- fixes YouTube, IMDb
#2020.02.10
- Script: fixed file extention when title contains dots
- Script: fixed file extension when title contains dots
- Script: fixed video selection when DASH download is disabled
#2020.02.09
......
......@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "SaveTube",
"version": "2020.1.24",
"version": "2020.5.10",
"description": "Download videos from video sharing web sites.",
......@@ -22,8 +22,6 @@
"http://www.youtube.com/*",
"https://youtube.com/*",
"https://www.youtube.com/*",
"http://gaming.youtube.com/*",
"https://gaming.youtube.com/*",
"http://m.youtube.com/*",
"https://m.youtube.com/*",
"http://dailymotion.com/*",
......
// ==UserScript==
// @name SaveTube
// @version 2020.02.10
// @version 2020.05.10
// @description Download videos from video sharing web sites.
// @author sebaro
// @namespace http://sebaro.pro/savetube
......@@ -720,12 +720,12 @@ function SaveTube() {
if (ytVideosEncodedFmtsNew) {
ytVideosEncodedFmts = '';
ytVideosEncodedFmtsNew = cleanMyContent(ytVideosEncodedFmtsNew, false);
ytVideosEncodedFmtsNew = ytVideosEncodedFmtsNew.match(new RegExp('"(url|cipher)":\s*".*?"', 'g'));
ytVideosEncodedFmtsNew = ytVideosEncodedFmtsNew.match(new RegExp('"(url|cipher|signatureCipher)":\s*".*?"', 'g'));
if (ytVideosEncodedFmtsNew) {
for (var i = 0 ; i < ytVideosEncodedFmtsNew.length; i++) {
ytVideosEncodedFmts += ytVideosEncodedFmtsNew[i].replace(/"/g, '').replace('url:', 'url=').replace('cipher:', '') + ',';
ytVideosEncodedFmts += ytVideosEncodedFmtsNew[i].replace(/"/g, '').replace('url:', 'url=').replace('cipher:', '').replace('signatureCipher:', '') + ',';
}
if (ytVideosEncodedFmts.indexOf('%3A%2F%2F') != -1) {
if (ytVideosEncodedFmts.indexOf('itag%3D') != -1) {
ytVideosEncodedFmts = cleanMyContent(ytVideosEncodedFmts, true);
}
}
......@@ -737,12 +737,12 @@ function SaveTube() {
if (ytVideosAdaptiveFmtsNew) {
ytVideosAdaptiveFmts = '';
ytVideosAdaptiveFmtsNew = cleanMyContent(ytVideosAdaptiveFmtsNew, false);
ytVideosAdaptiveFmtsNew = ytVideosAdaptiveFmtsNew.match(new RegExp('"(url|cipher)":\s*".*?"', 'g'));
ytVideosAdaptiveFmtsNew = ytVideosAdaptiveFmtsNew.match(new RegExp('"(url|cipher|signatureCipher)":\s*".*?"', 'g'));
if (ytVideosAdaptiveFmtsNew) {
for (var i = 0 ; i < ytVideosAdaptiveFmtsNew.length; i++) {
ytVideosAdaptiveFmts += ytVideosAdaptiveFmtsNew[i].replace(/"/g, '').replace('url:', 'url=').replace('cipher:', '') + ',';
ytVideosAdaptiveFmts += ytVideosAdaptiveFmtsNew[i].replace(/"/g, '').replace('url:', 'url=').replace('cipher:', '').replace('signatureCipher:', '') + ',';
}
if (ytVideosAdaptiveFmts.indexOf('%3A%2F%2F') != -1) {
if (ytVideosAdaptiveFmts.indexOf('itag%3D') != -1) {
ytVideosAdaptiveFmts = cleanMyContent(ytVideosAdaptiveFmts, true);
}
}
......@@ -802,12 +802,12 @@ function SaveTube() {
if (ytVideosEncodedFmtsNew) {
ytVideosEncodedFmts = '';
ytVideosEncodedFmtsNew = cleanMyContent(ytVideosEncodedFmtsNew, true);
ytVideosEncodedFmtsNew = ytVideosEncodedFmtsNew.match(new RegExp('"(url|cipher)":\s*".*?"', 'g'));
ytVideosEncodedFmtsNew = ytVideosEncodedFmtsNew.match(new RegExp('"(url|cipher|signatureCipher)":\s*".*?"', 'g'));
if (ytVideosEncodedFmtsNew) {
for (var i = 0 ; i < ytVideosEncodedFmtsNew.length; i++) {
ytVideosEncodedFmts += ytVideosEncodedFmtsNew[i].replace(/"/g, '').replace('url:', 'url=').replace('cipher:', '') + ',';
ytVideosEncodedFmts += ytVideosEncodedFmtsNew[i].replace(/"/g, '').replace('url:', 'url=').replace('cipher:', '').replace('signatureCipher:', '') + ',';
}
if (ytVideosEncodedFmts.indexOf('%3A%2F%2F') != -1) {
if (ytVideosEncodedFmts.indexOf('itag%3D') != -1) {
ytVideosEncodedFmts = cleanMyContent(ytVideosEncodedFmts, true);
}
ytVideosContent = ytVideosEncodedFmts;
......@@ -824,12 +824,12 @@ function SaveTube() {
if (ytVideosAdaptiveFmtsNew) {
ytVideosAdaptiveFmts = '';
ytVideosAdaptiveFmtsNew = cleanMyContent(ytVideosAdaptiveFmtsNew, true);
ytVideosAdaptiveFmtsNew = ytVideosAdaptiveFmtsNew.match(new RegExp('"(url|cipher)":\s*".*?"', 'g'));
ytVideosAdaptiveFmtsNew = ytVideosAdaptiveFmtsNew.match(new RegExp('"(url|cipher|signatureCipher)":\s*".*?"', 'g'));
if (ytVideosAdaptiveFmtsNew) {
for (var i = 0 ; i < ytVideosAdaptiveFmtsNew.length; i++) {
ytVideosAdaptiveFmts += ytVideosAdaptiveFmtsNew[i].replace(/"/g, '').replace('url:', 'url=').replace('cipher:', '') + ',';
ytVideosAdaptiveFmts += ytVideosAdaptiveFmtsNew[i].replace(/"/g, '').replace('url:', 'url=').replace('cipher:', '').replace('signatureCipher:', '') + ',';
}
if (ytVideosAdaptiveFmts.indexOf('%3A%2F%2F') != -1) {
if (ytVideosAdaptiveFmts.indexOf('itag%3D') != -1) {
ytVideosAdaptiveFmts = cleanMyContent(ytVideosAdaptiveFmts, true);
}
}
......@@ -1567,7 +1567,9 @@ function SaveTube() {
if (imdbVideoTitle) imdbVideoTitle = cleanMyContent(imdbVideoTitle, false, true);
/* Get Data Key */
var imdbDataKey = getMyContent(page.url, '"playbackDataKey":\\["(.*?)"\\]');
var imdbVideoId = page.url.replace(/^.*?\/(vi\d+).*/, '$1');
var imdbDataJSON = '{"type": "VIDEO_PLAYER", "subType": "FORCE_LEGACY", "id": "' + imdbVideoId + '"}';
var imdbDataKey = btoa(imdbDataJSON);
/* Get Videos Content */
var imdbVideosContent = getMyContent(page.url.replace(/video\/.*/, 've/data/VIDEO_PLAYBACK_DATA?key=' + imdbDataKey), '"videoLegacyEncodings":\\[(.*?)\\]', false);
......
// ==UserScript==
// @name SaveTube+
// @version 2020.01.24
// @version 2020.03.30
// @description Download videos from web sites.
// @author sebaro
// @namespace http://sebaro.pro/savetube
......@@ -109,7 +109,7 @@ for (var i = 0; i < patterns.length; i++) {
}
if (links.length > 0) {
var panel = document.createElement('div');
styleMyElement(panel, {position: 'fixed', fontFamily: 'sans-serif', fontSize: '10px', height: panelHeight + 'px', lineHeight: panelHeight + 'px', backgroundColor: '#FFFFFF', padding: '0px 10px 5px 10px', bottom: '0px', right: '25px', zIndex: '2000000000', borderTop: '1px solid #CCCCCC', borderLeft: '1px solid #CCCCCC', borderRight: '1px solid #CCCCCC', borderRadius: '5px 5px 0px 0px', textAlign: 'center', boxSizing: 'content-box'});
styleMyElement(panel, {position: 'fixed', display: 'block', fontFamily: 'sans-serif', fontSize: '10px', height: panelHeight + 'px', lineHeight: panelHeight + 'px', backgroundColor: '#FFFFFF', padding: '0px 10px 5px 10px', bottom: '0px', right: '25px', zIndex: '2000000000', borderTop: '1px solid #CCCCCC', borderLeft: '1px solid #CCCCCC', borderRight: '1px solid #CCCCCC', borderRadius: '5px 5px 0px 0px', textAlign: 'center', boxSizing: 'content-box'});
document.body.appendChild(panel);
var logo = document.createElement('div');
styleMyElement(logo, {display: 'inline-block', color: '#32D132', fontSize: '14px', fontWeight: 'bold', border: '1px solid #32D132', borderRadius: '3px', padding: '0px 4px', marginRight: '10px', lineHeight: 'normal', verticalAlign: 'middle', cursor: 'pointer', boxSizing: 'content-box'});
......
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