ftde0 / yt2009

2009 youtube frontend.
Apache License 2.0
185 stars 116 forks source link

Custom API #55

Open TemaisgameNoobas opened 7 months ago

TemaisgameNoobas commented 7 months ago

Is there going to be an feature, where you can switch the website?? Like where you can switch to YouTube, and other websites that adapted yt2009 custom API. Like if I make my own clone, I will add the API that will work with yt2009.

ftde0 commented 7 months ago

i don't quite understand what you're talking about, do you mean an API for pulling stuff from yt2009? if so, while there isn't an official custom-format API for pulling data through yt2009, numerous official APIs were reimplemented over development to work with various parts of the website and apps.

1. gdata api

the gdata api is made to work with APKs but can be used if it fits your needs. responses are sent in XML. all requests are GET.

/feeds/api/videos?q=QUERY - search videos /feeds/api/videos/VIDEO_ID - get basic data about a video /feeds/api/videos/VIDEO_ID/related - exp_related for a video /feeds/api/videos/VIDEO_ID/comments - get comments for a video /feeds/api/users/USER_HANDLE - gets basic data for user by the youtube handle ("@") /feeds/api/users/USER_HANDLE/uploads - gets videos made by the user /feeds/api/users/USER_HANDLE/playlists - gets playlists made by the user /feeds/api/users/USER_HANDLE/favorites - gets favorited videos by the user

2. blazer api

blazer api is made to work with /mobile/blzr, but you may consider it as it returns JSON data. all requests are GET.

/mobile/blzr/watch?v=VIDEO_ID - gets basic data about a video /mobile/blzr/view_comments?v=VIDEO_ID - gets the video's comments /mobile/blzr/results?q=QUERY - search videos /mobile/blzr/profile?user=USER_HANDLE - gets basic data for user by the youtube handle ("@") /mobile/blzr/profile?user=USER_HANDLE&view=videos - gets the user's videos

3. console api

console api is used in XL and leanback. returns JSON data. all requests are GET.

/xl/console_browse - gets featured videos /xl/console_results?vq=QUERY - search videos /xl/console_related?video_id=VIDEO_ID - gets related vids for VIDEO_ID /xl/console_profile?user=USER_HANDLE - gets user's basic data by USER_HANDLE /xl/console_profile_videos?user=USER_HANDLE - gets user's videos

4. flash player

flash players typically request 2 endpoints, both of which are available within yt2009.

/get_video_info?video_id=VIDEO_ID - smallest video info, url-encoded /get_video?video_id=VIDEO_ID/mp4 - pulls an mp4 of the video requested

TemaisgameNoobas commented 7 months ago

@ftde0 oh I mean't like an API FOR yt2009 that would be adapted by the website owners. an yt2009 instance will make requests there and the website's API will return the data.

ftde0 commented 7 months ago

hi! sorry for the late response, as of now that doesn't feel like something immediately needed but more ways to manage yt2009 could help instance owners, something like this - while time consuming and would probably hook into a lot of the existing code - could be a feature and will probably be a thing in the future.

keeping open.

TemaisgameNoobas commented 7 months ago

ah okay, I was just wondering if I can start my own project with this functionality.

FurblandChannel commented 5 months ago

ah okay, I was just wondering if I can start my own project with this functionality.

You could always fork and create a pull request!