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

[Question?] How can I get download link video like yt-dlp, youtube-dl ? #39

Closed cuongtv51 closed 1 year ago

tombulled commented 2 years ago

Hi @cuongtv51, this is very easy to do using innertube! As I expect this is a common task users would like to know how to do, I'll create an examples/ directory with a code sample for this in it.

tombulled commented 2 years ago

I've added a list-streams-for-video.py example here - https://github.com/tombulled/innertube/blob/main/examples/list-streams-for-video.py

Hopefully this helps! Importantly, you'll likely need to splice an audio and video stream together, for example using a tool such as ffmpeg

cuongtv51 commented 2 years ago

Hi @tombulled , thanks your support, but when i try to use another client_name like WEB, with some vevo video, the link can't play, it mean need decode signature that can get direct link to play. But in your example, client_name IOS i see this link can be play direct.

tombulled commented 2 years ago

Yep, you're exactly right. The clients behave slightly differently. Clients for the mobile apps (e.g. IOS and ANDROID) return streamable URLs if I remember correctly, whereas the web clients (e.g. WEB) return encoded ones

tombulled commented 1 year ago

I'm going to close this issue for now. Let me know if you have any further questions and I'll do my best to answer them :slightly_smiling_face: