{% trans %}Access Blocked to {{ err_msg }}{% endtrans %}
12 | 13 | {% elif err_status == 404 and err_details == 'coll_not_found' %} 14 |{% trans %}Collection not found: {{ err_msg }}{% endtrans %}
15 | 16 |{{ _('See list of valid collections') }}
17 | 18 | {% elif err_status == 404 and err_details == 'static_file_not_found' %} 19 |{% trans %}Static file not found: {{ err_msg }}{% endtrans %}
20 | 21 | {% else %} 22 | 23 |{{ err_msg }}
24 | 25 | {% if err_details %} 26 |{% trans %}Error Details:{% endtrans %}
27 |{{ err_details }}28 | {% endif %} 29 | {% endif %} 30 |
{{ _('This archive contains the following collections:') }}
7 |11 | {% trans %}The url {{ url }} could not be found in this collection.{% endtrans %} 12 |
13 | {% if wbrequest and wbrequest.env.pywb_proxy_magic and url %} 14 | 19 | {% endif %} 20 |Sorry, HTTPS support is not configured for this proxy. However, the proxy should work in HTTP mode.
10 | 11 | {% else %} 12 |Download for all platforms except Windows (or Firefox on Windows):
13 |Download Certificate (All except Windows)
14 | 15 |(If you see the Already Installed message, then no further action is necessary and you may start browsing!
16 | 17 |Download for Windows platforms (except if using Firefox. For Firefox, use the above download, even on Windows):
18 |Download Certificate (Window Only)
19 | {% endif %} 20 | {% endblock %} 21 | -------------------------------------------------------------------------------- /pywb/templates/proxy_select.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block title %}Pywb Proxy Collection Selector{% endblock %} 4 | 5 | {% block body %} 6 |9 | Current collection is: {{ coll }} 10 |
11 | {% else %} 12 |You have attempted to load the url {{ url }}, but there are multiple collections available.
13 | {% endif %} 14 | 15 |Please select which collection you would like to use (You will be redirected back to {{ url }}): 16 |
17 | 18 |(Once selected, you will not be prompted again, however you can return to this page to switch collections.)
27 | {% endblock %} 28 | -------------------------------------------------------------------------------- /pywb/utils/README.md: -------------------------------------------------------------------------------- 1 | ### pywb.utils 2 | 3 | This package contains a utils used by pywb wayback tool suite. 4 | 5 | #### Modules 6 | 7 | * [binsearch.py](binsearch.py) -- Binary search implementation over text files 8 | 9 | * [loaders.py](loaders.py) -- Loading abstraction for loading via http or local file system. 10 | 11 | * [bufferedreaders.py](bufferedreaders.py) -- Buffering wrappers for file-like object, also provide gzip decompression and 12 | de-chunking facilities. 13 | 14 | * [statusandheaders.py](statusandheaders.py) -- Represent http status line + headers and parsing them out from a stream 15 | 16 | * [timeutils.py](timeutils.py) -- Utility functions for converting between standard datetime formats 14-digit timestamp 17 | 18 | -------------------------------------------------------------------------------- /pywb/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrecorder/pywb/8ea2f74517161c1fc91ca969cea6328a20f5dce6/pywb/utils/__init__.py -------------------------------------------------------------------------------- /pywb/utils/format.py: -------------------------------------------------------------------------------- 1 | from six.moves.urllib.parse import quote, parse_qsl 2 | import string 3 | 4 | 5 | # ============================================================================ 6 | class ParamFormatter(string.Formatter): 7 | def __init__(self, params, name='', prefix='param.'): 8 | self.params = params 9 | self.prefix = prefix 10 | self.name = name 11 | 12 | def get_value(self, key, args, kwargs): 13 | # First, try the named param 'param.{name}.{key}' 14 | if self.name: 15 | named_key = self.prefix + self.name + '.' + key 16 | value = self.params.get(named_key) 17 | if value is not None: 18 | return value 19 | 20 | # Then, try 'param.{key}' 21 | named_key = self.prefix + key 22 | value = self.params.get(named_key) 23 | if value is not None: 24 | return value 25 | 26 | # try in extra params as just {key} 27 | value = kwargs.get(key) 28 | if value is not None: 29 | return value 30 | 31 | # try in params as just '{key}' 32 | value = self.params.get(key, '') 33 | return value 34 | 35 | 36 | # ============================================================================= 37 | def res_template(template, params, **extra_params): 38 | formatter = params.get('_formatter') 39 | if not formatter: 40 | formatter = ParamFormatter(params) 41 | 42 | url = params.get('url', '') 43 | qi = template.find('?') 44 | if qi >= 0 and template.find('{url}') > qi: 45 | url = quote(url) 46 | 47 | res = formatter.format(template, url=url, **extra_params) 48 | 49 | return res 50 | 51 | 52 | # ============================================================================= 53 | def to_bool(val): 54 | if not val: 55 | return False 56 | 57 | if isinstance(val, str): 58 | return val.lower() not in ('0', 'false', 'f', 'off') 59 | else: 60 | return bool(val) 61 | 62 | 63 | # ============================================================================= 64 | def query_to_dict(query_str, multi=None): 65 | pairlist = parse_qsl(query_str) 66 | if not multi: 67 | return dict(pairlist) 68 | 69 | obj = {} 70 | for n, v in pairlist: 71 | if n not in multi: 72 | obj[n] = v 73 | continue 74 | 75 | # make_list 76 | if n not in obj: 77 | obj[n] = v 78 | elif isinstance(obj[n], list): 79 | obj[n].append(v) 80 | else: 81 | obj[n] = [obj[n], v] 82 | 83 | return obj 84 | 85 | 86 | -------------------------------------------------------------------------------- /pywb/version.py: -------------------------------------------------------------------------------- 1 | __version__ = '2.9.0b1' 2 | 3 | if __name__ == '__main__': 4 | print(__version__) 5 | -------------------------------------------------------------------------------- /pywb/vueui/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "env": { 3 | "browser": true, 4 | "es2021": true 5 | }, 6 | "extends": [ 7 | "eslint:recommended", 8 | "plugin:vue/essential" 9 | ], 10 | "parserOptions": { 11 | "ecmaVersion": 12, 12 | "sourceType": "module" 13 | }, 14 | "plugins": [ 15 | "vue" 16 | ], 17 | "rules": { 18 | "no-restricted-globals": [ 19 | 2, 20 | "event", "error" 21 | ], 22 | "indent": [ 23 | "error", 24 | 2 25 | ], 26 | "linebreak-style": [ 27 | "error", 28 | "unix" 29 | ], 30 | "quotes": [ 31 | "error", 32 | "double" 33 | ], 34 | "semi": [ 35 | "error", 36 | "always" 37 | ] 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /pywb/vueui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "build": "rollup -c", 7 | "lint": "eslint ./src/*.js ./src/*.vue ./src/components/*.vue" 8 | }, 9 | "dependencies": { 10 | "vue": "^2.6.11", 11 | "vue-template-compiler": "^2.6.14" 12 | }, 13 | "devDependencies": { 14 | "@rollup/plugin-node-resolve": "^13.0.4", 15 | "eslint": "^7.32.0", 16 | "eslint-plugin-vue": "^7.17.0", 17 | "rollup": "^2.10.9", 18 | "rollup-plugin-css-only": "^3.1.0", 19 | "rollup-plugin-vue": "^5.0.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /pywb/vueui/rollup.config.js: -------------------------------------------------------------------------------- 1 | import vue from "rollup-plugin-vue"; 2 | import css from "rollup-plugin-css-only"; 3 | import { nodeResolve } from "@rollup/plugin-node-resolve"; 4 | 5 | export default [ 6 | { 7 | input: "src/index.js", 8 | output: { 9 | file: "../static/vue/vueui.js", 10 | sourcemap: "inline", 11 | name: "VueUI", 12 | format: "iife", 13 | }, 14 | plugins: [ 15 | vue({css: true, compileTemplate: true}), 16 | css(), 17 | nodeResolve({browser: true}) 18 | ], 19 | }, 20 | ]; 21 | -------------------------------------------------------------------------------- /pywb/vueui/src/cdx-simulator/README.md: -------------------------------------------------------------------------------- 1 | # How to incorporate CDX Simulator 2 | 3 | Place following code snippets in **index.js** 4 | 5 | ## Import `CDXQueryWorkerSimulator` Mock Class 6 | 7 | It is the mock class to the main javascript built-in `Worker` class: 8 | 9 | ``import { CDXQueryWorkerSimulator } from "./cdx-simulator/cdx-simulator";`` 10 | 11 | ## Initialize `queryWorker` with Mock Class 12 | 13 | Update `const queryWorker = ...` initialization in `CDXLoader` class, `loadCDX()` method 14 | 15 | ### by replacing it 16 | 17 | ``` 18 | const queryWorker = new CDXQueryWorkerSimulator(this.staticPrefix + "/queryWorker.js"); 19 | ``` 20 | 21 | ### or by adding a conditional, so you can go back and forth between simulator and real CDX-data-loader: 22 | 23 | for example with a URL-hash flag conditional: 24 | 25 | ``` 26 | const queryWorker = new (window.location.hash.indexOf('cdx_simulate') >= 0 ? CDXQueryWorkerSimulator : Worker)(this.staticPrefix + "/queryWorker.js"); 27 | ``` 28 | 29 | NOTE: where if the url contains '#cdx_simulate' the mock simulator will be used; using a URL hash does not interfere with the main URL parsing of the PYWB app 30 | 31 | ## Configure Simulation 32 | 33 | Add a **local** storage (from Chrome Dev Tools > Application > Local Storage) 34 | 35 | ``` 36 | {"count":5000, "yearStart":2020, "yearEnd":2022, "fetchTime":3000} 37 | ``` 38 | 39 | where `count` is the total records, yearStart and yearEnd are self-explanatory, and `fetchTime` is how long it should take 40 | 41 |  -------------------------------------------------------------------------------- /pywb/vueui/src/cdx-simulator/pywb-vueui-cdx-simulator-config.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webrecorder/pywb/8ea2f74517161c1fc91ca969cea6328a20f5dce6/pywb/vueui/src/cdx-simulator/pywb-vueui-cdx-simulator-config.jpg -------------------------------------------------------------------------------- /pywb/vueui/src/cdx-simulator/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |