FAQ  •  Register  •  Login

Custom Random Playlists

<<

cybersaga

Serviio newbie

Posts: 7

Joined: Wed Jul 06, 2016 3:55 am

Post Wed Jul 06, 2016 4:11 am

Custom Random Playlists

I thought I'd share something I setup. I wanted random video playlists, which isn't supported out of the box in Serviio right now. So I setup something to do it for me. This will work for audio too.

I ended up writing a pretty basic program (Windows-only, .NET 4 required) to read all the files in a folder and put them all in random order into an m3u playlist file. Then I setup a scheduled task in Windows to run that every hour.

For anyone else wanting to set this up, I put the little program on GitHub. The exe can be downloaded here: https://github.com/gabeluci/Random-Play ... ses/latest

In its simplest form, you run this:
  Code:
Random.Playlist.exe [folder with files]


So for example, in my case I run (Yes, this is mainly for the kids):
  Code:
Random.Playlist.exe "K:\Video\Baby Einstein"


That creates the file "K:\Video\Baby Einstein\Random Baby Einstein.m3u" with all the media files inside that folder listed. It will only include audio OR video files, but not both.

There are more options. For example, you can include several folders and search all subfolders. Here are all the options:
  Code:
Random.Playlist.exe [-d folder1 folder2] [-p playlistName] [-r] [-t audio|video]
                    [-m maxLength] [-x types] [-i types] [-h]

  -d    A list of folders to include, separated by spaces.
        If this is not included, the current folder is used.
  -p    The name of the playlist file. If not specified,
        the playlist will be named after the first folder being searched,
        preceded by the word Random. e.g. Random Music.m3u
  -r    Recurse subfolders.
  -t    Specify whether to look for audio or video files. If not specified,
        the first file found will determine if it looks for audio or video
        files. e.g. If it comes across an audio file first, then only audio
        files will be included.
  -m    Limit the playlist to this many files.
  -x    A list of file extensions to exclude, separated by semicolons.
        e.g. -x m4a;wav
  -i    A list of file extensions to include, separated by semicolons.
        All other files will be ignored. e.g. -i mp3;m4a
  -h    Show this help screen


Set that up as a scheduled task in Windows to run, say, every hour, and Serviio will pick up the changes when they happen.

If you want to create multiple playlists, it's simpler to create a batch file and list each one:
  Code:
Random.Playlist.exe "K:\Video\Baby Einstein"
Random.Playlist.exe "K:\Video\Signing TIme"
Random.Playlist.exe "K:\Video\Octonauts"


Then set up the scheduled task to run that batch file.

I hope this helps someone! I tried a *ton* of different DLNA server software, and Serviio fit my needs the best. This was the only feature I wanted that Serviio didn't have.
Last edited by cybersaga on Mon Jul 25, 2016 1:25 pm, edited 3 times in total.
<<

jhb50

DLNA master

Posts: 2843

Joined: Thu Jun 30, 2011 9:32 pm

Post Wed Jul 06, 2016 1:46 pm

Re: Random Video Playlists

Great Idea. You should repost this in the 3rd Party Tools Integration section as a [TOOL], or send zip a note and ask him to move it, so it does not get lost in this support section. I'm thinking this could also be used for music and image playlists and would be very popular for random songs and random slideshows.
<<

cybersaga

Serviio newbie

Posts: 7

Joined: Wed Jul 06, 2016 3:55 am

Post Wed Jul 06, 2016 2:25 pm

Re: Random Video Playlists

Thanks, I sent him a note. I didn't notice that forum when I posted. Maybe I just didn't scroll down far enough :)

I'm thinking of developing this further into a general purpose command line playlist generator. I had done some searching, and I couldn't find any out there. There were several playlist generators with GUI's but nothing command line that I could setup as a scheduled task.

Right now it just dumps the file names into the m3u file, but later I might add the extended information (the "EXTM3U" and "EXTINF" lines). Serviio doesn't seem to care, but other programs might.
<<

cybersaga

Serviio newbie

Posts: 7

Joined: Wed Jul 06, 2016 3:55 am

Post Fri Jul 08, 2016 2:25 am

Re: Random Video Playlists

Turns out that it does work great with music files, and it's a good workaround for an existing problem between Serviio and Sony devices. See here: viewtopic.php?f=11&t=22190
<<

Tedward

Serviio newbie

Posts: 3

Joined: Wed Dec 21, 2016 10:54 pm

Location: Los Angeles, CA, USA

Post Wed Dec 21, 2016 10:55 pm

