From e433c13108271ad14f6fca79dd623370e9578a2d Mon Sep 17 00:00:00 2001 From: eric Date: Fri, 13 Apr 2018 14:38:39 -0400 Subject: [PATCH] fix online_to_download bugs --- core/loaders/doab_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/loaders/doab_utils.py b/core/loaders/doab_utils.py index c1a0aec3..7076c8ef 100644 --- a/core/loaders/doab_utils.py +++ b/core/loaders/doab_utils.py @@ -116,7 +116,7 @@ FRONTIERSIN = re.compile(r'frontiersin.org/books/[^/]+/(\d+)') def online_to_download(url): urls = [] - if url.find(u'mdpi.com/books/pdfview') >= 0: + if url.find(u'mdpi.com/books/pdfview/book/') >= 0: doc = get_soup(url) if doc: obj = doc.find('object', type='application/pdf') @@ -133,8 +133,8 @@ def online_to_download(url): urls.append(urlparse.urljoin(url, obj['href'])) elif FRONTIERSIN.search(url): booknum = FRONTIERSIN.search(url).group(1) - urls.append(u'https://www.frontiersin.org/GetFile.aspx?ebook={1001}&fileformat=EPUB'.format(booknum)) - urls.append(u'https://www.frontiersin.org/GetFile.aspx?ebook={1001}&fileformat=PDF'.format(booknum)) + urls.append(u'https://www.frontiersin.org/GetFile.aspx?ebook={}&fileformat=EPUB'.format(booknum)) + urls.append(u'https://www.frontiersin.org/GetFile.aspx?ebook={}&fileformat=PDF'.format(booknum)) else: urls.append(url) return urls