Spaces:
Runtime error
Runtime error
Update get_paper.py
Browse files- get_paper.py +10 -9
get_paper.py
CHANGED
@@ -2,14 +2,15 @@ import arxiv
|
|
2 |
|
3 |
|
4 |
def get_paper(paper=""):
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
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)
|