Commit 274fef93 authored by sebaro's avatar sebaro

Fix VIKI

parent ae6a6379
......@@ -3,6 +3,9 @@
/* SaveTube Changelog */
#2020.10.15
- fixes VIKI
#2020.05.10
- fixes YouTube, IMDb
......
// ==UserScript==
// @name SaveTube
// @version 2020.05.10
// @version 2020.10.15
// @description Download videos from video sharing web sites.
// @author sebaro
// @namespace http://sebaro.pro/savetube
......@@ -1372,26 +1372,25 @@ function SaveTube() {
try {
if (localStorage.getItem(SHA1Key)) {
SHA1FuncBody = localStorage.getItem(SHA1Key);
if (SHA1FuncBody.indexOf('SHA-1') == -1) throw false;
}
else throw false;
}
catch(e) {
SHA1FuncBody = getMyContent('https://raw.githack.com/Caligatio/jsSHA/master/src/sha1.js', 'TEXT', false);
SHA1FuncBody = getMyContent('https://raw.githack.com/Caligatio/jsSHA/master/dist/sha1.js', 'TEXT', false);
localStorage.setItem(SHA1Key, SHA1FuncBody);
}
var SHA1Func = new Function('a', SHA1FuncBody);
var SHA1 = new SHA1Func();
if (SHA1.jsSHA) {
var shaObj = new SHA1.jsSHA("SHA-1", "TEXT");
var vkTimestamp = parseInt(Date.now() / 1000);
var vkQuery = "/v5/videos/" + vkVideoID + "/streams.json?app=100005a&t=" + vkTimestamp + "&site=www.viki.com"
var vkToken = "MM_d*yP@`&1@]@!AVrXf_o-HVEnoTnm$O-ti4[G~$JDI/Dc-&piU&z&5.;:}95\=Iad";
shaObj.setHMACKey(vkToken, "TEXT");
shaObj.update(vkQuery);
var vkSig = shaObj.getHMAC("HEX");
var vkSource = "https://api.viki.io" + vkQuery + "&sig=" + vkSig;
vkVideosContent = getMyContent(vkSource, 'TEXT', false);
}
var shaObj = (SHA1.jsSHA) ? new SHA1.jsSHA("SHA-1", "TEXT") : new jsSHA("SHA-1", "TEXT");
var vkTimestamp = parseInt(Date.now() / 1000);
var vkQuery = "/v5/videos/" + vkVideoID + "/streams.json?app=100005a&t=" + vkTimestamp + "&site=www.viki.com"
var vkToken = "MM_d*yP@`&1@]@!AVrXf_o-HVEnoTnm$O-ti4[G~$JDI/Dc-&piU&z&5.;:}95\=Iad";
shaObj.setHMACKey(vkToken, "TEXT");
shaObj.update(vkQuery);
var vkSig = shaObj.getHMAC("HEX");
var vkSource = "https://api.viki.io" + vkQuery + "&sig=" + vkSig;
vkVideosContent = getMyContent(vkSource, 'TEXT', false);
}
/* Get Videos */
......
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