fix jstor pdf urls

This commit is contained in:
Bryan Bishop 2013-02-21 17:13:22 -06:00
parent 14bdf23876
commit 16c7f4d4db
1 changed files with 10 additions and 0 deletions

View File

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