Hello.
I want to start using Skrooge for accounting and have installed it from flathub. I am using multiple currencies, so I got an API key for exchangeratesapi from apilayer. Then I tried to download the quotes and it failed with the error:
[ERR-5]: Download failed
[ERR-5]: Impossible to download unit United States Dollar (USD) with Internet code USD-EUR on the source exchangerates_apilayer.com.
[ERR-5]: The following command line failed with code 1:
'/app/share/skrooge/skrooge-exchangerates_apilayer.py USD-EUR <API_KEY>'
I found the file:
$ sudo find / -name "*skrooge-exchangerates_apilayer.py*"
find: '/run/user/1000/doc': Permission denied
/var/lib/flatpak/app/org.kde.skrooge/x86_64/stable/14f29da5462d5f684172af23758a05ae6a0f5209bf9f7ebc5787ec8394af4637/files/share/skrooge/skrooge-exchangerates_apilayer.py
This is the file:
$ cat /var/lib/flatpak/app/org.kde.skrooge/x86_64/stable/14f29da5462d5f684172af23758a05ae6a0f5209bf9f7ebc5787ec8394af4637/files/share/skrooge/skrooge-exchangerates_apilayer.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#***************************************************************************
#* SPDX-FileCopyrightText: 2022 S. MANKOWSKI stephane@mankowski.fr
#* SPDX-License-Identifier: GPL-3.0-or-later
#***************************************************************************
import urllib.request
import json
import sys
import datetime
units=sys.argv[1].split('-')
apikey = sys.argv[2]
import requests
url = 'https://api.apilayer.com/exchangerates_data/latest?base=EUR&symbols='+units[0]+','+units[1]
payload = {}
headers= {"apikey": apikey}
response = requests.request("GET", url, headers=headers, data = payload)
print("Date,Price")
data = json.loads(response.text)
print(data['date']+','+str(data['rates'][units[1]]/data['rates'][units[0]]))
And when I try to run it manually:
$ /var/lib/flatpak/app/org.kde.skrooge/x86_64/stable/14f29da5462d5f684172af23758a05ae6a0f5209bf9f7ebc5787ec8394af4637/files/share/skrooge/skrooge-exchangerates_apilayer.py USD-EUR <API_KEY>
Date,Price
2023-07-04,0.9177503003337858
I think the problem is in the fact that it’s a flatpak and I have to somehow point it to the right path to the file or something.
The same happens with all other sources, like Yahoo Finance.