First commit
This commit is contained in:
35
listStory.py
Normal file
35
listStory.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import requests
|
||||
import time
|
||||
import json
|
||||
|
||||
authors = []
|
||||
|
||||
i = True
|
||||
|
||||
def getauthors():
|
||||
start = 3965
|
||||
while i:
|
||||
tmpauthors = []
|
||||
print(start)
|
||||
r = requests.get(f'https://www.storytel.se/api/getSmartList.action?orderBy=LETTER&filterKeys=AUTHOR&filterValues=*&listTitle=*&start={start}&hits=50')
|
||||
j = json.loads(r.content)
|
||||
for a in j['books']:
|
||||
for b in a['book']['authors']:
|
||||
if b['name'] not in authors:
|
||||
print(b['name'])
|
||||
authors.append(b['name'])
|
||||
tmpauthors.append(b['name'])
|
||||
r.close()
|
||||
start = start + len(tmpauthors)
|
||||
if len(tmpauthors) == 0:
|
||||
break
|
||||
if len(tmpauthors) <= 15:
|
||||
time.sleep(312)
|
||||
else:
|
||||
time.sleep(32)
|
||||
|
||||
|
||||
for a in r['books']:
|
||||
for b in a['book']['authors']:
|
||||
print(b['name'])
|
||||
|
||||
Reference in New Issue
Block a user