an even better IEEE fix

This commit is contained in:
Bryan Bishop 2013-02-08 04:45:43 -06:00
parent c48a377f44
commit d400040c10

View File

@ -168,8 +168,12 @@ def download_url(url):
if citation_pdf_url and "link.aip.org/" in citation_pdf_url: if citation_pdf_url and "link.aip.org/" in citation_pdf_url:
citation_pdf_url = None citation_pdf_url = None
if "ieeexplore.ieee.org" in citation_pdf_url:
content = requests.get(citation_pdf_url).content
tree = parse_html(content)
# wow, this seriously needs to be cleaned up # wow, this seriously needs to be cleaned up
if citation_pdf_url and citation_title: if citation_pdf_url and citation_title and not "ieeexplore.ieee.org" in citation_pdf_url:
citation_title = citation_title.encode("ascii", "ignore") citation_title = citation_title.encode("ascii", "ignore")
response = requests.get(citation_pdf_url, headers={"User-Agent": "pdf-defense-force"}) response = requests.get(citation_pdf_url, headers={"User-Agent": "pdf-defense-force"})
content = response.content content = response.content