Bug 427566 - POTD flickr provider api_key 11829a470557ad8e10b02e80afacb3af expired
Summary: POTD flickr provider api_key 11829a470557ad8e10b02e80afacb3af expired
Status: RESOLVED FIXED
Alias: None
Product: kdeplasma-addons
Classification: Plasma
Component: Picture of the Day (show other bugs)
Version: 5.19.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Guo Yunhe
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-12 01:13 UTC by colin.xu
Modified: 2021-03-08 18:44 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description colin.xu 2020-10-12 01:13:13 UTC
SUMMARY


STEPS TO REPRODUCE
1. Flicker POTD doesn't get updated since 9/29.

OBSERVED RESULT
Test current api_key 11829a470557ad8e10b02e80afacb3af in https://www.flickr.com/services/api/explore/flickr.interestingness.getList, it will respond:

<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="fail">
  <err code="100" msg="Invalid API Key (Key not found)" />
</rsp>

Test with another api_key requested in personal account, the api will return successfully.

EXPECTED RESULT
Flicker POTD works with correct api_key.

SOFTWARE/OS VERSIONS
Windows: N/A
macOS: N/A
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: plasma-desktop 5.19.5-1
KDE Frameworks Version: plasma-framework 5.75.0-1
Qt Version: 5.15.1

ADDITIONAL INFORMATION
kdeplasma-addons 5.19.5-1
Comment 1 Guo Yunhe 2020-10-12 19:29:08 UTC
Maybe I will check if here are other ways to fetch the picture without API key. We cannot be sure if the key expired or get banned by flickr...
Comment 2 colin.xu 2020-10-13 00:50:14 UTC
(In reply to Guo Yunhe from comment #1)
> Maybe I will check if here are other ways to fetch the picture without API
> key. We cannot be sure if the key expired or get banned by flickr...

How about simply parse flicker interesting calendar?
i.e.
https://www.flickr.com/explore/interesting/2020/10/
Comment 3 Guo Yunhe 2020-10-13 07:21:38 UTC
In that page we can parse the URL of pictures. But the size is very small. It is more complex to get a 1080p+ size image.
Comment 4 colin.xu 2020-10-14 00:36:47 UTC
(In reply to Guo Yunhe from comment #3)
> In that page we can parse the URL of pictures. But the size is very small.
> It is more complex to get a 1080p+ size image.

Not just get the thumbnail version. 
From the interesting calendar, you direct get a _s version picture, plus a href to the album page of that picture, let say this one:

<td class="FullDay" id="20201012"><a href="/explore/interesting/2020/10/12/" title="Zoom into October 12th 2020" onclick="intrestpop_show('20201012', 'October 12th 2020'); return false;"><img
src="https://live.staticflickr.com/65535/50460505761_882f80f43f_s.jpg" width="75" height="75" class="Thumb" alt="Zoom into October 12th 2020" /></a>
<div class="BlackDate">12</div>
<div class="WhiteDate">12</div>
</td>

The small image for 10/12 is 50460505761_882f80f43f_s.jpg. 
You can find the album URL of this page here:
intrestpop_HASH['20201012'] = [
	{thumb:'https://live.staticflickr.com/65535/50460505761_882f80f43f_s.jpg', page:'/photos/86832534@N03/50460505761/'},

Thanks to well-formatted flickr image url: 
https://www.flickr.com/services/api/misc.urls.html

you can go to the album page now and get any size of the picture:
https://www.flickr.com/photos/86832534@N03/50460505761/sizes/l/
Comment 5 Bug Janitor Service 2020-11-05 00:12:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/35
Comment 6 Nate Graham 2021-03-05 17:09:38 UTC
Git commit bdf8e6fe7e71d7ba0bb82d34569cf8559adb8129 by Nate Graham, on behalf of Alexander Lohnau.
Committed on 05/03/2021 at 17:09.
Pushed by ngraham into branch 'master'.

Fix outdated API key for flickr provider

This is not a proper solution, but fixed it for now.
See https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/35
which addresses the issues with LTS distors etc.

M  +1    -1    dataengines/potd/flickrprovider.cpp

https://invent.kde.org/plasma/kdeplasma-addons/commit/bdf8e6fe7e71d7ba0bb82d34569cf8559adb8129
Comment 7 Nate Graham 2021-03-05 17:10:37 UTC
Git commit 905c21875e866ab59cc338ccff9ecd1c5ca84f21 by Nate Graham, on behalf of Alexander Lohnau.
Committed on 05/03/2021 at 17:10.
Pushed by ngraham into branch 'Plasma/5.21'.

Fix outdated API key for flickr provider

This is not a proper solution, but fixed it for now.
See https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/35
which addresses the issues with LTS distors etc.


(cherry picked from commit bdf8e6fe7e71d7ba0bb82d34569cf8559adb8129)

M  +1    -1    dataengines/potd/flickrprovider.cpp

https://invent.kde.org/plasma/kdeplasma-addons/commit/905c21875e866ab59cc338ccff9ecd1c5ca84f21
Comment 8 Nate Graham 2021-03-05 17:10:59 UTC
Git commit 90a993061f0987bb46d42f2c5e9bf9c0d51291b6 by Nate Graham, on behalf of Alexander Lohnau.
Committed on 05/03/2021 at 17:10.
Pushed by ngraham into branch 'Plasma/5.18'.

Fix outdated API key for flickr provider

This is not a proper solution, but fixed it for now.
See https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/35
which addresses the issues with LTS distors etc.


(cherry picked from commit bdf8e6fe7e71d7ba0bb82d34569cf8559adb8129)

M  +1    -1    dataengines/potd/flickrprovider.cpp

https://invent.kde.org/plasma/kdeplasma-addons/commit/90a993061f0987bb46d42f2c5e9bf9c0d51291b6
Comment 9 Nate Graham 2021-03-05 17:14:14 UTC
Fixed for now by changing the API key. Since this keeps happening, we are going to try to fix it in a more generic way in https://invent.kde.org/plasma/kdeplasma-addons/-/merge_requests/35.
Comment 10 Guo Yunhe 2021-03-08 17:55:28 UTC
Git commit 04c4d02a334ca11c0c8954a932987ad5a5294967 by Yunhe Guo, on behalf of Guo Yunhe.
Committed on 08/03/2021 at 17:54.
Pushed by guoyunhe into branch 'master'.

[dataengines/potd] Fix flickr provider

Now flickr provider always fetch the keys from KDE Invent. If the key
expires, we just update it in KDE Invent, and users don't need to do
anything.

Fix #3

M  +1    -1    dataengines/potd/CMakeLists.txt
D  +0    -3    dataengines/potd/flickrprovider.conf
M  +36   -33   dataengines/potd/flickrprovider.cpp
M  +11   -10   dataengines/potd/flickrprovider.h
M  +69   -6    dataengines/potd/potdprovider.cpp
M  +19   -5    dataengines/potd/potdprovider.h

https://invent.kde.org/plasma/kdeplasma-addons/commit/04c4d02a334ca11c0c8954a932987ad5a5294967