6/26/2023 0 Comments Flickr uploadr mac![]() SECRET_SET and API_KEY_SET - Here is where you want to enter the two keys you just created on Flickr. Leave the /uploadr.history at the end as this is the creation of the file. Again, I would make the same folder as the uploadr.py file. Where you see ENTER_PATH_FOR_HISTORY_FILE you want to replace with the directory you want to store this in. FLICKR_MOVIE_MAX_LENGTH = 180 # Enable Video Upload VIDEO_UPLOAD_ENABLED = 1 # Path to QT info app qtinfo = "/usr/local/bin/qt_info" # Flickr settings # FLICKR = # How often to check for new images to upload (in seconds ) # SLEEP_TIME = 1 * 60 # log file information # logger = logging.getLogger("uploadr") tLevel(logging.DEBUG) #create file handler and set level to debug fh = logging.FileHandler("ENTER_PATH_FOR_LOG_FILE/uploadr_run_results.log") fh.setLevel(logging.DEBUG) ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) logger.addHandler(fh) logger.addHandler(ch) # IMAGE_DIRS - Leave this blank, as is HISTORY_FILE - This file stores the uploaded images and videos so once they have uploaded, they will not be re-uploaded again. YOU CAN GET YOUR OWN API KEY AND SECRET BY GOING HERE: SECRET_SET = "ENTER_SECRET" API_KEY_SET = "ENTER_API_KEY" # Set location of your token file after authenticated for first time TOKEN_FILE_SET = "ENTER_PATH_FOR_TOKEN_FILE/flickrToken.txt" # The maximum length of a video allowed by flickr in seconds # video longer than this will not be uploaded. HISTORY_FILE = "ENTER_PATH_FOR_HISTORY_FILE/uploadr.history" # SET YOUR FLICKR API INFO. I will briefly go through them - first the code with the explanation after: Code: Select all # Items you will want to change # Locations to scan for new images and videos # IMAGE_DIRS = # File we keep the history of uploaded images in. Here you need to edit the variables to fit your needs. ![]() Notice about 50 lines down the section called "Items You will want to change". Part 3: Authenticating and creating your token for the first time Editing your uploadr.py file: Locate the upload.py file you downloaded earlier and open it in a your favorite script editing program (i use TextWrangler). Copy these somewhere as you will need them shortly. Flickr now presents you with your Key and Secret. Click both checkboxes and the hit Submit. Give your app any name and then just type anything for the "What are you building" section. First log into your Flickr account and then go to this address where you will be presented with a screen called the App Garden. The first step is to tell Flickr you are creating an app so it can give you the two keys. Part 2: Getting your authentication keys from Flickr API Creating the Keys: In order to be able to upload content to Flickr via the API, you need to get a Secret and API key along with an authentication token. You can do this by opening a terminal window, cd to the location of the script you just copied, and typing: sudo sh install.sh. Once you download it, copy the contents to a folder on your desktop and run the install.sh script. This program enables the script to check for the length on the video file since Flickr only allows 3 minute videos or less to be uploaded. ![]() Other files: In order to make the script upload video, you will need to download and install Qt-Tools. To work with Hazel, you will also need to copy the xmltramp.py file to the /Library/Python//site-packages folder. For instance, I have a Scripts folder for all my external Hazel scripts where i stored these in a subfolder called Flickr. My suggestion is that that you place them in a location where you will also want to store a few other output files that the script generates. Pre-requisites: 1) Python must be installed on your Mac 2) You must have a Flickr account (ok, so obviously) Part 1: Installing the necessary files Key script files: Download and extract the following zip which includes two python files, upload.py and xmltramp.py. There is some setup involved and you will need to edit some script files so please make sure you are comfortable doing so before you embark. The following explains how to use Hazel to automatically upload your photos and videos to Flickr.
0 Comments
Leave a Reply. |