Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
taux1c
GitHub Repository: taux1c/onlyfans-scraper
Path: blob/main/onlyfans_scraper/api/lists.py
961 views
1
2
from onlyfans_scraper.constants import lists_EP
3
import pandas
4
import requests
5
from onlyfans_scraper.utils import auth
6
import asyncio
7
hasMore_name = ""
8
list_name = ""
9
offset = 0
10
hasMore = True
11
all_lists = []
12
async def get_list(**kwargs):
13
with requests.session() as s:
14
while hasMore:
15
url = lists_EP.format(offset)
16
headers = auth.make_headers(auth.read_auth())
17
headers = auth.create_sign(url,headers)
18
s.headers.update(headers)
19
with s.get(url) as r:
20
jdata = r.json()
21
print(jdata)
22
# for item in jdata:
23
# if type(r.json()[item]) == bool:
24
# hasMore_name = item
25
# hasMore = r.json()[item]
26
# elif type(r.json()[item]) == list:
27
# list_name = item
28
# else:
29
# print("New items detected. Item {} of type {}".format(item, type(r.json()[item])))
30
# if list_name in r.json():
31
# print(r.json()[list_name])
32
# offset += 10
33