You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When the flickr API call sends a request, the returned response is full of cats and kittens.
Side note: This was the most entertaining bug hunt in my entire lifetime of coding. Of all the types of cross platform bugs to see - a bird identification app returning flickr cat photos by mistake - is just purrrfectly ironic. (Sorry, not sorry).
To Reproduce
Steps to reproduce the behavior:
Enter your Filckr API into the configuration file
Restart your system
Go to "Best Recordings" in Birdnet
Choose a species
Scroll down below the audio file.
See kittens.
Expected behavior
I expect to see birds. 😸
Screenshots
Additional context
I migrated from this other fork, following the instructions for the migration. I noticed this issue right afterwards. If I revert to my backup from prior to the migration, birds appear from the flickr call as expected.
$engame is a value generated from this function get_com_en_name, which relies on passing in a scientific name, which is being passed in as empty.
So null is returned. This is a separate issue that I need to review (why is scientific name always empty?). It may be related to the migration I did and file permission issues.
But on with the kitten conundrum.
The issue is with the line below. The text parameter is being created with double quotes with nothing in between them, which then gets URL encoded.
Note about Flickr API behavior:
Interestingly, this appears to be undocumented behavior in the Flickr API where sending text="" (URL encoded as %22%22) seems to trigger a default response or possible easter egg that returns kitten photos. When the quotes are removed and just text= is sent, the API returns random photos as expected. This behavior isn't documented in Flickr's API documentation, making this bug both amusing and confusing.
I searched Flickr's API documentation and it may be an easter egg - there seem to be some cat people working there!
Describe the bug
When the flickr API call sends a request, the returned response is full of cats and kittens.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect to see birds. 😸
Screenshots
Additional context
I migrated from this other fork, following the instructions for the migration. I noticed this issue right afterwards. If I revert to my backup from prior to the migration, birds appear from the flickr call as expected.
https://github.com/mcguirepr89/BirdNET-Pi
Your build
Rasberry Pi Model 4B
Version: Main branch (commit e3eb094)
Code or log snippets
BirdNET-Pi/scripts/common.php
Line 92 in e3eb094
$engame
is a value generated from this functionget_com_en_name
, which relies on passing in a scientific name, which is being passed in as empty.So null is returned. This is a separate issue that I need to review (why is scientific name always empty?). It may be related to the migration I did and file permission issues.
But on with the kitten conundrum.
The issue is with the line below. The text parameter is being created with double quotes with nothing in between them, which then gets URL encoded.
BirdNET-Pi/scripts/stats.php
Line 215 in e3eb094
This generates a call to the API that looks like this:
https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=REDACTED&text=%22%22&license=2%2C3%2C4%2C5%2C6%2C9&sort=relevance&per_page=15&format=json&nojsoncallback=1
Note about Flickr API behavior:
Interestingly, this appears to be undocumented behavior in the Flickr API where sending
text=""
(URL encoded as%22%22
) seems to trigger a default response or possible easter egg that returns kitten photos. When the quotes are removed and justtext=
is sent, the API returns random photos as expected. This behavior isn't documented in Flickr's API documentation, making this bug both amusing and confusing.I searched Flickr's API documentation and it may be an easter egg - there seem to be some cat people working there!
Flickr API Posts Tagged with Kittens
Change the line to:
And you now just have random photos, which is a debatable improvement to kittens.
The text was updated successfully, but these errors were encountered: