# piflickr, version 1.0 # Copyright by Ly Anh Tuan piflickr runs on RPi (and devices with Debian Jessie OS), automatically uploads photos/movies from a photo vault with different photos in subfolders. Each subfolder's name will be used as the title of the album containing photos/albums in that subfolder. There are 2 types of photo/movie uploading: - uploading all photos/movies from photo vault for the first time - uploading updated/new photos/movies from photo vault With RPi 3, we can have 3 uploading threads on each CPU core, making a total of 12 uploading threads. Can increase or decrease the number of threads depending on connection speed and if flickr server is free. A. This app uses Python 3 và flickrapi library. 1. Install Python 3 onRPi sudo apt-get install -y python3 echo alias python='python3' >> ~/.bashrc echo alias python='python3' >> ~/.profile source ~/.bashrc source ~/.profile 2. Install flickrapi library (for python3) wget https://pypi.python.org/packages/c1/ed/faa83878792d4d3710937d75bb374e6b4fb79f19df5b777428ee0cce6b1f/flickrapi-2.3.tar.gz#md5=07fd955647fd41eb360579b3613f1432 tar zxvf flickrapi-2.3.tar.gz cd flickrapi-2.3 sudo python setup.py install 3. Install supporting apps sudo apt-get install -y inotify-tools parallel B. Photos uploaded on flickr need to be organized into folders. Folder name can include blanks and can be a unicode utf-8 string. This folder name will be the title of the folder containing these photos. C. In piflickr folder: 1. Change user.py file with user's information. 2. Run pifstart.py file to start uploading. When we start running pifstart, flickr may request to run a url on browser to get access token. This is necessary and will not take more than 1 minute. If the photo vault is big (with >10,000 photos), uploading can take several hours. We can run pifstart.py from crontab if uploading takes several days. @reboot /path/to/piflickr/pifstart.py This app automatically merges all albums with the same title. If some albums with the same title remain, run merge.sh 3. After finishing uploading, we need to monitor the photo vault to upload newly added photos. We can run watch.sh from crontab to start monitoring: @reboot /path/to/piflickr/watch.sh photo_dir D. File piflickr.log records uploading activities. File nohup.out records error notifications from flickr.com, such as expired access token or disconnection... E. Use command 'pstree' or 'pidof -x piflickr.sh' to check if piflickr.sh is still working. Use command 'htop' to check how piflickr1's threads are working. F. Files on piflickr 1. README.VN.txt or README.EN.txt 2* merge.sh 3. piflickr.sh # call from pifstart.py 4. piflickr1 # call from pifstart.py 5* pifstart.py 6. pilist.sh # call from pifstart.py 7. user.py # call from pifstart.py 8* watch.sh