Jump to content


Photo

QuickSubs Function - Subtitle Finder for opensubtitles.org


  • Please log in to reply
6 replies to this topic

#1 Delusion

Delusion
  • Members
  • 272 posts

Posted 22 April 2012 - 08:00 PM

QuickSubs v1.1 by Alex Sotirakis (Delusion)
Fast and Small Subtitle Finder for opensubtitles.org

Usage : Simply select a video file on windows explorer and hit Ctrl+Shift+S

#NoEnv
#SingleInstance Force

~^+s::QuickSubs()

QuickSubs($SubtitleLanguage = "all") {
  ;QuickSubs v1.1 by Alex Sotirakis (Delusion)
  ;Created on : 21/04/2012 Last Modified : 23/04/2012
  $ClipBack := ClipboardAll, Clipboard := ""
  Send ^c
  ClipWait 2
  StringSplit $VideoFile, Clipboard, `n, `r
  IF ($VideoFile0 != 1) {
    TrayTip, QuickSubs, Error : Incorrect number of files passed. Please select one video file!, 5, 2
    RETURN
  } ELSE SplitPath, $VideoFile1, $VideoFile1Name, , $VideoFile1Ext, ,
  IF InStr(",avi,mkv,mp4,mpg,wmv,divx,mov,mpeg,wmp,flv,vob,", "," $VideoFile1Ext ",") {
    FileGetSize, $VideoSize, % $VideoFile1
    Run % "http://www.opensubtitles.org/en/search/sublanguageid-" . $SubtitleLanguage . "/moviebytesize-" . $VideoSize,, UseErrorLevel
    TrayTip, QuickSubs, % ErrorLevel ? "Error : There was a problem with the subtitle search!" : "Searching [" . $SubtitleLanguage . "] subtitles for the video file : [" . $VideoFile1Name . "]", 5, % ErrorLevel ? 3 : 1
  } ELSE {
    TrayTip, QuickSubs, Error : You have passed incorrect file types. Please select one video file!, 5, 2
    RETURN
  }
  Clipboard := $ClipBack 
}

/*
Supported ISO639 Language Codes

all All Languages
alb	Albanian
ara	Arabic
arm	Armenian
baq	Basque 
ben	Bengali
bos	Bosnian
bre	Breton
bul	Bulgarian
cat	Catalan
chi	Chinese
cze	Czech
dan	Danish
dut	Dutch
eng	English
epo	Esperanto
est	Estonian
fin	Finnish
fre	French
geo	Georgian
ger	German
glg	Galician
ell	Greek
heb	Hebrew
hin Hindi
hrv	Croatian
hun	Hungarian
ice	Icelandic
ind	Indonesian
ita	Italian
jpn	Japanese
kaz	Kazakh
khm	Khmer
kor	Korean
lav	Latvian
lit	Lithuanian
ltz	Luxembourgish
mac	Macedonian
may Malay
nor	Norwegian
oci	Occitan
per	Persian
pol	Polish
por	Portuguese
rus	Russian
scc	Serbian
sin	Sinhalese
slo	Slovak
slv	Slovenian
spa	Spanish
swa	Swahili
swe	Swedish
syr	Syriac
tgl	Tagalog
tha	Thai
tur	Turkish
ukr	Ukrainian
urd	Urdu
vie	Vietnamese
rum	Romanian
pob	Brazilian
*/


Nothing special.But i use it alot lately and i thought i will share it.Maybe someone will find it usefull :D

#2 Nazzal

Nazzal
  • Members
  • 251 posts

Posted 23 April 2012 - 08:00 AM

Thanks for the idea Delusion, here is my version, simple and short..

FindSub(Language = "All") {
	SavedClip:= Clipboard, Clipboard:= ""
	Send ^c
	ClipWait, 4
	SplitPath, Clipboard, OutFileName, , Ext
	If !Instr(",avi,mkv,mp4,mpg,wmv,divx,mov,mpeg,wmp,flv,vob,", "," Ext ",")
		Return
	FileGetSize, Size, %Clipboard%
	Run % "http://www.opensubtitles.org/en/search/sublanguageid-" Language "/moviebytesize-" Size,, UseErrorLevel
	TrayTip, OpenSubtitles, % ErrorLevel ? "Error running search link!" : "`nLanguage:`t" Language "`nFile:`t`t" OutFileName, 5, % ErrorLevel ? 3 : 1
	Clipboard := SavedClip
	}


#3 Delusion

Delusion
  • Members
  • 272 posts

Posted 23 April 2012 - 10:45 AM

thanks for your idea! i striped down my code a little also using some things from your version

#4 Guests

  • Guests

Posted 27 April 2012 - 10:33 AM

i was using opensubtitles already to search for subtitles manually so this is very usefull for me and saves alot of time
thanks alot :mrgreen:

#5 Guests

  • Guests

Posted 10 June 2012 - 10:39 AM

