commit e3d9d8eb7f92471e88ff264e89549089baa3e959 Author: Henrik Berglund Date: Fri Mar 25 15:17:04 2022 +0100 First commit diff --git a/listStory.py b/listStory.py new file mode 100644 index 0000000..0c9ab12 --- /dev/null +++ b/listStory.py @@ -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']) +