1

I am trying to make a script that pick up a random mkv or mp4 file in a directory and play, only limit is that the file playtime must not be more than 2 hours, how do I do that? A newbee and just startet but my code looks like this:

import os from random import choice directory = 'D:\Johnny-3 Film 2018' files = os.listdir(directory) for i in range(100): movie = choice(files)

jhjorsal
  • 197
  • 3
  • 10

1 Answers1

1

You probably will need to use an external proram. You could use ffprobe or moviepy. There are many examples from similarly asked questions that I found from this stack overflow answer:

jkulskis
  • 124
  • 1
  • 4
  • Starting programs is not what program_ming_ is about - Stack Overflow is for programming, and this answer should be on [Super User](https://superuser.com/). If anything, only libraries should be named. – AmigoJack Jun 07 '23 at 09:25