Package: ytws
YTWS: YouTube Download and Faster-Whisper Subtitle Generation Tool 🔥YTWS, is a simple tool that downloads YouTube videos and creates subtitles quickly. It usesyt-dlpfor downloading andfaster-whisperfor transcribing, making it easy and efficient to use.Essentially, YTWS is auser-friendlywrapper integrating yt-dlp and faster-whisper, simplifying the user experience.YTWS is short for YouTube Whisper.⭐ FeaturesEasy to Use: Start without any hassle.Fast Subtitle Generation: Harness the speed offaster-whisper.GPU Acceleration: A simple guide for harnessing GPU power.🪄 FunctionalDownloading and Transcribing YouTube Videos/AudiosOnly Downloading YouTube Videos/AudiosOnly Transcribing Videos/Audios⚙ RequirementsffmpegFor Ubuntu:sudoaptinstallffmpegFor Python virtual environment (recommended):condainstallffmpegFor Windows scoop users:scoopinstallffmpegInstallationInstall YTWS easily with these commands:pipinstallytwsorpipinstallgit+https://github.com/faker2048/youtube-whisper.git🚀 UsageDownloading and Transcribing YouTube Videos/AudiosTo download and transcribe a video, simply run:❯ytwsdt--help
Usage:ytwsdt[OPTIONS]Downloadvideo/audiofromYoutubeandgeneratesubtitles.

Options:-u,--urlTEXTYoutubeURL.[required]-n,--threadsINTEGERNumberofthreadstouse.-f,--formatTEXTDownloadformat.See:https://github.com/yt-dlp/yt-dlp#format-selection-examples-t,--translateTranslatethesubtitlestoEnglish.-m,--model_nameTEXTNameofthemodeltouse.e.g.(tiny,tiny.en,base,base.en,small,small.en,medium,medium.en,large-v1,orlarge-v2,orlarge-v3),recommended:(large-v3)-r,--model_rootTEXTRootdirectoryforthemodels.--cpuUseCPUinsteadofGPU.ThisisusefulifyoudonothaveaGPU.-s,--srt_onlyOnlygeneratesubtitles.Donotdownloadvideo.-v,--video_onlyOnlydownloadvideo.Donotgeneratesubtitles.--helpShowthismessageandexit.Example:ytwsdt-u"https://www.youtube.com/watch?v=XXXXXXXX"-mlarge-v3# Download and transcribe the videoytwsdt-u"https://www.youtube.com/watch?v=XXXXXXXX"-f"bestvideo+bestaudio/best"After running the command, the media file and the generated subtitles will be saved in the same directory as the video file.Only Downloading YouTube Videos/AudiosTo download a video, simply run:❯ytwsd--help
Usage:ytwsd[OPTIONS]Downloadavideo/audiofromYouTube.

Options:-u,--urlTEXTTheURLoftheYouTubevideoorthefilenametobedownloaded.[required]-n,--threadsINTEGERThenumberofthreadstousefordownloading.Defaultis16.-f,--formatTEXTThedownloadformat.Optionsinclude:'worstaudio[tbr>100]/bestaudio/best'foraudioonly,'bestvideo[height>=1080]/bestvideo'forvideoonly,'bestvideo+bestaudio/best'forbothvideoandaudio(default).Use'best'forthebestqualityorspecifyparticularformats.--helpShowthismessageandexit.Only Transcribing Videos/AudiosTo transcribe a video, simply run:❯ytwst--help
Usage:ytwst[OPTIONS]Transcribeavideo/audiofile.

Options:-f,--fileTEXTThemediafiletobetranscribed.[required]-t,--translateTranslatethesubtitlestoEnglish.-m,--model_nameTEXTNameofthemodeltouse.e.g.(tiny,tiny.en,base,base.en,small,small.en,medium,medium.en,large-v1,orlarge-v2),recommended:(large-v2)-r,--model_rootTEXTRootdirectoryforthemodels.--cpuUseCPUinsteadofGPU.ThisisusefulifyoudonothaveaGPU.--helpShowthismessageandexit.Example:ytwst-f"video.mp4"-mlarge-v3After running the command, the generated subtitles will be saved in the same directory as the video file.🛫 GPU AccelerationFor easy CUDA and cuDNN installation:Linux:condainstallcudnnWindows:Although using additional torch libraries may not be ideal, it's a straightforward approach for Windows (compared to Nvidia's official CUDA installation). Any alternative methods or suggestions are welcome!pip3installtorch--index-urlhttps://download.pytorch.org/whl/cu118After these settings, YTWS should work with a GPU.🪄 Available ModelsVisitherefor more details.🌟 Contributing to YTWSWe welcome contributions to YTWS! Your support makes a difference.How to ContributeFork, Clone, Branch: Start by forking and cloning the repository, then work in separate branches.Commit: Follow the project standards and commit your changes.Pull Request: Submit a concise pull request (PR) to the main branch.Using Pre-CommitTo maintain code format:pipinstallpre-commit
pre-commitinstallPre-commit will guide you through necessary checks and corrections. Feel free to reach out if you have any questions or suggestions!