Archan commited on
Commit
0c2d204
1 Parent(s): f2ce8a3

Update get_paper.py

Browse files
Files changed (1) hide show
  1. get_paper.py +10 -9
get_paper.py CHANGED
@@ -2,14 +2,15 @@ import arxiv
2
 
3
 
4
  def get_paper(paper=""):
5
- id = paper.split(" - ")
6
- print("id= ", id)
7
-
8
- paper = next(arxiv.Search(id_list=[id[-1]]).results())
9
- print("paper title= ", paper.title)
10
- name = str(paper.title) + '.pdf'
11
- name = name.replace('?', '')
12
- name = "downloads/" + name
13
- paper.download_pdf(filename=name)
 
14
 
15
  return(paper)
 
2
 
3
 
4
  def get_paper(paper=""):
5
+ if paper:
6
+ id = paper.split(" - ")
7
+ print("id= ", id)
8
+
9
+ paper = next(arxiv.Search(id_list=[id[-1]]).results())
10
+ print("paper title= ", paper.title)
11
+ name = str(paper.title) + '.pdf'
12
+ name = name.replace('?', '')
13
+ name = "downloads/" + name
14
+ paper.download_pdf(filename=name)
15
 
16
  return(paper)