mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
update domain-specific rules to make flickr replay work better!
This commit is contained in:
parent
4fdcdc98ae
commit
68878fa72a
@ -95,7 +95,11 @@ class FuzzyQuery:
|
||||
if not matched_rule:
|
||||
return None
|
||||
|
||||
inx = url.find('?')
|
||||
repl = '?'
|
||||
if matched_rule.replace:
|
||||
repl = matched_rule.replace
|
||||
|
||||
inx = url.rfind(repl)
|
||||
if inx > 0:
|
||||
url = url[:inx + 1]
|
||||
|
||||
@ -104,6 +108,8 @@ class FuzzyQuery:
|
||||
'filter': filter_,
|
||||
'output': output}
|
||||
|
||||
print params
|
||||
|
||||
return CDXQuery(**params)
|
||||
|
||||
|
||||
|
@ -27,13 +27,20 @@ rules:
|
||||
replace: '/* {0} */'
|
||||
|
||||
|
||||
# yahoo rules
|
||||
# flickr rules
|
||||
#=================================================================
|
||||
- url_prefix: ['com,yimg,l)/g/combo', 'com,yahooapis,yui)/combo']
|
||||
|
||||
fuzzy_lookup: '([^/]+(?:\.css|\.js))'
|
||||
|
||||
|
||||
- url_prefix: 'com,staticflickr,'
|
||||
|
||||
fuzzy_lookup:
|
||||
match: '([0-9]+_[a-z0-9]+).*?.jpg'
|
||||
replace: '/'
|
||||
|
||||
|
||||
# testing rules -- not for valid domain
|
||||
#=================================================================
|
||||
# this rule block is a non-existent prefix merely for testing
|
||||
|
Loading…
x
Reference in New Issue
Block a user