Skip to main content

Chooses a file from a directory. Very handy to re-watch tv series!

Project description


Sometimes all you want to do is to lie in bed and watch a few episodes. But navigating to the right folder and choosing an episode which you haven’t seen yesterday is too much work. With this small script all you have to do is to type “playfuturama” (using tab completion of course!) if you have set up e.g. this alias:

alias playfuturama='choose-next -c "mplayer -fs" "/media/usb/Futurama"'


2.0.1 2017-05-01 Small fixes, Windows compatible
2.0.0 2017-04-30 Bugfixes, Python 3 support, extensive test suite
1.1 2011-04-26 Bugfixes, --exclude, --include, and -d
1.0 2010-04-26 First working version


Over the next few weeks you want to watch all Futurama episodes in strict rotation:

# clear existing log file
choose-next --clear /media/usb/Futurama
# no special options needed
alias playfuturama='choose-next -c "mplayer -fs" "/media/usb/Futurama"'

You want to see a random episode (out of order!), but not one you have already seen. You want to prepend the filename so that the rotation order is retained:

playfuturama -rp

You were somehow distracted, and want to watch the last episode again:

playfuturama -l

You want to watch a specific episode, and continue to watch from this point on:

playfuturama -n10 "/media/usb/Futurama/S04E01.avi"


choose-next [OPTION]... DIR [FILE]...

  DIR        directory to choose from
  FILES      prefer these files before all others

Some options:

  -c CMD, --command=CMD      execute CMD on every selected file; %s in CMD is
                             substituted with the filename, otherwise it is
                             appended to CMD
  --clear                    remove log file and exit
  -l, --last                 play last played file
  -n NUM, --number=NUM       number of files to select (-1: infinite)
  -p, --prepend              prepend selected filename instead of appending
  -r, --random               choose a random file from DIR

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for choose-next, version 2.0.1
Filename, size File type Python version Upload date Hashes
Filename, size choose_next-2.0.1-py2.py3-none-any.whl (9.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page