Skip to content

Commit

Permalink
API CHANGE
Browse files Browse the repository at this point in the history
Love how they changed the one thing that was needed to check if we were authed into an account.
  • Loading branch information
SecretShell committed Feb 12, 2020
1 parent 1495b57 commit 50f6db4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions modules/onlyfans.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,15 @@ def create_session(user_agent, app_token, sess="None"):
session.mount(
'https://', requests.adapters.HTTPAdapter(pool_connections=max_threads, pool_maxsize=max_threads))
session.headers = {
'User-Agent': user_agent, 'Referer': 'https://onlyfans.com/'}
'User-Agent': user_agent, 'Referer': 'https://onlyfans.com/', "accept": "application/json, text/plain, */*"}
auth_cookies = [
{'name': 'sess', 'value': sess}
]
for auth_cookie in auth_cookies:
session.cookies.set(**auth_cookie)
session.head("https://onlyfans.com")
r = session.get(
"https://onlyfans.com/api2/v2/users/me?app-token="+app_token)
"https://onlyfans.com/api2/v2/users/customer?app-token="+app_token)
count += 1
content_type = r.headers['Content-Type']
if r.status_code != 200 or "application/json" not in content_type:
Expand Down Expand Up @@ -410,7 +410,7 @@ def create_session(user_agent, app_token, sess="None"):
return [False, response]


def get_subscriptions(session, app_token, subscriber_count,auth_count=0):
def get_subscriptions(session, app_token, subscriber_count, auth_count=0):
link = "https://onlyfans.com/api2/v2/subscriptions/subscribes?limit=99&offset=0&app-token="+app_token
pool = ThreadPool()
ceil = math.ceil(subscriber_count / 99)
Expand Down Expand Up @@ -457,18 +457,17 @@ def multi(link, session):
def format_options(array):
string = ""
names = []
array = [{"auth_count":-1,"username": "All"}]+array
array = [{"auth_count": -1, "username": "All"}]+array
name_count = len(array)
if name_count > 1:

count = 0
for x in array:
name = x["username"]
string += str(count)+" = "+name
names.append([x["auth_count"],name])
names.append([x["auth_count"], name])
if count+1 != name_count:
string += " | "

count += 1
return [names, string]

0 comments on commit 50f6db4

Please sign in to comment.