mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +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:
|
if not matched_rule:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
inx = url.find('?')
|
repl = '?'
|
||||||
|
if matched_rule.replace:
|
||||||
|
repl = matched_rule.replace
|
||||||
|
|
||||||
|
inx = url.rfind(repl)
|
||||||
if inx > 0:
|
if inx > 0:
|
||||||
url = url[:inx + 1]
|
url = url[:inx + 1]
|
||||||
|
|
||||||
@ -104,6 +108,8 @@ class FuzzyQuery:
|
|||||||
'filter': filter_,
|
'filter': filter_,
|
||||||
'output': output}
|
'output': output}
|
||||||
|
|
||||||
|
print params
|
||||||
|
|
||||||
return CDXQuery(**params)
|
return CDXQuery(**params)
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,13 +27,20 @@ rules:
|
|||||||
replace: '/* {0} */'
|
replace: '/* {0} */'
|
||||||
|
|
||||||
|
|
||||||
# yahoo rules
|
# flickr rules
|
||||||
#=================================================================
|
#=================================================================
|
||||||
- url_prefix: ['com,yimg,l)/g/combo', 'com,yahooapis,yui)/combo']
|
- url_prefix: ['com,yimg,l)/g/combo', 'com,yahooapis,yui)/combo']
|
||||||
|
|
||||||
fuzzy_lookup: '([^/]+(?:\.css|\.js))'
|
fuzzy_lookup: '([^/]+(?:\.css|\.js))'
|
||||||
|
|
||||||
|
|
||||||
|
- url_prefix: 'com,staticflickr,'
|
||||||
|
|
||||||
|
fuzzy_lookup:
|
||||||
|
match: '([0-9]+_[a-z0-9]+).*?.jpg'
|
||||||
|
replace: '/'
|
||||||
|
|
||||||
|
|
||||||
# testing rules -- not for valid domain
|
# testing rules -- not for valid domain
|
||||||
#=================================================================
|
#=================================================================
|
||||||
# this rule block is a non-existent prefix merely for testing
|
# this rule block is a non-existent prefix merely for testing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user