varietywalls / variety

Wallpaper downloader and manager for Linux systems
http://peterlevi.com/variety
GNU General Public License v3.0
1.21k stars 146 forks source link

Flickr API key expired #702

Open fpasqua75 opened 6 months ago

fpasqua75 commented 6 months ago

Version of Variety 0.8.12

Describe the bug Flickr API key is expired

Context I find this error in the logs:

mag 24 09:40:10 easterlaptop.local variety.desktop[2983]:   File "/usr/lib/python3.12/site-packages/variety/FlickrDownloader.py", line 163, in fill_queue
mag 24 09:40:10 easterlaptop.local variety.desktop[2983]:     raise Exception("Flickr returned error message: " + resp["message"])
mag 24 09:40:10 easterlaptop.local variety.desktop[2983]: Exception: Flickr returned error message: Invalid API Key (Key has expired)
mag 24 09:40:11 easterlaptop.local variety.desktop[2983]: ERROR: 2024-05-24 09:40:11,530: download_one_from() 'Could not download wallpaper:'
mag 24 09:40:11 easterlaptop.local variety.desktop[2983]: Traceback (most recent call last):
mag 24 09:40:11 easterlaptop.local variety.desktop[2983]:   File "/usr/lib/python3.12/site-packages/variety/VarietyWindow.py", line 1164, in download_one_from
mag 24 09:40:11 easterlaptop.local variety.desktop[2983]:     file = downloader.download_one()
mag 24 09:40:11 easterlaptop.local variety.desktop[2983]:            ^^^^^^^^^^^^^^^^^^^^^^^^^
mag 24 09:40:11 easterlaptop.local variety.desktop[2983]:   File "/usr/lib/python3.12/site-packages/variety/plugins/downloaders/DefaultDownloader.py", line 141, in download_one
mag 24 09:40:11 easterlaptop.local variety.desktop[2983]:     items = self.fill_queue()
mag 24 09:40:11 easterlaptop.local variety.desktop[2983]:             ^^^^^^^^^^^^^^^^^
mag 24 09:40:11 easterlaptop.local variety.desktop[2983]:   File "/usr/lib/python3.12/site-packages/variety/FlickrDownloader.py", line 163, in fill_queue
mag 24 09:40:11 easterlaptop.local variety.desktop[2983]:     raise Exception("Flickr returned error message: " + resp["message"])
mag 24 09:40:11 easterlaptop.local variety.desktop[2983]: Exception: Flickr returned error message: Invalid API Key (Key has expired)

To Reproduce

  1. nothing in particular

Attach Variety's log file

Desktop environment and version Gnome 48

OS name and version

$ cat /etc/issue && cat /etc/os-release
\S
Kernel \r on an \m (\l)

NAME="Fedora Linux"
VERSION="40 (Workstation Edition)"
ID=fedora
VERSION_ID=40
VERSION_CODENAME=""
PLATFORM_ID="platform:f40"
PRETTY_NAME="Fedora Linux 40 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:40"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f40/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=40
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=40
SUPPORT_END=2025-05-13
VARIANT="Workstation Edition"
VARIANT_ID=workstation

Thank you.

evjeesm commented 5 months ago

Same trouble on Debian Bookworm. Variety version: 0.8.10-1

henti commented 5 months ago

being able to add your own Flickr key/secret would be very nice as a feature..

mendhak commented 2 months ago

This is still broken unfortunately. On a fresh install from the PPA, on a fresh Ubuntu 24.04. When trying to add a Flickr source, or use the existing one, the error appears bottom right.

Invalid API Key (Key has expired)

image

mendhak commented 2 months ago

Temporary workaround if anyone wants, but it isn't trivial, it'll get undone on each update. Hopefully this API key issue is resolved soon.

You need to know where your Variety installation's Python scripts are. And generate your own Flickr API key.

Create a script, notice the second line pointing at the variety folder.

import sys
sys.path.append('/usr/lib/python3/dist-packages/variety/')
import FlickrDownloader
from Util import Util
print(Util.unxor(FlickrDownloader.HASH, sys.argv[1]))

Run it, passing your own API key.

python3 gethash.py xxxxxxxxxxxxxxxxxxxxxxxxxx

Then modify the /usr/lib/python3/dist-packages/variety/FlickrDownloader.py file and replace API_KEY with the output from above.

Restart Variety then try using the Flickr feature. I hope this is an acceptable workaround as a temporary measure.

yhilgjff commented 2 months ago

This is still broken unfortunately. On a fresh install from the PPA, on a fresh Ubuntu 24.04. When trying to add a Flickr source, or use the existing one, the error appears bottom right.

Invalid API Key (Key has expired)

image

Thanks, I was about to post the same thing (but in a much less elegant expression)

Of course the permanent way to fix this is to uncheck Flick from the Preferences and then General tab.