Some more string replacements in the target filename.
This commit is contained in:
parent
51c979582c
commit
1d15f66249
1 changed files with 14 additions and 3 deletions
17
fgg
17
fgg
|
|
@ -45,7 +45,7 @@ sys.stdout.write("\x1b]2;fgg\x07")
|
|||
# Set the title for Windows.
|
||||
os.system("fgg")
|
||||
|
||||
__version__ = "0.1.0"
|
||||
__version__ = "0.1.1"
|
||||
|
||||
flickr_api_key = os.environ['FLICKR_API_KEY']
|
||||
flickr_api_secret = os.environ['FLICKR_API_SECRET']
|
||||
|
|
@ -205,11 +205,18 @@ while photo_page <= page_count:
|
|||
target_file_name = flickr_photo.title.replace(':)', '')
|
||||
target_file_name = target_file_name.replace(':D', '')
|
||||
target_file_name = target_file_name.replace(';)', '')
|
||||
target_file_name = flickr_photo.title.replace(':-)', '')
|
||||
target_file_name = target_file_name.replace(':-D', '')
|
||||
target_file_name = target_file_name.replace(';-)', '')
|
||||
target_file_name = target_file_name.replace('\'', '')
|
||||
target_file_name = target_file_name.replace('\"', '')
|
||||
##target_file_name = target_file_name.replace('.', '')
|
||||
# Maybe remove all dots too... but maybe it doesn't matter.
|
||||
#target_file_name = target_file_name.replace('.', '')
|
||||
target_file_name = target_file_name.replace(',', '')
|
||||
target_file_name = target_file_name.replace('!', '')
|
||||
target_file_name = target_file_name.replace('/', '')
|
||||
target_file_name = target_file_name.replace(' / ', '-')
|
||||
target_file_name = target_file_name.replace('/ ', '-')
|
||||
target_file_name = target_file_name.replace('/', '-')
|
||||
target_file_name = target_file_name.replace(':', '')
|
||||
target_file_name = target_file_name.replace('(', '')
|
||||
target_file_name = target_file_name.replace(')', '')
|
||||
|
|
@ -227,6 +234,10 @@ while photo_page <= page_count:
|
|||
# Remove trailing whitespaces.
|
||||
target_file_name = target_file_name.rstrip()
|
||||
target_file_name = target_file_name.replace(' ', '-')
|
||||
target_file_name = target_file_name.replace('-----', '-')
|
||||
target_file_name = target_file_name.replace('----', '-')
|
||||
target_file_name = target_file_name.replace('---', '-')
|
||||
target_file_name = target_file_name.replace('--', '-')
|
||||
|
||||
target_file_name = target_file_name + '-' + photo['fgg_id'] + '-' + \
|
||||
flickr_photo_sizes[flickr_photo_size]['label'].replace(' ', '-')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue