From 16c7f4d4dbb59d831a65ddeb4f8acde5f4b72262 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Thu, 21 Feb 2013 17:13:22 -0600 Subject: [PATCH] fix jstor pdf urls --- modules/papers.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/papers.py b/modules/papers.py index 9447053..ba9eb59 100644 --- a/modules/papers.py +++ b/modules/papers.py @@ -48,6 +48,7 @@ def download(phenny, input, verbose=True): # fix for login.jsp links to ieee xplore line = fix_ieee_login_urls(line) + line = fix_jstor_pdf_urls(line) translation_url = "http://localhost:1969/web" @@ -378,3 +379,12 @@ def fix_ieee_login_urls(url): # default case when things go wrong return url +def fix_jstor_pdf_urls(url): + """ + Fixes urls pointing to jstor pdfs. + """ + if "jstor.org/" in url: + if ".pdf" in url and not "?acceptTC=true" in url: + url += "?acceptTC=true" + return url +