From d2654b03d4060c23057a0f1ee1d29d9e21d7ee34 Mon Sep 17 00:00:00 2001 From: CRIMINAL Date: Sun, 8 Nov 2020 11:02:09 +0000 Subject: [PATCH] Formatting --- apis/onlyfans/onlyfans.py | 18 +++++++++--------- datascraper/main_datascraper.py | 1 + modules/onlyfans.py | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/apis/onlyfans/onlyfans.py b/apis/onlyfans/onlyfans.py index 59bac0e63..612ddc882 100644 --- a/apis/onlyfans/onlyfans.py +++ b/apis/onlyfans/onlyfans.py @@ -236,8 +236,8 @@ def login(self, full=False, max_attempts=10): {'name': 'auth_id', 'value': auth_id}, {'name': 'sess', 'value': auth_items.sess}, {'name': 'auth_hash', 'value': auth_items.auth_hash}, - {'name': 'auth_uniq_'+auth_id, 'value': auth_items.auth_uniq_}, - {'name': 'auth_uid_'+auth_id, 'value': None}, + {'name': f'auth_uniq_{auth_id}', 'value': auth_items.auth_uniq_}, + {'name': f'auth_uid_{auth_id}', 'value': None}, ] for session in self.sessions: a = [session, link, auth_items.sess, user_agent] @@ -552,7 +552,7 @@ def get_paid_content(self, check: bool = False, refresh: bool = True, limit: int if not authed: return if not refresh: - result = self.handle_refresh(self, api_type) + result = self.handle_refresh(authed, api_type) if result: return result link = links(global_limit=limit, @@ -577,12 +577,12 @@ def __init__(self, option={}) -> None: self.subscribedByData = subscribedByData( option.get("subscribedByData", {})) self.is_me = option.get("is_me", False) - self.postsCount = option.get("postsCount",0) - self.archivedPostsCount = option.get("archivedPostsCount",0) - self.photosCount = option.get("photosCount",0) - self.videosCount = option.get("videosCount",0) - self.audiosCount = option.get("audiosCount",0) - self.favoritesCount = option.get("favoritesCount",0) + self.postsCount = option.get("postsCount", 0) + self.archivedPostsCount = option.get("archivedPostsCount", 0) + self.photosCount = option.get("photosCount", 0) + self.videosCount = option.get("videosCount", 0) + self.audiosCount = option.get("audiosCount", 0) + self.favoritesCount = option.get("favoritesCount", 0) self.avatar = option.get("avatar") self.header = option.get("header") self.hasStories = option.get("hasStories") diff --git a/datascraper/main_datascraper.py b/datascraper/main_datascraper.py index c80cb43cc..f64281aad 100644 --- a/datascraper/main_datascraper.py +++ b/datascraper/main_datascraper.py @@ -112,6 +112,7 @@ def start_datascraper(): array = module.manage_subscriptions(api, auth_count) subscription_array += array if jobs["scrape_paid_content"]: + paid_contents = api.get_paid_content() paid_content = module.paid_content_scraper(api) apis.append(api) subscription_list = module.format_options( diff --git a/modules/onlyfans.py b/modules/onlyfans.py index f6781c0c5..23383b4ce 100644 --- a/modules/onlyfans.py +++ b/modules/onlyfans.py @@ -264,7 +264,7 @@ def profile_scraper(api, directory, username): def paid_content_scraper(api): - paid_contents = api.get_paid_content() + paid_contents = api.get_paid_content(refresh=False) results = [] for paid_content in paid_contents: author = paid_content.get("author")