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

Refactor and improvements #19

Merged
merged 1 commit into from
Aug 6, 2017

Conversation

mauriciocolli
Copy link
Contributor

  • Change ServiceList into an enum
  • Rename and create new overloads for methods of Info classes
    • This creates a nicer api, for example, to get a StreamInfo:
    StreamInfo.getInfo(Youtube, "https://www.youtube.com/watch?v=BAcaa98qQtM"); 
    // Or simply pass the url, it resolves to the right service
    StreamInfo.getInfo("https://soundcloud.com/shupemoosic/pegboard-nerds-try-this"); 
  • Improve SoundCloud service
    • Reduce the number and size of some downloads (e.g. getting the url id now downloads a lighter page (3KB vs 20-30KB before) and remove the need of knowing the client_id to get it)

@mauriciocolli mauriciocolli merged commit cfc2b9b into TeamNewPipe:master Aug 6, 2017
@ghost
Copy link

ghost commented Aug 7, 2017 via email

@theScrabi
Copy link
Member

theScrabi commented Aug 7, 2017

Well if we have disadvantages through the soundCloud api someone would have to write a parser for the soundcloud website. But in general, what newpipe does depends on the implementation of the service. So there you can do whatever you want.

@mauriciocolli
Copy link
Contributor Author

I used what is easier to work with, the api-v2 sometimes have weirder results than the other one, but I don't see why not as they are using it in their own website.

And if that's the reason, why don't we just parse the html that they send in the first place? It comes with the same result of calling the api-v2 (embed in a script tag).

Regarding the embed player, it's because is much lighter and you don't need to get a clientId to resolve urls (as we don't have a good way to get the clientId without downloading a big file), and for comparison, we use the embed player of YouTube sometimes to parse too.

@theScrabi
Copy link
Member

theScrabi commented Aug 7, 2017

we use the embed player of YouTube sometimes to parse too

That's right.

But just to know, what is the embedded player of soundcloud doing within the soundcloud service?

@mauriciocolli
Copy link
Contributor Author

mauriciocolli commented Aug 7, 2017

It's used for getting the id and the url from the id, I think it's hard to get it by hand (unlike Youtube that have a more predictable url, or the id that there's no way to get it from the url) so we were just downloading the page and getting the url/id from it.

The reason because I used embed player for that I already said previously:

... it's because is much lighter and you don't need to get a clientId to resolve urls (as we don't have a good way to get the clientId without downloading a big file)...

@theScrabi
Copy link
Member

All right I see.

@mauriciocolli mauriciocolli deleted the refactor branch January 13, 2018 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants