Package: khtube
khtube is an opensource software library enables you to download YouTube videos easily at all available qualities along with subtitles and can also download your videos in audio format.InstallFor installation::pipinstallkhtube(For macOS)::pip3installkhtubeUsing khtube on WindowsIn windows, make sure that if you don't have ffmpeg pre-installed in your computer then do install it first before downloading any video.You can download ffmpeg in your system by runing our builtin python method which is written below:importkhtubekhtube.checkFFmpeg()In linux based systems, ffmpeg is already installed by default.Download your first YouTube videoimportkhtubekhtube.single_video(link,quality,verbose,output="./Videos/",verbose)Wherelinkis string containing YouTube's video URL.qualityis by default best. But  you can change it by passing the available quality in integer value. Tou find the all available formats of any YouTube video along with their quality extensions. Usekhtube.available_quality(link), wherelinkis again the string containing YouTube's url. It will print the available qualities of any video.verboseis being used to express details in more words. It can be1,2or3depending upon your needs.outputis the saving directory of your downloaded YouTube video. If you don't pass it it will save in your default location.Download the videos of Entire Playlist of YouTubekhtube.video_playlist(link,min_views=1,quality=248,start_index=1,verbose,best=True,output="./Videos/")Wherelinkis string containing YouTube's Playlist URL.min_viewsis the filtration of views. By default it is 1. So if there's any video with NO VIEWS, it will not be downloaded. However you can change it accordingly.qualityis by default best. But  you can change it by passing the available quality in integer value. Tou find the all available formats of any YouTube video along with their quality extensions. Usekhtube.available_quality(link), wherelinkis again the string containing YouTube's url. It will print the available qualities of any video.start_indexis the Starting index of a video in playlist. For example, if you pass 4 and there are only 10 videos, only 7 will be downloaded. Given that, 0 is not inclusive.verboseis being used to express details in more words. It can be1,2or3depending upon your needs.outputis the saving directory of your downloaded YouTube video. If you don't pass it it will save in your default location.Download the videos of Entire Channel on YouTubekhtube.video_playlist(link,min_views=1,quality=248,start_index=1,verbose,best=True,output="./Videos/")Wherelinkis string containing YouTube's Channel URL.min_viewsis the filtration of views. By default it is 1. So if there's any video with NO VIEWS, it will not be downloaded. However you can change it accordingly.qualityis by default best. But  you can change it by passing the available quality in integer value. Tou find the all available formats of any YouTube video along with their quality extensions. Usekhtube.available_quality(link), wherelinkis again the string containing YouTube's url. It will print the available qualities of any video.start_indexis the Starting index of a video in channel. For example, if you pass 4 and there are only 10 videos, only 7 will be downloaded. Given that, 0 is not inclusive.verboseis being used to express details in more words. It can be1,2or3depending upon your needs.outputis the saving directory of your downloaded YouTube video. If you don't pass it it will save in your default location.Download Subtitles of any Videokhtube.download_sub(link,language="en-US")Wherelinkis string containing YouTube's Video URL.languageis the parameter in string for language format. A video can have multiple subtitles. By default it will download inEnglish US. But you can always change that upon your needs. To find out the available subtitles, usekhtube.available_sub(link), wherelinkis again the string containing YouTube's url. It will print the available subtitle languages of any video with codes.Download AudioOnly of any Videokhtube.only_music(link,quality=251,verbose=2)Wherelinkis string containing YouTube's Video URL.qualityis by default best. But  you can change it by passing the available quality in integer value. Tou find all the available formats of any YouTube video along with their quality extensions. Usekhtube.available_quality(link), wherelinkis again the string containing YouTube's url. It will print the available qualities of any video.Caution: Be careful, only use audio quality codeor else you can leave it by default.verboseis being used to express details in more words. It can be1,2or3depending upon your needs.Download the AudioOnly of videos of Entire Playlist of YouTubekhtube.audio_playlist(link,min_views=1,quality=248,start_index=1,verbose=2,best=True,output="./Videos/")Wherelinkis string containing YouTube's Playlist URL.min_viewsis the filtration of views. By default it is 1. So if there's any video with NO VIEWS, it will not be downloaded. However you can change it accordingly.qualityis by default best. But  you can change it by passing the available quality in integer value. Tou find all the available formats of any YouTube video along with their quality extensions. Usekhtube.available_quality(link), wherelinkis again the string containing YouTube's url. It will print the available qualities of any video.Caution: Be careful, only use audio quality codeor else you can leave it by default.start_indexis the Starting index of a video in playlist. For example, if you pass 4 and there are only 10 videos, only 7 will be downloaded. Given that, 0 is not inclusive.verboseis being used to express details in more words. It can be1,2or3depending upon your needs.outputis the saving directory of your downloaded YouTube video. If you don't pass it it will save in your default location.Download the AudioOnly of videos of Entire Channel of YouTubekhtube.channel_audio(link,min_views=1,quality=248,start_index=1,verbose=2,best=True,output="./Videos/")Wherelinkis string containing YouTube's Channel URL.min_viewsis the filtration of views. By default it is 1. So if there's any video with NO VIEWS, it will not be downloaded. However you can change it accordingly.qualityis by default best. But  you can change it by passing the available quality in integer value. Tou find all the available formats of any YouTube video along with their quality extensions. Usekhtube.available_quality(link), wherelinkis again the string containing YouTube's url. It will print the available qualities of any video.Caution: Be careful, only use audio quality codeor else you can leave it by default.start_indexis the Starting index of a video in channel. For example, if you pass 4 and there are only 10 videos, only 7 will be downloaded. Given that, 0 is not inclusive.verboseis being used to express details in more words. It can be1,2or3depending upon your needs.outputis the saving directory of your downloaded YouTube video. If you don't pass it it will save in your default location.ContributeYou've discovered a bug or something else you want to change - excellent!You've worked out a way to fix it – even better!You want to tell us about it – best of all!Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.ContactSend your message at this formhttps://forms.gle/eoxmiRzLiKJLSvTF7, We will review it shortly.DevelopersKodershub Developers ©https://kodershub.techLicenseMIT