topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday November 2, 2024, 2:06 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: SubDude, a subtitle renaming program  (Read 40894 times)

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
SubDude, a subtitle renaming program
« on: August 17, 2007, 06:00 PM »
Here's a little program i made for myself to automatically rename subtitles files to match video files because i was tired of doing it by hand. I guess this program will not be very useful to english-speaking people but it might be to the others.

Here's the situation : you have a folder containing a few episodes or a whole season of a (100% free to download :-[) tv show. You download subtitles files for it and you realize the names of the of the video files and the names of the subtitles files don't match (ie Serie.s01e12.avi & Serie1x12.srt). If you want your media player to automatically load subtitles, you have to rename every subtitles files by hand.

Now, here's SubDude !

Just give SubDude a folder (by using the gui, context-menu or 'Send to') and he will check every video file and look for a corresponding subtitle, and rename it. If you don't trust SubDude, you can tell him to generate an "UnDude" file so you can revert changes in case things were done the wrong way.

subdude.zip

Known restrictions :
  • SongDude assumes all files are from the same season and doesn't check this. Maybe i'll add this in a future version
  • If two subtitles files are matching, they will be renamed consecutively so one of them will be crushed (and this won't be undoable)
Any feedback or bug report will be appreciated :)

subdude_shot.jpg

The ahk source is available here but i'm afraid it's very messy and undocumented.
subdude.ahk
« Last Edit: September 04, 2007, 06:43 PM by ak_ »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #1 on: August 17, 2007, 06:26 PM »
clever  :up:

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #2 on: August 18, 2007, 10:35 AM »
Actually, i forgot to say something in my previous message.

To detect episode number, i use regular expressions* based of what i've found in different filenames. Until now, i've seen these templates :

  • sseasoneepisode
  • seasonxepisode
  • EPepisode
  • sseason.eepisode

I don't know if many of you use subtitle files, but if you've ever encountered another template, please tell me know so i'll add it in the ini file. Thanks :)

* actually, this project was an opportunity for me to learn about regular expressions and i've been pleased to see that it was less complicated that expected.
« Last Edit: August 19, 2007, 04:33 AM by ak_ »

Darwin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,984
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #3 on: August 18, 2007, 11:00 AM »
Looks good, ak_ My wife's family are Korean and don't speak/read much English: this will help in making video more accessible to them.

 :Thmbsup:

PS What do you use for regex searches (just curious)?

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #4 on: August 18, 2007, 11:13 AM »
PS What do you use for regex searches (just curious)?
If you're asking which function i use : RegExMatch

I use it once to isolate the season+episode string (like "s01e05", matching the regex "s\d+e\d+" ), then in this string, i isolate the episode number (here "05", matching "(?<=e)\d+" ). I have to do this in two steps (i guess) because :
The bad news is that most regex flavors do not allow you to use just any regex inside a lookbehind, because they cannot apply a regular expression backwards. Therefore, the regular expression engine needs to be able to figure out how many steps to step back before checking the lookbehind.

Therefore, many regex flavors, including those used by Perl and Python, only allow fixed-length strings. You can use any regex of which the length of the match can be predetermined. This means you can use literal text and character classes. You cannot use repetition or optional items. You can use alternation, but only if all options in the alternation have the same length.

So i can't look for "(?<=e)\d+" directly on the filename and not expect to get weird results (for example, if the serie's called "AirForce1", the last two letters would match). Maybe there's another solution, i dunno, i just learnt regex yesterday :)

Darwin

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 6,984
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #5 on: August 18, 2007, 04:35 PM »
Ah - thank ak_ I have nothing profound to say now, I really was simply curious! I am a regex "twit" I have several apps that will allow me to search and repace using regex, but I've never really taken the time to learn it  :-[

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #6 on: August 18, 2007, 09:35 PM »
thanks ak_, i've been searching for something like this, after manually renaming one whole season of a certain famous tv show. ;) cool icon too, downloading now.. what can i say - thanks, dude! :Thmbsup:

P.S. a screenshot would be nice..


ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #7 on: August 19, 2007, 04:40 AM »
P.S. a screenshot would be nice..
True, i just added one :) Thanks.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #8 on: August 19, 2007, 08:31 AM »
True, i just added one :) Thanks.
cool! one more request, what about posting a link to this thread in the SubDude gui? would be easier to make comments and suggestions.. :)

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #9 on: August 19, 2007, 10:45 AM »
cool! one more request, what about posting a link to this thread in the SubDude gui? would be easier to make comments and suggestions.. :)
Good idea, done :)

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #10 on: September 04, 2007, 06:48 PM »
Subdude update !

What's new :
  • Now Subdude takes season number in consideration
  • "SEE" pattern is now handled (meaning that Subdude will detect season and episode number in - for example - Prison.Break.201.srt
  • Update checking has been added via DC Updater. Thanks Mouser and Justice.

You can get it here :
subdude.zip

And ahk source is here :
subdude.ahk

Please report any bug, problem or suggestion :)

