1
0
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:
Ilya Kreymer 2014-03-08 15:53:52 -08:00
parent 4fdcdc98ae
commit 68878fa72a
2 changed files with 15 additions and 2 deletions

View File

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

View File

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