flake8 fixes

This commit is contained in:
frederik
2025-08-02 19:32:43 +02:00
parent 927a1da534
commit df15948083
3 changed files with 8 additions and 11 deletions
+5 -2
View File
@@ -14,6 +14,7 @@ DB_PATH = userDir + '/BirdNET-Pi/scripts/birds.db'
flickr_images = {}
species_last_notified = {}
asset = apprise.AppriseAsset(
plugin_paths=[
userDir + "/.apprise/plugins",
@@ -107,13 +108,15 @@ def sendAppriseNotifications(species, confidence, confidencepct, path,
# TODO: Make this work with non-english comnames. Implement the "// convert sci name to English name" logic from overview.php here
headers = {'User-Agent': 'Python_Flickr/1.0'}
url = ('https://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=' + str(settings_dict.get('FLICKR_API_KEY')) +
'&text=' + str(comName) + ' bird&sort=relevance&per_page=5&media=photos&format=json&license=2%2C3%2C4%2C5%2C6%2C9&nojsoncallback=1')
'&text=' + str(comName) +
' bird&sort=relevance&per_page=5&media=photos&format=json&license=2%2C3%2C4%2C5%2C6%2C9&nojsoncallback=1')
resp = requests.get(url=url, headers=headers, timeout=10)
resp.encoding = "utf-8"
data = resp.json()["photos"]["photo"][0]
image_url = 'https://farm'+str(data["farm"])+'.static.flickr.com/'+str(data["server"])+'/'+str(data["id"])+'_'+str(data["secret"])+'_n.jpg'
image_url = ('https://farm' + str(data["farm"]) + '.static.flickr.com/' + str(data["server"]) + '/' +
str(data["id"]) + '_'+str(data["secret"]) + '_n.jpg')
flickr_images[comName] = image_url
except Exception as e:
print("FLICKR API ERROR: "+str(e))