zliang commited on
Commit
f941793
1 Parent(s): 695cdfe

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -14,8 +14,8 @@ async def title2doi(title:str):
14
 
15
  result = cr.works(query = title)
16
  for i, item in enumerate(result['message']['items']):
17
- if 'group-title' in item and item['group-title'] != 'Preprints':
18
- doi = result['message']['items'][i-1]['DOI']
19
  break
20
 
21
  url = BASE_URL + doi
 
14
 
15
  result = cr.works(query = title)
16
  for i, item in enumerate(result['message']['items']):
17
+ if item['title'][0] == title:
18
+ doi = result['message']['items'][i]['DOI']
19
  break
20
 
21
  url = BASE_URL + doi