Jump to content

Script for naming movies?


Recommended Posts

Posted

I find I'm having to do a lot of manually renaming files and folders to get emby to recognize them.

For example this is not recognized:

Movie.Name.1925

But this is recognized:

Movie.Name.(1925)

So I can save myself some grief by parsing and renaming automatically but just wondering if someone already has made a script for this?

 

Posted

Programs like filebot or tiny media manager can help with this.

  • Like 1
Posted

Hmm $40 USD seems like a lot to put parenthesis around the years on my files I might just roll my own thanks for the suggestion though I might still go that way eventually.

 

 

 

GrimReaper
Posted
7 minutes ago, Tailslide said:

$40 USD seems like a lot

What's that 40?

Posted
Just now, GrimReaper said:

What's that 40?

Filebot is no longer free.. the original free open source version is kind of broken and the developer charges $40 for the (closed source) software now.

Spaceboy
Posted

bulk rename utility would be able to do that simple task for you too. for free

Posted

Tiny media manager 3 is free

There is the free last version of filebot before going paid.

Advanced remamer is free too

Posted

Thanks for all the suggestions.. I need something on an ongoing basis I can use in a shell script (not on windows)
I'm attaching my quick and dirty python script in case anyone needs it

#!/usr/bin/python

import sys
import re
from datetime import datetime

fname = sys.argv[1]
tokens = re.split('(\W)', fname)
newname=""
parencount=0

for token in tokens:
  tokenoutput=False
  if token == '(':
    parencount += 1
  if token == ')':
    parencount -= 1

  if token.isnumeric() and int(token) > 1900 and int(token) <= (datetime.now().year+1):
    if parencount == 0:
      newname = newname + '(' + token + ')'
      tokenoutput=True
  if not tokenoutput:
    newname = newname + token

print (newname)

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...