- FFmpeg Installation:
-
Download FFmpeg:
- Visit the FFmpeg download page.
- Navigate to the Windows builds from gyan.dev.
- Download the
ffmpeg-git-full.7zfile.
-
Extract the Files:
- Extract the downloaded
ffmpeg-git-full.7zfile. - Name the folder
ffmpeg. - Move the extracted folder to
C:\. (WINRAR may be required)
- Extract the downloaded
-
Restart Your Computer:
- Restart your computer to ensure all changes take effect.
-
Add FFmpeg to System Path:
- Open Advanced System Settings.
- Click on the Environment Variables button.
- In the System variables section, find the
Pathvariable and click Edit. - Click New and add the path to the
binfolder of your FFmpeg installation (e.g.,C:\ffmpeg\bin). - Click OK to close all windows.
-
Python Package Installation:
pip install yt_dlp
pip install pygame
pip install asyncio- Cookies Export:
- Install the Get cookies.txt extension.
- Go to YouTube and export the cookies.
- Save the exported cookies to a file named
cookies.txt.
-
Initialize the Player:
- The player uses the
pygamelibrary to handle audio playback.
- The player uses the
-
Directory Structure:
- Ensure the following directories exist and contain your .mp3 files:
./assets/oldies./assets/democrazy./assets/heavy./assets/downloads
- Ensure the following directories exist and contain your .mp3 files:
-
Running the Player:
- Execute the
main.pyfile to start the player. - The player will scan the directories and create playlists.
- Execute the
-
Player Controls:
- Press 'p' to pause
- Press 'r' to resume
- Press '-' to lower volume
- Press '+' to raise volume
- Press 'c' to change playlist
- Press 'n' to skip to the next song
- Press 'b' to go back to the previous song
- Press 's' to shuffle the playlist
- Press 'e' to exit the program
- Press 'd' to download music from YouTube
The main code file (main.py) initializes the player, scans the directories for music files, and provides functions to manage playlists and control playback.
The youtube_downloader.py script contains functions to download audio from YouTube and search for videos based on user input. It uses yt_dlp for downloading and extracting audio, and asyncio for asynchronous I/O operations.