[SoundCloud] Use a lightweight request to check if the hardcoded client_id is valid, fix the extraction of mobile URLs and more#627
Merged
TobiGr merged 5 commits intoTeamNewPipe:devfrom May 23, 2021
Conversation
3 tasks
Use final where possible in the package and format code to be in the 100 caracters per line limit. Fix some warnings generated by Android Studio and do some code improvements
Request the api-v2 host with the client_id instead of checking if the streams of a SoundCloud track are not empty: if it is valid, the API returns 404, otherwise it should return 401.
4815ccf to
6b607eb
Compare
TobiGr
approved these changes
May 23, 2021
…dcloudParsingHelper.resolveFor method Co-authored-by: Tobi <TobiGr@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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_idis valid: do a request tohttps://api-v2.soundcloud.com/?client_id=HARDCODED_CLIENT_ID. If the response code is 404, the hardcodedclient_idis valid; if the response code is 401 (and maybe other error codes), it isn't.Rename
removeWWWFromUrlmethod of theUtilsclass of the extractor toremoveMAndWWWFromUrlbecause 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.