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

Add support for Google search redirect url #362

Merged
merged 3 commits into from
Oct 31, 2020

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Jun 27, 2020

This PR handles Google search redirect URLs such as https://www.google.it/url?sa=t&rct=j&q=&esrc=s&cd=&cad=rja&uact=8&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHu80uDzh8RY&source=video by extracting the url= parameter before anything else happens. For this reason originalUrls inside linkHandlers are then not really the full original url, but only the extracted parameter, which I think is a good behaviour (those links are redirects, so using the pointed-to url as the original one looks good imo). Also note that Google search redirect URLs will be opened in NewPipe only when manually shared to it, since I wouldn't consider a good idea adding the google domain to the manifest.

This PR also fixes baseUrl extraction from urls with custom intents like "vnd.youtube", thus allowing to remove some useless overrides of getUrl.

Fixes TeamNewPipe/NewPipe#3790
Test apk: app-debug.zip
@webber-naut please check if this suits you, thank you in advance ;-)

@TobiGr TobiGr added the youtube service, https://www.youtube.com/ label Jun 27, 2020
@Stypox Stypox added multiservice and removed youtube service, https://www.youtube.com/ labels Jun 27, 2020
@Stypox Stypox force-pushed the google-search-urls branch 3 times, most recently from d66a361 to d9a8786 Compare June 27, 2020 21:12
@Stypox
Copy link
Member Author

Stypox commented Jun 27, 2020

@wb9688 @XiangRongLin I fixed #277 (comment)
Note that the failure of youtube comments tests is not related to my changes, since it also happens on dev.

@Stypox
Copy link
Member Author

Stypox commented Jun 28, 2020

@XiangRongLin done, thank you

Copy link
Member

@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.

Looks good to me, but needs a rebase.

@Stypox
Copy link
Member Author

Stypox commented Oct 31, 2020

Done

@Stypox Stypox merged commit b242e1d into TeamNewPipe:dev Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsupported URL from Google Search results and/or Google video search
4 participants