[SoundCloud] Use a lightweight request to check if the hardcoded client_id is valid, fix the extraction of mobile URLs and more #627
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I carefully read the contribution guidelines and agree to them.
I have tested the API against NewPipe. - See TiA4f8R/NewPipe#4 for an up to date debug APK.
I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API. - Not needed
Format the SoundCloud package to be in the limit of 100 caracters per line, use final where possible, fix some code comments and warnings.
Use a new and lightweight way to check if the hardcoded
client_id
is valid: do a request tohttps://api-v2.soundcloud.com/?client_id=HARDCODED_CLIENT_ID
. If the response code is 404, the hardcodedclient_id
is valid; if the response code is 401 (and maybe other error codes), it isn't.Rename
removeWWWFromUrl
method of theUtils
class of the extractor toremoveMAndWWWFromUrl
because it now also removes them.
part of the SoundCloud domains, in order to be recognized by the SoundCloud API (the widget API right now when trying to get ids of contents). This fixes the extraction of mobile URLs, like [SoundCloud] Fix getting ID from mobile URLs #626 but maybe in a better way.Fixes TeamNewPipe/NewPipe#6284.