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 Music Support #6

Open
miraclx opened this issue Dec 18, 2020 · 11 comments
Open

YouTube Music Support #6

miraclx opened this issue Dec 18, 2020 · 11 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@miraclx
Copy link
Owner

miraclx commented Dec 18, 2020

There isn't any stable YouTube Music API for freyr to be based on. The best we can do right now is to extract data off it's web client and that is subject to frequent breaking changes. (As per #3: server response changed from under us).

Support for YouTube Music would have to wait for either an official API from Google or a library that's well maintained and kept up-to-date.

@vladdenisov
Copy link

vladdenisov commented Mar 22, 2022

Hey, just now first time got by your awesome tool! Feel free to open issues in my repo with missing/incorrectly working functionality, that you need to get YTMusic working in freyr-js. I'll do my best to fix them ASAP :)

@EthanBnntt
Copy link
Contributor

I'd love to try to make a node.js library for querying data from YouTube.

@miraclx
Copy link
Owner Author

miraclx commented Oct 14, 2022

@EthanBnntt, do you mean an API client like https://github.com/vladdenisov/ytmusic-api or a provider for freyr like https://github.com/miraclx/freyr-js/blob/master/src/services/spotify.js?

If the latter, the help would be much appreciated. I'd be happy to provide any useful insight on how to go about it.

@EthanBnntt
Copy link
Contributor

I meant a library for pulling frontend data from YouTube. It would probably just query Invidious instances, as they provide a public API. Something more like https://github.com/vladdenisov/ytmusic-api. YouTube Music is just an alternative frontend to YouTube that only includes music.

@miraclx
Copy link
Owner Author

miraclx commented Oct 15, 2022

Sounds to me like what you're talking about is off-topic for freyr. Or am I missing something?

@EthanBnntt
Copy link
Contributor

Yes, I was talking about making a library separate from freyr and integrating it into freyr.

@vladdenisov
Copy link

I've tried to make my library working without grabbing a cookie (search/track info), so I will soon try to integrate it into freyr-js.

@miraclx
Copy link
Owner Author

miraclx commented Oct 18, 2022

YouTube Music is just an alternative frontend to YouTube that only includes music.

@EthanBnntt, freyr is a music-downloading utility. Isn't YouTube Music all we need? Is there a benefit to supporting the full YouTube catalog?

@ghost
Copy link

ghost commented Oct 30, 2022

I haven't seen this documented anywhere but adding "?pbj=1" and appropriate headers to a YouTube (but not YouTube Music) URL returns JSON.


For Search:
curl --location --request GET 'https://www.youtube.com/search?q=laya&pbj=1' --header 'X-Youtube-Client-Version: 2.20221026.05.00' --header 'X-Youtube-Client-Name: 1'

For Video URL (kinda?):
curl --location --request GET 'https://www.youtube.com/watch?v=8foPUupIUi4&pbj=1' --header 'X-Youtube-Client-Version: 2.20221026.05.00' --header 'X-Youtube-Client-Name: 1'

@quartztester
Copy link

quartztester commented Aug 2, 2023

What's stopping this project from utilizing this other repo?
https://github.com/th-ch/youtube-music/tree/master/plugins/downloader

I am not that adept at Javascript but it would be interesting to know what method they are using to pull their YouTube video downloads. This seems to a project that could be combined with this repo due to their utilization of only HTML/CSS apart from JavaScript.

@miraclx
Copy link
Owner Author

miraclx commented Aug 7, 2023

@quartztester, it's the same strategy as freyr. Find the media ID, defer to youtube-dl to extract the feeds (freyr has a manual downloader, they may not), and encode with ffmpeg.

freyr does the extra step of embedding metadata with atomicparsley.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants