1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

fuzzy match: look at first occurence, not last of match seperator

rules: add new rule for yt comments
This commit is contained in:
Ilya Kreymer 2015-05-21 23:52:09 +00:00
parent 35e2e535bb
commit 179f11198b
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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: