Skip to content

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 Issues related to multiple services 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 Stypox force-pushed the google-search-urls branch from d9a8786 to 7ed38b7 Compare June 27, 2020 21:30
@Stypox
Copy link
Member Author

Stypox commented Jun 28, 2020

@XiangRongLin done, thank you

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.

Looks good to me, but needs a rebase.

@Stypox Stypox force-pushed the google-search-urls branch from 495f219 to 9e53cf0 Compare October 31, 2020 19:59
@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

Labels

multiservice Issues related to multiple services

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