Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Commit

Permalink
Removed unused comment section clutter.
Browse files Browse the repository at this point in the history
Added option to save image comments, uses more resources on both ends so this is disabled by default.
  • Loading branch information
woodenphone committed Sep 12, 2014
1 parent 5544cc3 commit 44ec124
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ go_backwards_when_using_sequentially_download_everything = **Start at the most r
download_last_week = **Should the last 7000 submissions be downloaded (Approx 1 weeks worth)**
skip_glob_duplicate_check = **You should probably not use this unless you know what you are doing. (Speedhack for use with single output folder)**
move_on_fail_verification = **Should files that fail the verification be moved? If false they will only be copied.**
save_comments = **Should image comments be requested and saved, uses more resources on both client and server.**
````
19 changes: 11 additions & 8 deletions derpibooru_dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def set_defaults(self):
self.skip_known_deleted = True # Skip submissions of the list of known deleted IDs
self.deleted_submissions_list_path = os.path.join("config","deleted_submissions.txt")
self.move_on_fail_verification = False # Should files be moved if verification of a submission fails?
self.save_comments = False # Should comments be saved, uses more resources.

# Internal variables, these are set through this code only
self.resume_file_path = os.path.join("config","resume.pkl")
Expand Down Expand Up @@ -407,15 +408,15 @@ def load_file(self,settings_path):
self.move_on_fail_verification = config.getboolean('Settings', 'move_on_fail_verification')
except ConfigParser.NoOptionError:
pass
# /derpibooru_dl.py
# split_to_tag_folders.py
# /split_to_tag_folders.py
try:
self.save_comments = config.getboolean('Settings', 'save_comments')
except ConfigParser.NoOptionError:
pass
return

def save_settings(self,settings_path):
"""Save settings to a file"""
config = ConfigParser.RawConfigParser()
# derpibooru_dl.py
config.add_section('Login')
config.set('Login', 'api_key', self.api_key )
config.add_section('Settings')
Expand All @@ -436,9 +437,7 @@ def save_settings(self,settings_path):
config.set('Settings', 'skip_known_deleted', str(self.skip_known_deleted) )
config.set('Settings', 'deleted_submissions_list_path', str(self.deleted_submissions_list_path) )
config.set('Settings', 'move_on_fail_verification', str(self.move_on_fail_verification) )
# /derpibooru_dl.py
# split_to_tag_folders.py
# /split_to_tag_folders.py
config.set('Settings', 'save_comments', str(self.save_comments) )
with open(settings_path, 'wb') as configfile:
config.write(configfile)
return
Expand Down Expand Up @@ -732,7 +731,11 @@ def download_submission(settings,search_query,submission_id):
if submission_id in settings.deleted_submissions_list:
return
# Build JSON URL
json_url = "https://derpibooru.org/"+submission_id+".json?key="+settings.api_key
# Option to save comments, uses more resources.
if settings.save_comments:
json_url = "https://derpibooru.org/"+submission_id+".json?comments=true&key="+settings.api_key
else:
json_url = "https://derpibooru.org/"+submission_id+".json?key="+settings.api_key
# Retry if needed
download_attempt_counter = 0
while download_attempt_counter <= settings.max_download_attempts:
Expand Down

0 comments on commit 44ec124

Please sign in to comment.