Package: make-playlist
make_playlist: Playlist makermkplis acommand line toolto create playlist files (M3Uformat).InstallationTo installmkpl, see here:$pipinstallmake_playlist# for python enviroment$dnfcoprenablematteoguadrini/mkpl$dnfinstallpython-make_playlist-y# for Red Hat and fedora$gitclonehttps://github.com/MatteoGuadrini/mkpl.git&&cdmkpl$pipinstall.# for othersCommand argumentsmkplhave many command line arguments. They are explained in this table:shortlongdescriptionargs-d--directoriesDirectories that contains multimedia filePath of directories-e--exclude-dirsExclude directory pathsPath of directories-i--includeInclude other file formatFormat of file. ex. mp3-p--patternRegular expression inclusion patternRegular expression string-f--formatSelect only a file formatFormat of file. ex. mp3-s--sizeStart size in bytesBytes number-m--max-tracksMaximum number of tracksNumber-t--titlePlaylist titleTitle string-g--encodingText encodingUTF-8,ASCII,UNICODE-I--imagePlaylist imageImage path-l--linkAdd local or remote filesFiles-j--joinJoin one or more other playlist filesPlaylist files-r--recursiveRecursive search-a--absoluteAbsolute file name-s--shuffleCasual order-u--uniqueThe same files are not placed in the playlist-c--appendContinue playlist instead of override it-w--windowsWindows style folder separator-v--verboseEnable verbosity (debug mode)-S--splitSplit playlist by directories-o--orderby-nameOrder playlist files by name-O--orderby-dateOrder playlist files by creation date-T--orderby-trackOrder playlist files by track-y--orderby-yearOrder playlist files by yearExamplesCreate a playlist for one music album:cdmyalbum
mkplmyalbum.m3uCreate a playlist of a film sagamkpl-dHarryPotter-fmkvHP_saga.m3uCreate a shuffled playlist with my music collectionmkpl-d"my_mp3_collection""my_mp4_collection"-rs"my music.m3u"Create a shuffled playlist with my music collection and exclude dirsmkpl-d"my_mp3_collection""my_mp4_collection"-r-s-e"my_mp3_collection/metallica""my_mp3_collection/dk""my music.m3u"Create a TV series playlist with max 15 tracksmkpl-d"my_series/GOT"-m15"got_first_15.m3u"Add intomy musicplaylist new songs and don't add same filemkpl-d"new_collection"-rsu"my music.m3u"-aCreate playlist with music and video files if files is greater then 10MBmkpl-d"my_files"-r-z10485760"multimedia.m3u"Create playlist with only number one and two tracks with regular expressionmkpl-d"my_mp3_collection"-r-p"^[12]|[012]{2}""my music.m3u"Create a playlist for one music album and set the title:cdmyalbum
mkplmyalbum.m3u-t"My Album"Create a playlist and addUTF-8encodingmkpl-d"new_collection"-r"my music.m3u"-g"UTF-8"Create a playlist and set imagemkpl-d"new_collection"-r"my music.m3u"-I"new_collection/playlist_cover.jpg"Create a playlist and add remote file linksmkpl-d"new_collection"-r"my music.m3u"-lhttp://192.168.1.123/mp3/song1.mp3,http://192.168.1.123/mp3/song2.mp4Create a playlist and set Windows backslash (\) folder separator (for Windows OS)mkpl-d"new_collection"-r"my music.m3u"-wSplit playlist intoNplaylists fonNdirectoriesmkpl-d"folder1""folder2""folder3"-r"my_music.m3u"-SResult:$>lsmy_music.m3ufolder1.m3ufolder2.m3ufolder3.m3u...Sort playlist files by name (-o), by creation date (-O), by track number (-T) or by year (-y):mkpl-d"new_collection"-r"my music.m3u"-o
mkpl-d"new_collection"-r"my music.m3u"-O
mkpl-d"new_collection"-r"my music.m3u"-T
mkpl-d"new_collection"-r"my music.m3u"-yJoin the"First playlist.m3u"and"Second playlist.m3u8"with new"Third playlist.m3u":mkpl-d"new_collection"-r"Third playlist"-j"First playlist.m3u""Second playlist.m3u8"Use it like Python modulemkplcan also be used as a Python module to customize your scripts.frommake_playlistimport*# Prepare playlist list: find multimedia files with name starts between a and fplaylist=make_playlist('/Music/collections',('mp3','mp4','aac'),'^[a-f].*',recursive=True,unique=True)# Write playlist to filewrite_playlist('/Music/AtoF.m3u','wt',playlist)Open sourcemkplis an open source project. Any contribute, It's welcome.A great thanks.For donations, press thisFor meForTelethonThe Telethon Foundation is a non-profit organization recognized by the Ministry of University and Scientific and Technological Research.
They were born in 1990 to respond to the appeal of patients suffering from rare diseases.
Come today, we are organized to dare to listen to them and answers, every day of the year.Adopt the futureTreewareThis package isTreeware. If you use it in production,
then we ask that youbuy the world a treeto thank us for our work.
By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.AcknowledgmentsThanks to Mark Lutz for writing theLearning PythonandProgramming Pythonbooks that make up my python foundation.Thanks to Kenneth Reitz and Tanya Schlusser for writing theThe Hitchhiker’s Guide to Pythonbooks.Thanks to Dane Hillard for writing thePractices of the Python Probooks.Special thanks go to my wife, who understood the hours of absence for this development.
Thanks to my children, for the daily inspiration they give me and to make me realize, that life must be simple.Thanks, Python!