Welcome Guest.   Make a donation to an author on the site July 22, 2014, 04:46:40 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Check out and download the GOE 2007 Freeware Challenge productivity tools.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1] 2 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: SubDude, a subtitle renaming program  (Read 20619 times)
ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: August 17, 2007, 06:00:11 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 embarassed) 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 smiley



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:40 PM by ak_ » Logged

mouser
First Author
Administrator
*****
Posts: 33,159



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: August 17, 2007, 06:26:43 PM »

clever  thumbs up
Logged
ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: August 18, 2007, 10:35:04 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 smiley

* 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:47 AM by ak_ » Logged

Darwin
Charter Member
***
Posts: 6,979



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: August 18, 2007, 11:00:38 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)?
Logged

"Some people have a way with words, other people,... oh... have not way" - Steve Martin
ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: August 18, 2007, 11:13:48 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 :
Quote
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 smiley
Logged

Darwin
Charter Member
***
Posts: 6,979



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: August 18, 2007, 04:35:52 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  embarassed
Logged

"Some people have a way with words, other people,... oh... have not way" - Steve Martin
lanux128
Global Moderator
*****
Posts: 6,086



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: August 18, 2007, 09:35:53 PM »

thanks ak_, i've been searching for something like this, after manually renaming one whole season of a certain famous tv show. Wink cool icon too, downloading now.. what can i say - thanks, dude! Thmbsup

P.S. a screenshot would be nice..

Logged

ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: August 19, 2007, 04:40:08 AM »

P.S. a screenshot would be nice..
True, i just added one smiley Thanks.
Logged

lanux128
Global Moderator
*****
Posts: 6,086



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: August 19, 2007, 08:31:06 AM »

True, i just added one smiley 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.. smiley
Logged

ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: August 19, 2007, 10:45:12 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.. smiley
Good idea, done smiley
Logged

ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: September 04, 2007, 06:48:33 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 smiley
Logged

Dude Spell
Participant
*
Posts: 5

View Profile Give some DonationCredits to this forum member
« Reply #11 on: October 27, 2007, 11:20:30 AM »

Great idea! Thmbsup
But link is dead, can you re up them, please?
Logged
edbro
Charter Member
***
Posts: 425

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #12 on: October 27, 2007, 02:06:24 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/
Logged
ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #13 on: October 27, 2007, 06:49:09 PM »

Dude Spell> the link are working now, thanks smiley
Logged

Dude Spell
Participant
*
Posts: 5

View Profile Give some DonationCredits to this forum member
« Reply #14 on: October 31, 2007, 12:35:13 AM »

Dude Spell> the link are working now, thanks smiley
I thank you, my friend.  Thmbsup
Logged
ovehal
Participant
*
Posts: 16


View Profile Give some DonationCredits to this forum member
« Reply #15 on: January 20, 2009, 02:12:16 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.com/subdude/subdude.zip

Best regards
Ove B-)
« Last Edit: January 20, 2009, 02:23:27 PM by ovehal » Logged
lanux128
Global Moderator
*****
Posts: 6,086



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #16 on: March 26, 2009, 10:23:22 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

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

ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #17 on: March 27, 2009, 10:30:15 AM »

Thanks Lanux smiley 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 smiley 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 smiley
Logged

lanux128
Global Moderator
*****
Posts: 6,086



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: March 27, 2009, 10:53:27 AM »

yeah sometimes they are named quite bizarrely, even dedicated media scrapers can't get around those. smiley
Logged

jonker1541
Participant
*
Posts: 3

View Profile Give some DonationCredits to this forum member
« Reply #19 on: March 29, 2009, 11:29:43 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 :-))
Logged
ak_
Supporting Member
**
Posts: 223


see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #20 on: March 29, 2009, 12:16:31 PM »

Hi jonker smiley

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 smiley
Logged

jonker1541
Participant
*
Posts: 3

View Profile Give some DonationCredits to this forum member
« Reply #21 on: March 29, 2009, 01:31:37 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  smiley

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

Logged
superture
Participant
*
Posts: 2

View Profile Give some DonationCredits to this forum member
« Reply #22 on: August 19, 2009, 04:38:46 PM »

Seems great but doesn't work with mkv files? I'd like exactly the same but with .mkv files aswell!
Logged
lanux128
Global Moderator
*****
Posts: 6,086



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #23 on: August 19, 2009, 08:42:28 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.

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

superture
Participant
*
Posts: 2

View Profile Give some DonationCredits to this forum member
« Reply #24 on: August 20, 2009, 02:41:15 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.

[copy or print]
[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.
Logged
Pages: [1] 2 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.056s | Server load: 0.14 ]