We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39b7cfc commit dad3a67Copy full SHA for dad3a67
1 file changed
cit-ex/obp-loader.py
@@ -39,10 +39,14 @@ def main():
39
chapters = get_chapters(query)
40
41
# add bibliography section (if any) to chapter list
42
- bib_url = urljoin(chapters[0].get("html_page"), "bibliography.xhtml")
43
- r = requests.get(bib_url)
44
- if r.status_code == 200:
45
- chapters.append({"doi": args.doi, "html_page": bib_url})
+ try:
+ bib_url = urljoin(chapters[0].get("html_page"), "bibliography.xhtml")
+ except IndexError:
+ pass
46
+ else:
47
+ r = requests.get(bib_url)
48
+ if r.status_code == 200:
49
+ chapters.append({"doi": args.doi, "html_page": bib_url})
50
51
# create an epub for each chapter and run it through cit-ex
52
for chapter in chapters:
0 commit comments