tombulled / innertube

Python Client for Google's Private InnerTube API. Works with YouTube, YouTube Music and more!
https://pypi.org/project/innertube/
MIT License
298 stars 20 forks source link

:sparkles: Add Method to Request a Video's Transcript #41

Closed SulimanLab closed 1 year ago

SulimanLab commented 2 years ago

this PR add an API to get the video's transcript with examples

tombulled commented 1 year ago

Hi @SulimanLab, thanks for opening this PR these changes look really good!

tombulled commented 1 year ago

Interestingly (from some very basic testing), the get_transcript endpoint only appears to work for YouTube clients.

These are the clients I tested: Service Client Success Description
YouTube WEB Yes JSON Response
YouTube Music WEB_REMIX No 400 Bad Request: Precondition check failed.
YouTube Kids WEB_KIDS No 400 Bad Request: Precondition check failed.
YouTube Studio WEB_CREATOR No 400 Bad Request: Precondition check failed.
BRUHItsABunny commented 1 year ago

Does the output from this API call differ from YT's timedtext API? image

tombulled commented 1 year ago

@BRUHItsABunny they look very similar from what I can tell, very interesting find!

tombulled commented 1 year ago

@SulimanLab Once again, thanks for opening this PR. Unfortunately as the comments have not been addressed, I'm going to go ahead and close this PR. I'll open a separate one with the necessary changes made :slightly_smiling_face:

BRUHItsABunny commented 1 year ago

Yea I was just wondering since I currently rely on the timed text api to download video subs/captions

tombulled commented 1 year ago

I'll get a new version of innertube released today with the get_transcript method implemented, so hopefully might come in handy

tombulled commented 1 year ago

innertube v2.1.3 released as of #43