Flickr upload feature complete
This commit is contained in:
parent
b2edd16356
commit
71c9675059
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
||||
include
|
||||
bin
|
||||
conf.toml
|
||||
|
||||
# ---> Python
|
||||
# Byte-compiled / optimized / DLL files
|
||||
|
@ -1,7 +1,5 @@
|
||||
import os
|
||||
import os, toml
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
|
||||
flickr_key = os.getenv('FLICKR_KEY')
|
||||
flickr_secret = os.getenv('FLICKR_SECRET')
|
||||
config = toml.load("conf.toml")
|
||||
print(config)
|
5
main.py
5
main.py
@ -1,7 +1,5 @@
|
||||
import load_config
|
||||
import image_processing
|
||||
import load_config
|
||||
import publish_flickr
|
||||
|
||||
import os, sys
|
||||
|
||||
@ -38,7 +36,8 @@ def main():
|
||||
item_data = image_processing.get_image_data(item)
|
||||
file_data.append(item_data)
|
||||
|
||||
print(file_data)
|
||||
if load_config.config['flickr']['enable']:
|
||||
import publish_flickr
|
||||
publish_flickr.upload(file_data)
|
||||
|
||||
def list_files_in_directory(directory):
|
||||
|
@ -2,7 +2,7 @@ import flickrapi
|
||||
import load_config
|
||||
|
||||
print("Authenticating with Flickr")
|
||||
flickr = flickrapi.FlickrAPI(load_config.flickr_key, load_config.flickr_secret)
|
||||
flickr = flickrapi.FlickrAPI(load_config.config['flickr']['app_api'], load_config.config['flickr']['app_secret'])
|
||||
flickr.authenticate_via_browser(perms='write')
|
||||
|
||||
def upload(file_data: list):
|
||||
@ -16,6 +16,7 @@ def upload(file_data: list):
|
||||
is_public = 1,
|
||||
format = 'rest'
|
||||
)
|
||||
print("Uploading to Flickr")
|
||||
|
||||
def prepareTags(input_list: list):
|
||||
output_list = []
|
||||
|
Loading…
Reference in New Issue
Block a user