Package: ytmdl
YouTube Music DownloaderDownload songs from YouTube by getting the audio from YouTube and the metadata from sources like Itunes, Spotify, Gaana etc.[Web App] [Why This?] [Support the Project] [Installation] [Configuration] [WiKi]Web AppYtmdl also has an web app, you can try it outhereWhy this?This app downloads a song by getting the audio from Youtube sourcesusingyoutube-dl and then adds song information like
artist name, album name, release date, thumbnail etc by fetching it from sources like Itunes, Spotify, Gaana and other sources.NO. YoutubeDL doesn't do that. All youtube-dl does is lets you download audio from a video that you specify.This app is not yet another youtube-dl clone.Support the Project?Help the development of this project by becoming a backer or a sponsor.Become a BackerBecome a sponsorIf you like my work, consider buying me a coffee or donating. In case you want to become a patron, join myPateronRequirementsPython 3.6.1ffmpegInstallationPyPiArch LinuxGentooNixOSWindowsManualPyPIpip install ytmdlNOTE: System wide installation requiressudoArch Linuxytmdlis available in AUR asytmdl. It can be foundhereNOTE: The git version is availble asytmdl-gitin AUR.Gentooytmdlcan be installed in Gentoo by the following commands#Firstsetupsrc_prepare-overlay(asroot)emerge -av --noreplace app-eselect/eselect-repositoryeselect repository enable src_prepare-overlayemaint sync -r src_prepare-overlay#Finallyemergeytmdl(asroot)emerge -av --autounmask net-misc/ytmdlAvailable insrc_prepare-overlayhereNixOSytmdlcan be installed using Nix with the commandnix-env -iA nixos.ytmdlWindowsYou need to installffmpegin order forytmdlto work properly. This can be done by downloading theffmpegbinary fromhere. Once downloaded, extract the file and find theffmpeg.exefile. Copy the directory's path and add it to PATH in the following way.setx path "%path%;C:\your\path\here\"Onceffmpegis installed, installytmdlusing the following commandpip install ytmdl --upgradeNOTE: You'll need to have Python 3.6.1 or more installed.Optionally, also install the latest version ofdownloader-cliandsimberusing the following command:pip install simber downloader-cli --upgradeManualYou can manually installytmdlby cloning this repository and running thesetup.pyscript.Installsetuptoolsif it isn't already:pip install setuptoolsClone this repo:git clone https://github.com/deepjyoti30/ytmdlMove into theytmdldirectory and run thesetup.pyscript:cd ytmdlsudo python setup.py installUsageusage: ytmdl [-h] [-q] [-o OUTPUT_DIR] [--song SONG-METADATA][--choice CHOICE] [--artist ARTIST] [--album ALBUM][--disable-metaadd] [--skip-meta] [-m] [--itunes-id ITUNES_ID][--spotify-id SPOTIFY_ID] [--disable-sort] [--ask-meta-name][--on-meta-error ON_META_ERROR] [--proxy URL] [--url URL][--list PATH TO LIST] [--nolocal] [--format FORMAT] [--trim][--version] [--keep-chapter-name] [--download-archive FILE][--ignore-chapters] [--ytdl-config PATH] [--dont-transcode][--filename NAME] [--pl-start NUMBER] [--pl-end NUMBER][--pl-items ITEM_SPEC] [--ignore-errors] [--title-as-name][--level LEVEL] [--disable-file] [--list-level][SONG_NAME ...]positional arguments:SONG_NAME             Name of the song to download. Can be an URL to aplaylist as well. It will be automatically recognized.optional arguments:-h, --help            show this help message and exit-q, --quiet           Don't ask the user to select songs if more than onesearch result. The first result in each case will beconsidered.-o OUTPUT_DIR, --output-dir OUTPUT_DIRThe location for the song to be downloaded to. When noargument is passed, the default locations of SONG_DIRor XDG_MUSIC_DIR are used.--proxy URL           Use the specified HTTP/HTTPS/SOCKS proxy. To enableSOCKS proxy, specify a proper scheme. For examplesocks5://127.0.0.1:1080/. Pass in an empty string(--proxy "") for direct connection--url URL             Youtube song link.--list PATH TO LIST   Download list of songs. The list should have one songname in every line.--nolocal             Don't search locally for the song before downloading.--format FORMAT       The format in which the song should be downloaded.Default is mp3, but can be set in config. Availableoptions are ['mp3', 'm4a', 'opus']--trim, -t            Trim out the audio from the song. Use underlyingspeech and music segmentation engine to determine andkeep only the music in the file. Useful in songs wherethere are speeches, noise etc before/after the startof the song. Default is false.--version             show the program version number and exit--keep-chapter-name   Keep the title extracted from the chapter in order tosearch for the metadata. If not passed, the user willbe asked if they'd like to change the title with whichthe metadata will be searched.--download-archive FILESkip downloading songs that are present in the passedfile. The songs are matched by using the videoId. Alldownloaded song Id's are automatically added to thefile.--ignore-chapters     Ignore chapters if available in the video and treat itlike one video--ytdl-config PATH    Path to the youtube-dl config location or thedirectory--dont-transcode      Don't transcode the audio after downloading.Applicable for OPUS format only. (Default: false)--filename NAME       Final filename after the song is ready to be used.This will be given priority over automatic detectionunless dynamic filename path is set through configMetadata:--song SONG-METADATA  The song to search in Metadata. Particularly usefulfor songs that have the names in a different languagein YouTube. For Example, greek songs.--choice CHOICE       The choice that the user wants to go for. Usefull topass along with --quiet. Choices start at 1--artist ARTIST       The name of the song's artist. Pass it with a songname.--album ALBUM         The name of the song's album. Pass it with a songname.--disable-metaadd     Disable addition of passed artist and album keyword tothe youtube search in order to get a more accurateresult. (Default: false)--skip-meta           Skip setting the metadata and just copy the convertedsong to the destination directory. '--manual-meta'will override this option, pass only one of them.-m, --manual-meta     Manually enter song details.--itunes-id ITUNES_IDDirect lookup from itunes. If passed, metadata will beautomatically added.--spotify-id SPOTIFY_IDDirect lookup for Spotify tracks using the ID. Ifpassed, metadata will be automatically added.--disable-sort        Disable sorting of the metadata before asking forinput. Useful if the song is in some other languageand/or just a few providers are used.--ask-meta-name       Ask the user to enter a separate name for searchingthe metadata (Default: false)--on-meta-error ON_META_ERRORWhat to do if adding the metadata fails for somereason like lack of metadata or perhaps a networkissue. Options are ['exit', 'skip', 'manual','youtube']Playlist:--pl-start NUMBER     Playlist video to start at (default is 1)--pl-end NUMBER       Playlist video to end at (default is last)--pl-items ITEM_SPEC  Playlist video items to download. Specify indices ofthe videos present in the playlist separated by commaslike: '--playlist-items 1, 2, 4, 6' if you want todownload videos indexed 1, 2, 4 and 6. Range can alsobe passed like: '--playlist-items 1-3, 5-7' todownload the videos indexed at 1, 2, 3, 5, 6, 7.--ignore-errors       Ignore if downloading any video fails in a playlist.If passed, the execution will move to the next videoin the passed playlist.--title-as-name       Use the title of the video as the name of the song tosearch for metadata. If not passed, user will be askedif they want to use a different name and continueaccordingly.Logger:--level LEVEL         The level of the logger that will be used whileverbosing. Use `--list-level` to check availableoptions.--disable-file        Disable logging to files--list-level          List all the available logger levels.ConfigurationSetupThe defaults can be changed by editing the config file in ytmdl folder in your .config folderThe config will be created automatically the first time you runytmdland will be present in ~/.config/ytmdl/configHowever, it can be created manually by the following commandmkdir -p ~/.config/ytmdl; curl https://raw.githubusercontent.com/deepjyoti30/ytmdl/master/examples/config > ~/.config/ytmdl/configAbove command will download the config from the repo and save it in the~/.config/ytmdl/directory.Supported OptionsAs of the latest development branch, the following options can be changed from the configNameDescriptionDefaultSONG_DIRDirectory to save the songs in after editingCurrent directorySONG_QUALITYQuality of the song320kbpsMETADATA_PROVIDERSWhich API providers to use for metadataall supported options are usedDEFAULT_FORMATDefault format of the songmp3ON_META_ERRORWhat to do if error occurs while writing metaexitITUNES_COUNTRYWhich region to use while searching from ItunesUSSPOTIFY_COUNTRYWhich market to use while searching from SpotifyUSAdvanced ConfigurationDynamically storing songsSONG_DIRfield also takes values that are extracted from the song being downloadedTheSONG_DIRfield needs to be passed some special values in order to achieve that. The string is scanned and when a$sign occurs, the special string will start and each directory can be separated by using an->sign.To save the song in the/dir/<album_name>/<artist_name>/<title>/<song_name>.mp3format, the following needs to be added in theSONG_DIRfield.SONG_DIR="/dir$Album->Artist->Title"Above will extract to the following directory structure when a song namedCradlesby artistSub Urbanfrom the albumCradles - Single|--dir
   |--Cradles - Single
      |--Sub Urban
         |--Cradles
            |--Cradles.mp3In order to pass the name with which the song should be saved, the last attribute can be passed between[].If theSONG_DIRfield is/dir$Album->[Artist]will extract to the following directory structure|--dir
   |--Cradles - Single
      |--Sub Urban.mp3Supported options for dynamic storingAs of the latest source, the following options can be passed to the special string in order to create dynamic directoriesNameArtistArtist Of the SongAlbumAlbum Of the SongTitleTitle Of the SongGenreGenre Of the SongTrackNumberTrackNumber Of the SongReleaseDateReleaseDate Of the Song