Thanks for the idea Delusion, here is my version, simple and short..

FindSub(Language = "All") {
	SavedClip:= Clipboard, Clipboard:= ""
	Send ^c
	ClipWait, 4
	SplitPath, Clipboard, OutFileName, , Ext
	If !Instr(",avi,mkv,mp4,mpg,wmv,divx,mov,mpeg,wmp,flv,vob,", "," Ext ",")
		Return
	FileGetSize, Size, %Clipboard%
	Run % "http://www.opensubtitles.org/en/search/sublanguageid-" Language "/moviebytesize-" Size,, UseErrorLevel
	TrayTip, OpenSubtitles, % ErrorLevel ? "Error running search link!" : "`nLanguage:`t" Language "`nFile:`t`t" OutFileName, 5, % ErrorLevel ? 3 : 1
	Clipboard := SavedClip
	}


hello. i'm not an intelligent man. how would you run this script? whats the hotkey/trigger?

#6 Guests

  • Guests

Posted 10 June 2012 - 04:51 PM

FindSub("DE") ; DE = German

#7 Guests

  • Guests

Posted 07 October 2012 - 04:09 PM

QuickSubs v1.1 by Alex Sotirakis (Delusion)
Fast and Small Subtitle Finder for opensubtitles.org

Usage : Simply select a video file on windows explorer and hit Ctrl+Shift+S

#NoEnv
#SingleInstance Force

~^+s::QuickSubs()

QuickSubs($SubtitleLanguage = "all") {
  ;QuickSubs v1.1 by Alex Sotirakis (Delusion)
  ;Created on : 21/04/2012 Last Modified : 23/04/2012
  $ClipBack := ClipboardAll, Clipboard := ""
  Send ^c
  ClipWait 2
  StringSplit $VideoFile, Clipboard, `n, `r
  IF ($VideoFile0 != 1) {
    TrayTip, QuickSubs, Error : Incorrect number of files passed. Please select one video file!, 5, 2
    RETURN
  } ELSE SplitPath, $VideoFile1, $VideoFile1Name, , $VideoFile1Ext, ,
  IF InStr(",avi,mkv,mp4,mpg,wmv,divx,mov,mpeg,wmp,flv,vob,", "," $VideoFile1Ext ",") {
    FileGetSize, $VideoSize, % $VideoFile1
    Run % "http://www.opensubtitles.org/en/search/sublanguageid-" . $SubtitleLanguage . "/moviebytesize-" . $VideoSize,, UseErrorLevel
    TrayTip, QuickSubs, % ErrorLevel ? "Error : There was a problem with the subtitle search!" : "Searching [" . $SubtitleLanguage . "] subtitles for the video file : [" . $VideoFile1Name . "]", 5, % ErrorLevel ? 3 : 1
  } ELSE {
    TrayTip, QuickSubs, Error : You have passed incorrect file types. Please select one video file!, 5, 2
    RETURN
  }
  Clipboard := $ClipBack 
}

/*
Supported ISO639 Language Codes

all All Languages
alb	Albanian
ara	Arabic
arm	Armenian
baq	Basque 
ben	Bengali
bos	Bosnian
bre	Breton
bul	Bulgarian
cat	Catalan
chi	Chinese
cze	Czech
dan	Danish
dut	Dutch
eng	English
epo	Esperanto
est	Estonian
fin	Finnish
fre	French
geo	Georgian
ger	German
glg	Galician
ell	Greek
heb	Hebrew
hin Hindi
hrv	Croatian
hun	Hungarian
ice	Icelandic
ind	Indonesian
ita	Italian
jpn	Japanese
kaz	Kazakh
khm	Khmer
kor	Korean
lav	Latvian
lit	Lithuanian
ltz	Luxembourgish
mac	Macedonian
may Malay
nor	Norwegian
oci	Occitan
per	Persian
pol	Polish
por	Portuguese
rus	Russian
scc	Serbian
sin	Sinhalese
slo	Slovak
slv	Slovenian
spa	Spanish
swa	Swahili
swe	Swedish
syr	Syriac
tgl	Tagalog
tha	Thai
tur	Turkish
ukr	Ukrainian
urd	Urdu
vie	Vietnamese
rum	Romanian
pob	Brazilian
*/


Nothing special.But i use it alot lately and i thought i will share it.Maybe someone will find it usefull :D


That is just awesome :D I modified it a bit to use my favorite webpage for it, but I'm noob at this so I wanted to know if there's any way to make it ignore (while pasting in the search) dots (so from 21.jump.street.avi it would make the search go 21%20jump%20street in the link). Is it possible to be done in the search? I really like this script and I'll find it so useful if this is possible to be done :D I'd like some other changes aswell, but this is pretty much the main one, because my favorite webpage doesn't recognize titles when the search is Movie.Name.2011.BRRip.HC.ENG.XviD.avi. And is it possible to make it ignore few other words like BRRip XViD etc? :D Thanks in advance.