Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SoundCloud] Use a lightweight request to check if the hardcoded client_id is valid, fix the extraction of mobile URLs and more #627

Merged
merged 5 commits into from
May 23, 2021

Conversation

AudricV
Copy link
Member

@AudricV AudricV commented May 15, 2021

  • 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 to https://api-v2.soundcloud.com/?client_id=HARDCODED_CLIENT_ID. If the response code is 404, the hardcoded client_id is valid; if the response code is 401 (and maybe other error codes), it isn't.

  • Rename removeWWWFromUrl method of the Utils class of the extractor to removeMAndWWWFromUrl because it now also removes the m. 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.

@AudricV AudricV added bug Issue is related to a bug enhancement New feature or request soundcloud service, https://soundcloud.com/ labels May 15, 2021
@AudricV AudricV requested a review from TobiGr May 15, 2021 18:55
AudricV added 4 commits May 23, 2021 18:08
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.
@AudricV AudricV force-pushed the use-snd-api-v2-everywhere branch from 4815ccf to 6b607eb Compare May 23, 2021 16:11
Copy link
Contributor

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…dcloudParsingHelper.resolveFor method

Co-authored-by: Tobi <[email protected]>
@TobiGr TobiGr merged commit ff00512 into TeamNewPipe:dev May 23, 2021
@AudricV AudricV deleted the use-snd-api-v2-everywhere branch July 4, 2021 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug enhancement New feature or request soundcloud service, https://soundcloud.com/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Newpipe doesn't recognize SoundCloud mobile website links
2 participants