Merge pull request #416 from Gluejar/liberalize_linking

I think the answer to my question of whether this should be merged is yes.
pull/1/head
Raymond Yee 2014-11-18 14:45:04 -08:00
commit 9e4c6b9a77
1 changed files with 2 additions and 2 deletions

View File

@ -1822,9 +1822,9 @@ class Ebook(models.Model):
if not url:
return None
# provider derived from url. returns provider value. remember to call save() afterward
if url.startswith('https?://books.google.com/'):
if re.match('https?://books.google.com/', url):
provider='Google Books'
elif url.startswith('http://www.gutenberg.org/'):
elif re.match('https?://www.gutenberg.org/', url):
provider='Project Gutenberg'
elif re.match('https?://(www\.|)archive.org/', url):
provider='Internet Archive'