Re: Custom Random Playlists

Thanks! I have been looking for a way to do this, it works perfectly! :D
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Fri Dec 23, 2016 3:23 pm

Re: Custom Random Playlists

Agree, nice app that works perfectly. I've come across it just in time to randomise about a gig's worth of Christmas carols/songs ready to drive the family crazy :lol:
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

cybersaga

Serviio newbie

Posts: 7

Joined: Wed Jul 06, 2016 3:55 am

Post Fri Dec 23, 2016 3:31 pm

Re: Custom Random Playlists

My condolences to your family. :)
<<

utaaanaga

Serviio newbie

Posts: 6

Joined: Wed Nov 08, 2017 9:38 pm

Post Thu Nov 09, 2017 12:28 am

Re: Custom Random Playlists

You can use this on linux

  Code:
cd /media/Music/
find . -type f  -name "*.mp3" -o -name "*.ogg"  -name "*.flac" -o -name "*.wav" -name "*.m4a" |sort -R |head -n 100 > /media/Music/random.m3u
<<

corysmith

Serviio newbie

Posts: 1

Joined: Sat Mar 16, 2019 11:23 am

Post Sat Mar 16, 2019 11:28 am

Re: Custom Random Playlists

cybersaga wrote:I thought I'd share something I setup. I wanted random video playlists, which isn't supported out of the box in Serviio right now. So I setup something to do it for me. This will work for audio too.

I ended up writing a pretty basic program (Windows-only, .NET 4 required) to read all the files in a folder and put them all in random order into an m3u playlist file. Then I setup a scheduled task in Windows to run that every hour.

For anyone else wanting to set this up, I put the little program on GitHub. The exe can be downloaded here: https://github.com/gabeluci/Random-Playlist-Generator/releases/latest/cheapessay


There is likewise setting menu for Recycle Bin. I don't have the foggiest idea how to expel it from that point.

You can't include envelope with spaces from right snap. (Be that as it may, your principle envelope could have spaces, won't be an issue.)
<<

cybersaga

Serviio newbie

Posts: 7

Joined: Wed Jul 06, 2016 3:55 am

Post Sat Mar 16, 2019 7:10 pm

Re: Custom Random Playlists

corysmith wrote:You can't include envelope with spaces from right snap. (Be that as it may, your principle envelope could have spaces, won't be an issue.)


I'm not sure I understand what you are saying. Do you mean that the folder names have spaces in them? If so, put the folder names in quotes:

Random.Playlist.exe -d "C:\Folder One" "C:\Folder Two"
<<

AlikRuids

Serviio newbie

Posts: 1

Joined: Sat Nov 02, 2019 11:49 pm

Location: Россия

Post Mon Nov 11, 2019 6:35 pm

Custom Random Playlists

At me a similar situation. Is ready to help.
<<

Gregorius

Serviio newbie

Posts: 10

Joined: Mon Jun 17, 2013 6:37 pm

Post Thu Jan 14, 2021 2:15 pm

Re: Custom Random Playlists

Exactly the feature I wanted to have in Serviio for years now. Does anybody have a solution for this?

I just found this here:
https://github.com/gabeluci/Random-Playlist-Generator
<<

cybersaga

Serviio newbie

Posts: 7

Joined: Wed Jul 06, 2016 3:55 am

Post Thu Jan 14, 2021 5:09 pm

Re: Custom Random Playlists

Gregorius wrote:Exactly the feature I wanted to have in Serviio for years now. Does anybody have a solution for this?

I just found this here:
https://github.com/gabeluci/Random-Playlist-Generator


What you linked to is the same application I described in the first post of this thread. Did you have trouble with it?
<<

g121

Serviio newbie

Posts: 1

Joined: Wed Aug 30, 2023 8:10 pm

Post Wed Aug 30, 2023 8:22 pm

Re: Custom Random Playlists

Excellent cybersaga .. your "Generate Randomized Playlist" fits my need perfectly .. Thank you.

I listen to standup comedy late nights & I auto run your "Generate Randomized Playlist" nightly so I always have a fresh order of comedy routines to enjoy.

Its been working like a charm for a month now.

My only issue is that just in the last few of days, my Serviio Shared Folder has stopped auto-refreshing & so I'm seeing the old, not the newly generated playlist. Why the Auto Refresh stopped working after a month I don't know.

I'm looking for a Serviio batch command/routine to add to my batch file to Force Refresh of my shared folders .. but no success yet.

Return to Third-party tools integration

Who is online

Users browsing this forum: No registered users and 21 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.