From 179f11198bfaa2c934a1d6b6140f4fec4f7a645d Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Thu, 21 May 2015 23:52:09 +0000 Subject: [PATCH] fuzzy match: look at first occurence, not last of match seperator rules: add new rule for yt comments --- pywb/cdx/cdxdomainspecific.py | 3 ++- pywb/rules.yaml | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pywb/cdx/cdxdomainspecific.py b/pywb/cdx/cdxdomainspecific.py index 73e32a25..cef3656a 100644 --- a/pywb/cdx/cdxdomainspecific.py +++ b/pywb/cdx/cdxdomainspecific.py @@ -97,7 +97,7 @@ class FuzzyQuery: if matched_rule.replace: repl = matched_rule.replace - inx = url.rfind(repl) + inx = url.find(repl) if inx > 0: url = url[:inx + len(repl)] @@ -120,6 +120,7 @@ class FuzzyQuery: if 'end_key' in params: del params['end_key'] + print(params) return params diff --git a/pywb/rules.yaml b/pywb/rules.yaml index 94a7e0fb..5fbcc22d 100644 --- a/pywb/rules.yaml +++ b/pywb/rules.yaml @@ -188,6 +188,13 @@ rules: args: - id + - url_prefix: 'com,youtube)/watch_fragments_ajax' + + fuzzy_lookup: + - v + - frags + #- client_url + - url_prefix: 'com,googlevideo,' fuzzy_lookup: