mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 08:04:49 +01:00
various fixes: wombat: add Date.UTC and Date.parse
rewrite: support vi_ https -> metadata video: fallback to vi_ call on current page remove debug logging
This commit is contained in:
parent
4b7186a62e
commit
3e3a74619f
@ -126,7 +126,6 @@ class FuzzyQuery:
|
||||
if 'end_key' in params:
|
||||
del params['end_key']
|
||||
|
||||
print(params)
|
||||
return params
|
||||
|
||||
|
||||
|
@ -63,6 +63,9 @@ class LiveRewriter(object):
|
||||
if cookie_val:
|
||||
value = cookie_val
|
||||
|
||||
elif name == 'HTTP_REFERER':
|
||||
continue
|
||||
|
||||
elif name.startswith('HTTP_'):
|
||||
name = name[5:].title().replace('_', '-')
|
||||
|
||||
|
@ -100,7 +100,6 @@ __wbvidrw = (function() {
|
||||
// Wait to see if video is playing, if so, don't replace it
|
||||
window.setTimeout(function() {
|
||||
if (ytvideo[0].readyState == 0) {
|
||||
console.log("Replacing Broken Video");
|
||||
check_replacement(ytvideo[0], wbinfo.url);
|
||||
}
|
||||
}, 4000);
|
||||
@ -117,7 +116,7 @@ __wbvidrw = (function() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function check_replacement(elem, src) {
|
||||
function check_replacement(elem, src, no_retry) {
|
||||
if (!src || src.indexOf("javascript:") == 0) {
|
||||
return;
|
||||
}
|
||||
@ -134,6 +133,9 @@ __wbvidrw = (function() {
|
||||
xhr.onload = function() {
|
||||
if (xhr.status == 200) {
|
||||
do_replace_video(elem, JSON.parse(xhr.responseText));
|
||||
} else if (!no_retry) {
|
||||
check_replacement(elem, wbinfo.url, true);
|
||||
console.log("REPL RETRY: " + wbinfo.url);
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
|
@ -536,6 +536,8 @@ _WBWombat = (function() {
|
||||
|
||||
window.__Date = window.Date;
|
||||
window.__Date_now = window.Date.now;
|
||||
var utc = window.Date.UTC;
|
||||
var parse = window.Date.parse;
|
||||
|
||||
window.Date = function (Date) {
|
||||
return function (A, B, C, D, E, F, G) {
|
||||
@ -565,6 +567,9 @@ _WBWombat = (function() {
|
||||
window.Date.now = function() {
|
||||
return __Date_now() - timediff;
|
||||
}
|
||||
|
||||
window.Date.UTC = utc;
|
||||
window.Date.parse = parse;
|
||||
}
|
||||
|
||||
//============================================
|
||||
|
@ -74,6 +74,7 @@ class QueryHandler(object):
|
||||
if wb_url.mod == 'vi_':
|
||||
# matching metadata explicitly with special scheme
|
||||
params['url'] = wb_url.url.replace('http:/', 'metadata:/')
|
||||
params['url'] = wb_url.url.replace('https:/', 'metadata:/')
|
||||
params['filter'].append('~original:metadata://')
|
||||
|
||||
cdx_iter = self.load_cdx(wbrequest, params)
|
||||
|
Loading…
x
Reference in New Issue
Block a user