change secrets file path

This commit is contained in:
Dryusdan 2017-12-23 15:47:31 +01:00
parent a2ddb80445
commit 284d21c59d
1 changed files with 8 additions and 7 deletions

View File

@ -34,8 +34,14 @@ def get_parameter( parameter, file_path ):
sys.exit(0)
# Load secrets from secrets file
secrets_filepath = "secrets/secrets.txt"
#https://source.unsplash.com/collection/1053828/1920x1080
if args.sex == "man":
collection = "1523783"
secrets_filepath = "secrets/secrets-man.txt"
elif args.sex == "women":
collection = "1523809"
secrets_filepath = "secrets/secrets-women.txt"
uc_client_id = get_parameter("client_id", secrets_filepath)
uc_client_secret = get_parameter("client_secret", secrets_filepath)
uc_access_token = get_parameter("access_token", secrets_filepath)
@ -48,11 +54,6 @@ mastodon = Mastodon(
api_base_url = 'https://' + mastodon_hostname,
)
#https://source.unsplash.com/collection/1053828/1920x1080
if args.sex == "man":
collection = "1523783"
elif args.sex == "women":
collection = "1523809"
response = requests.get("https://source.unsplash.com/collection/"+collection+"/")
pattern = Image.open(BytesIO(response.content), "r").convert('RGB')