sybrenstuvel / flickrapi

Python Flickr API implementation
https://stuvel.eu/flickrapi
Other
155 stars 33 forks source link

Authentication is required (Under Synology NAS) #134

Open mlino opened 3 years ago

mlino commented 3 years ago

I'm using your Flickr API to make a simple python script to upload images to my Flickr account, but I noticed something weird. So I have codded it on my windows machine using VSCode, and then put the code on my Synology NAS to run it 24/7. On my windows machine, it works great, but on Synology NAS, I keep getting an Authentication Error as shown below:

flickr.upload(file)
File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/flickrapi/core.py", line 494, in upload
return self._upload_to_form(self.UPLOAD_URL, filename, fileobj, timeout=timeout, **kwargs)
File "/var/packages/py3k/target/usr/local/lib/python3.8/site-packages/flickrapi/core.py", line 533, in _upload_to_form
raise IllegalArgumentException("Authentication is required")

I really don't understand why it is working on windows, but giving me the above-mentioned error on the Synology Linux. The Linux version, running in the Synology NAS is listed below: (Linux version 4.4.59+ (root@build3) (gcc version 4.9.3 20150311 (prerelease) (crosstool-NG 1.20.0) ) #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021).

FYI the following code would give me the same error like the one stated above:

import flickrapi

file = '/volume1/FTP/Evento_AeroITA_5D_3167.jpg'
api_key = u'xxxxxxxxxxxxxxxxxxxxxxxxxx'
api_secret = u'xxxxxxxxxxxxxxxxxxx'

flickr = flickrapi.FlickrAPI(api_key, api_secret)

tags = '"Marcio Lino" ATCBSB "Aviation Photography" SpottersBrasil "@marcioslsouza" '

params = {}
params['filename'] = file
params['title'] = 'Photography'
params['description'] = 'Live, From The Action using Flickr API'
params['tags'] = tags

flickr.upload(**params)

Thanks!

randomcascade commented 3 years ago

Oof yeah. I was working on that a few months back. I haven't had a working developer machine up until a little bit ago. But I will look into what's going on with that. Just for a sanity check which version of Python are you using?

randomcascade commented 3 years ago

Also same as #133 I presume. I'll hold off on closing it until I'm sure of that.

mlino commented 3 years ago

Hi @randomcascade!

I've Python 3.8.6 installed on my Synology NAS, as you can see below:

Python 3.8.6 (default, Jan  4 2021, 16:11:49)
[GCC 4.9.3 20150311 (prerelease)] on Linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Thanks.