gpodder / gpodder-sailfish

gPodder 4 for Sailfish OS Packaging
https://openrepos.net/content/keeperofthekeys/gpodder
49 stars 29 forks source link

Soundcloud require authentication #166

Open Karry opened 2 years ago

Karry commented 2 years ago

Using gPodder 4.12.0, when I'm trying to search podcast on Soundcloud, it fails because of http/401 "Unauthorized". It seems that api was changed recently.

[D] unknown:0 - "PyOtherSide error: Traceback (most recent call last):\n\n  File \"/usr/share/harbour-org.gpodder.sailfish/main.py\", line 467, in get_directory_entries\n    } for e in provider.on_string(query)]\n\n  File \"/usr/share/harbour-org.gpodder.sailfish/gpodder/directory.py\", line 57, in on_string\n    return self.on_search(query)\n\n  File \"/usr/share/harbour-org.gpodder.sailfish/gpodder/plugins/soundcloud.py\", line 307, in on_search\n    for entry in util.read_json(json_url)]\n\n  File \"/usr/share/harbour-org.gpodder.sailfish/gpodder/util.py\", line 859, in read_json\n    return json.loads(urlopen(url).read().decode('utf-8'))\n\n  File \"/usr/share/harbour-org.gpodder.sailfish/gpodder/util.py\", line 690, in urlopen\n    return opener.open(request)\n\n  File \"/usr/lib64/python3.8/urllib/request.py\", line 531, in open\n    response = meth(req, response)\n\n  File \"/usr/lib64/python3.8/urllib/request.py\", line 640, in http_response\n    response = self.parent.error(\n\n  File \"/usr/lib64/python3.8/urllib/request.py\", line 569, in error\n    return self._call_chain(*args)\n\n  File \"/usr/lib64/python3.8/urllib/request.py\", line 502, in _call_chain\n    result = func(*args)\n\n  File \"/usr/lib64/python3.8/urllib/request.py\", line 649, in http_error_default\n    raise HTTPError(req.full_url, code, msg, hdrs, fp)\n\nurllib.error.HTTPError: HTTP Error 401: Unauthorized\n"
[D] onError:95 - Python failure: Return value of PyObject call is NULL: Traceback (most recent call last):
Keeper-of-the-Keys commented 2 years ago

Yeah they changed the way the API works, I have not had the time to really look into it, it was mentioned in the changelog of 4.12.90 (openrepos) that Soundcloud is currently broken, patches are very welcome.

Please note that the Soundcloud plugin lives in https://github.com/gpodder/gpodder-core so that is where most PRs will need to be done.

Keeper-of-the-Keys commented 1 year ago

We have no way to resolve this within the Terms of Use of Soundcloud API and the ID of a user also does not match the ID of RSS links so I don't know of an easy workaround. A lot of soundcloud podcasts are listed on apple podcasts so the apple podcast search that was added in 4.14 should be helpful.

Leaving this open for suggestions for deal with soundcloud.