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