Skip to content

Commit

Permalink
Webhook Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
UltimaHoarder committed Dec 22, 2020
1 parent 7539090 commit 621b4fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datascraper/main_datascraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
api_helper = OnlyFans.api_helper


def start_datascraper(json_config, site_name_lower, apis: list = []):
def start_datascraper(json_config, site_name_lower, apis: list = [],webhooks=True):
json_settings = json_config["settings"]
json_sites = json_config["supported"]
domain = json_settings["auto_site_choice"]
Expand Down Expand Up @@ -85,6 +85,8 @@ def start_datascraper(json_config, site_name_lower, apis: list = []):
x = main_helper.process_names(
module, subscription_list, auto_scrape_names, apis, json_config, site_name_lower, site_name)
x = main_helper.process_downloads(apis, module)
if webhooks:
x = main_helper.process_webhooks(apis)
elif site_name_lower == "starsavn":
site_name = "StarsAVN"
original_api = StarsAVN
Expand Down
7 changes: 7 additions & 0 deletions helpers/main_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,13 @@ def process_downloads(apis, module):
module.download_media(api, subscription)
delete_empty_directories(
download_info["base_directory"])

def process_webhooks(apis):
for api in apis:
subscriptions = api.get_subscriptions(refresh=False)
for subscription in subscriptions:
download_info = subscription.download_info
if download_info:
if download_info["webhook"]:
send_webhook(subscription)

Expand Down

0 comments on commit 621b4fe

Please sign in to comment.