It also inherits the default title from YouTube.īut you can specify a download directory for your video and change the file name: video = YouTube(URL) The video, however, downloads to your current working directory in this case. Video_streams = (file_extension ='mp4').get_by_itag( 22) Now here's how to download a video at 720p resolution: video = YouTube(URL) Video_streams = (file_extension='mp4').get_by_itag( 22) To check the title of a video: video = YouTube(URL) All you need is the itag value for your preferred resolution, which is always available when your print the streams for any video. You can also increase the resolution to 1080p or any other available one if you want. You can try the itag value for 360p to get a lower resolution. The resolution of the above stream is 720p ( res="720p"). You can call a stream using this itag value by including the get_by_itag() function: video_streams = (file_extension='mp4').get_by_itag( 22) For instance, res="720" has itag="22", while the itag at 360p resolution is 18.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |