Skip to content

Commit

Permalink
Multiple inputs for choices
Browse files Browse the repository at this point in the history
Related to:
Choosing profiles
Choosing subscriptions

You can input multiple numbers or names. They must be seperated by commas.
  • Loading branch information
UltimaHoarder committed Dec 17, 2020
1 parent c88aed8 commit c9b2c3b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
9 changes: 7 additions & 2 deletions classes/make_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ def fix(config={}):
class config(object):
def __init__(self, settings={}, supported={}):
class Settings(object):
def __init__(self, auto_profile_choice="", auto_site_choice="", profile_directories=[".profiles"], export_type="json", max_threads=-1, min_drive_space=0, webhooks=[], exit_on_completion=False, infinite_loop=True, loop_timeout="0", proxies=[], cert="", random_string=""):
self.auto_profile_choice = auto_profile_choice
def __init__(self, auto_site_choice="", profile_directories=[".profiles"], export_type="json", max_threads=-1, min_drive_space=0, webhooks=[], exit_on_completion=False, infinite_loop=True, loop_timeout="0", proxies=[], cert="", random_string=""):
self.auto_site_choice = auto_site_choice
self.export_type = export_type
self.profile_directories = profile_directories
Expand Down Expand Up @@ -156,6 +155,8 @@ def __init__(self, option={}) -> None:
'scrape_names', True)
self.scrape_paid_content = option.get(
'scrape_paid_content', True)
self.auto_profile_choice = option.get(
'auto_profile_choice', "")
self.auto_choice = option.get('auto_choice', "")
self.auto_scrape_names = option.get(
'auto_scrape_names', False)
Expand Down Expand Up @@ -210,6 +211,8 @@ def __init__(self, option={}) -> None:
'scrape_names', True)
self.scrape_paid_content = option.get(
'scrape_paid_content', True)
self.auto_profile_choice = option.get(
'auto_profile_choice', "")
self.auto_choice = option.get('auto_choice', "")
self.auto_scrape_names = option.get(
'auto_scrape_names', False)
Expand Down Expand Up @@ -259,6 +262,8 @@ def __init__(self, option={}):

class Settings:
def __init__(self, option={}):
self.auto_profile_choice = option.get(
'auto_profile_choice', "")
self.auto_choice = option.get('auto_choice', "")
self.auto_scrape_names = option.get(
'auto_scrape_names', False)
Expand Down
2 changes: 1 addition & 1 deletion datascraper/main_datascraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def start_datascraper():
json_settings = json_config["settings"]
json_sites = json_config["supported"]
infinite_loop = json_settings["infinite_loop"]
auto_profile_choice = json_settings["auto_profile_choice"]
domain = json_settings["auto_site_choice"]
path = os.path.join('.settings', 'extra_auth.json')
# extra_auth_config, extra_auth_config2 = main_helper.get_config(path)
Expand Down Expand Up @@ -84,6 +83,7 @@ def start_datascraper():
if site_name_lower == "onlyfans":
site_name = "OnlyFans"
profile_directories = json_settings["profile_directories"]
auto_profile_choice = json_site_settings["auto_profile_choice"]
profile_directories2 = []
for profile_directory in profile_directories:
sessions = copy.deepcopy(original_sessions)
Expand Down
25 changes: 15 additions & 10 deletions helpers/main_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def clean_text(string, remove_spaces=False):
string = string.replace(' ', '_')
return string


def format_media_set(media_set):
merged = merge({}, *media_set, strategy=Strategy.ADDITIVE)
if "directories" in merged:
Expand Down Expand Up @@ -422,24 +423,28 @@ def choose_auth(array):

def choose_option(subscription_list, auto_scrape_names):
names = subscription_list[0]
new_names = []
if names:
seperator = " | "
print(f"Names: Username = username {seperator} {subscription_list[1]}")
if not auto_scrape_names:
value = "chloelove_"
value = "1"
value = input().strip()
values = "chloelove_"
values = "1"
values = input().strip().split(",")
else:
values = auto_scrape_names.split(",")
for value in values:
if value.isdigit():
if value == "0":
names = names[1:]
new_names = names[1:]
break
else:
names = [names[int(value)]]
new_name = names[int(value)]
new_names.append(new_name)
else:
names = [name for name in names if value in name[1]]
else:
value = 0
names = names[1:]
return names
new_name = [name for name in names if value == name[1]]
new_names.extend(new_name)
return new_names


def process_names(module, subscription_list, auto_scrape_names, session_array, json_config, site_name_lower, site_name):
Expand Down

0 comments on commit c9b2c3b

Please sign in to comment.