Skip to content

Commit

Permalink
Fix duplicate posts for model's with more than 1500 posts....
Browse files Browse the repository at this point in the history
  • Loading branch information
UltimaHoarder committed Nov 30, 2020
1 parent f2e0868 commit acc8aa5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions apis/onlyfans/onlyfans.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@ def __init__(self, option={}) -> None:
# Modify self
valid_counts = ["postsCount", "archivedPostsCount"]
identifier = self.id
args = [identifier, False, False]
link_info = links(*args).full
link_info = links(identifier=identifier).full
x2 = [link_info["post_api"],
link_info["archived_posts"]]
items = dict(zip(valid_counts, x2))
Expand All @@ -313,8 +312,11 @@ def __init__(self, option={}) -> None:
a = list(range(ceil))
for b in a:
b = b * max_limit
getattr(placement, key_name).append(link.replace(
"offset=0", "offset=" + str(b)))
link = link.replace(
f"limit={value['max_limit']}", f"limit={max_limit}")
new_link = link.replace(
"offset=0", f"offset={b}")
getattr(placement, key_name).append(new_link)
print

def get_stories(self, refresh=True, limit=100, offset=0) -> list:
Expand Down Expand Up @@ -666,7 +668,7 @@ def multi(item, session=None):
self.auth.subscriptions = results
return results

def get_subscription(self, check:bool=False,identifier="", limit=100, offset=0) -> Union[create_subscription, None]:
def get_subscription(self, check: bool = False, identifier="", limit=100, offset=0) -> Union[create_subscription, None]:
subscriptions = self.get_subscriptions(refresh=False)
valid = None
for subscription in subscriptions:
Expand All @@ -678,13 +680,13 @@ def get_subscription(self, check:bool=False,identifier="", limit=100, offset=0)
global_offset=offset).users
session = self.sessions[0]
results = api_helper.json_request(link=link, session=session)
error = results.get("error",None)
error = results.get("error", None)
if error:
if error["message"] == "User not found":
pass
else:
string = "ERROR MESSAGE NOT HANDLED, PLEASE OPEN AN ISSUE ON GITHUB\n"
string+=f"{error['message']}"
string += f"{error['message']}"
input()
exit()
else:
Expand Down

0 comments on commit acc8aa5

Please sign in to comment.