Skip to content

Commit

Permalink
added try block
Browse files Browse the repository at this point in the history
  • Loading branch information
eddotman committed Dec 23, 2015
1 parent 8a04b63 commit 8640218
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions articledownloader/articledownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,13 @@ def get_dois_from_search(self, query, rows=500):

while not stop_ping:
response = requests.get(search_url, headers=self.headers)
if response.status_code == 200:
j_response = response.json()
cursor = response['message']['next-cursor']
stop_ping = True
try:
if response.status_code == 200:
j_response = response.json()
cursor = response['message']['next-cursor']
stop_ping = True
except:
self.__logger.warning(response)

if len(response["message"]["items"]) < max_rows or len(dois) >= rows:
stop_query = True
Expand Down
Binary file added dist/articledownloader-3.2.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
setup(
name = 'articledownloader',
packages = ['articledownloader'], # this must be the same as the name above
version = '3.1',
version = '3.2',
description = 'A class for downloading scientific journal articles',
author = 'Edward Kim',
author_email = 'eddotman@gmail.com',
url = 'https://github.com/eddotman/article-downloader', # use the URL to the github repo
download_url = 'https://www.github.com/eddotman/article-downloader/tarball/3.1',
download_url = 'https://www.github.com/eddotman/article-downloader/tarball/3.2',
keywords = ['journal', 'paper', 'article', 'downloader'], # arbitrary keywords
)

0 comments on commit 8640218

Please sign in to comment.