Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
minor additions for 0.4
Browse files Browse the repository at this point in the history
- literally just added couple descriptive comments
  • Loading branch information
Avnsx authored Jun 11, 2023
1 parent 2dfbbec commit e9fc415
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions fansly_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def open_url(url_to_open: str):
config['Options']['separate_messages'] = config['Options'].pop('seperate_messages')
if 'seperate_previews' in config['Options']:
config['Options']['separate_previews'] = config['Options'].pop('seperate_previews')
with open('config.ini', 'w', encoding='utf-8') as f:config.write(f)
with open('config.ini', 'w', encoding='utf-8') as f:
config.write(f)

# config.ini backwards compatibility fix (≤ v0.4) -> config option "naming_convention" & "update_recent_download" removed entirely
options_to_remove = ['naming_convention', 'update_recent_download']
Expand Down Expand Up @@ -474,7 +475,9 @@ def generate_base_dir(creator_name_to_create_for: str, module_requested_by: str)
s(10) # give user time to realise instructions were given
download_directory = ask_correct_dir() # ask user to select correct path using tkinters explorer dialog
config.set('Options', 'download_directory', download_directory) # set corrected path inside the config
with open('config.ini', 'w', encoding='utf-8') as f:config.write(f) # save the config permanently into config.ini
# save the config permanently into config.ini
with open('config.ini', 'w', encoding='utf-8') as f:
config.write(f)
if "Collection" in module_requested_by:
BASE_DIR_NAME = join(download_directory, 'Collections')
elif "Message" in module_requested_by and separate_messages:
Expand Down Expand Up @@ -517,11 +520,11 @@ def open_location(filepath: str):

# tested below and they work to open folder locations
if plat == 'Windows':
os.startfile(filepath)
os.startfile(filepath) # verified works
elif plat == 'Linux':
subprocess.run(['xdg-open', filepath], shell=False)
subprocess.run(['xdg-open', filepath], shell=False) # verified works
elif plat == 'Darwin':
subprocess.run(['open', filepath], shell=False)
subprocess.run(['open', filepath], shell=False) # verified works

return True

Expand Down

0 comments on commit e9fc415

Please sign in to comment.