Dude Spell

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #11 on: October 27, 2007, 11:20 AM »
Great idea! :Thmbsup:
But link is dead, can you re up them, please?

edbro

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 426
    • View Profile
    • Donate to Member
SubDude, a subtitle renaming program - And a great band!
« Reply #12 on: October 27, 2007, 02:06 PM »
OT alert:
You guys do realize that The Subdudes are about the best band you've never heard of? I love these guys. Saw them in concert 2 weeks ago.

http://www.subdudes.com/

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #13 on: October 27, 2007, 06:49 PM »
Dude Spell> the link are working now, thanks :)

Dude Spell

  • Participant
  • Joined in 2007
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #14 on: October 31, 2007, 12:35 AM »
Dude Spell> the link are working now, thanks :)
I thank you, my friend.  :Thmbsup:

ovehal

  • Participant
  • Joined in 2005
  • *
  • Posts: 16
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #15 on: January 20, 2009, 02:12 PM »
A great program. It would save me a lot of work if I could get it to work.

My files looks like this:
The O C Season 1 Episode 07 The Escape -Tvep.avi
The.O.C.S01E07.The.Escape.DVDRip.XviD-TVEP.srt

I guess it can be solved by editing the regexp in the inifile, so I hope some regexp expert could help me out...

EDIT: The download link did  not work, but I found it at: http://soft.wopah.co.../subdude/subdude.zip

Best regards
Ove B-)
« Last Edit: January 20, 2009, 02:23 PM by ovehal »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #16 on: March 26, 2009, 10:23 PM »
ak_: just want to say that SubDude has been a big help for me. along with the subtitle renaming, i've been using SubSude for renaming episode thumbs as well as nfo files by adding those extensions in the ini file. thanks again. :Thmbsup:

[Formats]
video=avi;mpg;mpeg;rmvb;asf;asx
subtitles=srt;txt;sub;nfo;tbn;jpg

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #17 on: March 27, 2009, 10:30 AM »
Thanks Lanux :) I'm glad you found your own way of using SubDude.

I've been thinking about improving SubDude for quite some time now, mainly because sometimes files are named in a way that SubDude can't handle (like : TVShow-Season-Name of the episode-Episode number), but the regular expression give me a headache :) I'm thinking about some kind of "learning mode" so you can indicate where the season and episode numbers are in one file and then the program finds them in the other files (i hope i'm clear). I hope i'll get the time and the courage to work on that some day :)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #18 on: March 27, 2009, 10:53 AM »
yeah sometimes they are named quite bizarrely, even dedicated media scrapers can't get around those. :)

jonker1541

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #19 on: March 29, 2009, 11:29 AM »
Registered to say thanks for this app.

It just renamed 4 seasons worth of tv for my gf, that I ordinarily rename by hand :-)

A question: Subdude seems unable to link the following two files:

01x01 - Pilot.srt

and

Series Name 101 - Pilot.avi

Is that due to the fact that the series name is not in the srt file name? Or is it unable to link 01x01 with 101. (unfortunately I have another 4 seasons that are formatted this way :-))

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #20 on: March 29, 2009, 12:16 PM »
Hi jonker :)

The problem is that i didn't add support for "101" filenames yet. I suppose it could be easily done, but it seemed tricky to me when i coded SubDude (i had never dealt with regular expressions before). When i face this particular problem, i use a batch renaming program to rename the files first (in this case, i would replace "Series Name 1" with "Series Name 1x"), then i use SubDude.

I'll try to fix this problem soon :)

jonker1541

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #21 on: March 29, 2009, 01:31 PM »
That indeed worked perfectly. Took me 5 minutes to download and figure out a batch renamer.

Then Subdude figured out how to do it  :)

Thanks again for programming this, and making it available for everyone, and replying to questions so quickly...


superture

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #22 on: August 19, 2009, 04:38 PM »
Seems great but doesn't work with mkv files? I'd like exactly the same but with .mkv files aswell!

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #23 on: August 19, 2009, 08:42 PM »
Seems great but doesn't work with mkv files? I'd like exactly the same but with .mkv files aswell!

as i mentioned in my post above, you can add as many different extensions in the INI file. just exit subdude, edit the ini file and start again.

[Formats]
video=avi;mpg;mpeg;rmvb;asf;asx;mkv
subtitles=srt;txt;sub;nfo;tbn;jpg

superture

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
Re: SubDude, a subtitle renaming program
« Reply #24 on: August 20, 2009, 02:41 AM »
Seems great but doesn't work with mkv files? I'd like exactly the same but with .mkv files aswell!

as i mentioned in my post above, you can add as many different extensions in the INI file. just exit subdude, edit the ini file and start again.

[Formats]
video=avi;mpg;mpeg;rmvb;asf;asx;mkv
subtitles=srt;txt;sub;nfo;tbn;jpg
Sorry for my ignorance, now it works with mkv files.