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

[YouTube] Use correct order of clients to get Android streams first #841

Merged

Conversation

AudricV
Copy link
Member

@AudricV AudricV commented Apr 26, 2022

In #780 (comment), I didn't noticed when applying the requested change, that by using a HashMap, the order of streamingData JSON objects wanted will be not respected (because in a Map, values are not ordered). This PR fixes this unwanted change, by using an ArrayList instead of a HashMap.

Because we need to get at the same time the content playback nonce of a client and its corresponding streamingData JSON object and Lists can contain only type of an element, I copied the Pair class of #810 and used it in my fix.

To test the fix: get streams of a non age-restricted YouTube video (either audio or video), and check if most of streaming URLs contains &c=ANDROID, instead of &c=WEB.

… adding more parameters to InnerTube requests, using the iOS client for livestreams and more
@AudricV AudricV added bug youtube service, https://www.youtube.com/ labels Apr 26, 2022
Copy link
Member

@Stypox Stypox 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, thanks :-)
I tested and I can confirm it works as expected.

@Stypox Stypox changed the title [YouTube] Fix regression introduced in the order of clients used to get streams [YouTube] Use correct order of clients to get better streams first Apr 28, 2022
@Stypox Stypox merged commit 3f5c896 into TeamNewPipe:dev Apr 28, 2022
@AudricV AudricV deleted the yt-respect-order-of-clients-for-streams branch April 28, 2022 11:08
@AudricV AudricV changed the title [YouTube] Use correct order of clients to get better streams first [YouTube] Use correct order of clients to get Android streams first Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug youtube service, https://www.youtube.com/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants