mukunku Posted January 5, 2012 Report Share Posted January 5, 2012 Hello everyone,I would like to share a program i wrote for myself that i like to call 'Autolabeler'. Clever ey?Now also with Tracker Support!Program Description:'Autolabeler' runs in the windows background checking for new torrent additions. When a new torrent is added to uTorrent, the program compares the name and/or trackers, of the torrent to be added, to settings that the user has defined earlier.Meaning, your torrent's will all be automatically labeled when you first add them.Program Purpose:I wrote this program for myself because I got kinda tired of always selecting a label for my new torrents. And since i download ~5 torrents daily, I thought it was high time i did something about it.Also, upon request, i added support for labeling by tracker's.How to Use:Please direct your attention to the image below:Once you run the program for the first time, a file called 'Labeler_Settings.ini' is created. With a preset layout, similar to the image above. Users can modify this file to suit their needs. Basic Format:LabelName=Keyword1,Keyword2,Keyword3, ...etc-Keywords must not have spaces in the beginning and/or end. Spaces between words are allowed.-Comma's are used to seperate keywords "," (Without the quotes)-Characters are not case sensitive. ( A = a )So whenever the program detects 'Keyword1' in the torrent title, the label for the newly added torrent is automatically changed to 'LabelName'.How it Works:The program checks the 'Torrent Name' of all newly added torrent's.Or if you download the program with 'Tracker Support', the program also checks the torrents trackers. Then the program searches for 'Keywords' in the name and/or trackers. If a match is found, the matching 'Label Name' for that keyword is assigned to the new torrent.For example, look at the image below:In my 'Labeler_Settings.ini' file i have:TV-Shows=House,Conan,Chuck,American Dad,Family Guy,Futurama,Castle,Daily Show,Mythbusters,Philadelphia,SimpsonsI put the keyword 'Philadelphia' in because it's rare to ever download another torrent with the word 'Philadelphia' in it. If you would like to be more precise, you can write the full title of the show so the program is more accurate. Example: 'its always sunny in philadelphia'.Tracker Support:For tracker support, just add any part of the tracker as a Keyword. Example:Movies=thepiratebay.org,tracker.zamunda.net,tracker.somerandomtracker.netImportant Note: When labeling according to Torrent Name's, Period's "." (Without the quotes) are automatically converted to 'Space' characters. So "The.Daily.Show" will be read by the program as = "The Daily Show". This is NOT the case with trackers.Important Note 2: Labeling priority is top-down. Meaning the first matching label will be used. So if you would like to give a certain KEYWORD or LABEL higher priority, put that higher in the INI file.Tested on Utorrent version: 3.1.3I can't guarantee it will work with previous versions.Download(No Tracker Support): Download: http://grj.sf.net/Utorrent_AutoLabeler.exeDownload (with Tracker Support): Download: http://grj.sf.net/Utorrent_AutoLabeler_wTrackerSupport.exeVirus Scan: http://www.virustotal.com/file-scan/report.html?id=a96275e340843b2b16606e7e6279b3bf755680c4c534bcc855b77fc8dce56e0e-1325793115Virus Scan 2: https://www.virustotal.com/file/75e46354f4483fdc4fbe19e8f6e79726205aa81cbf5023db87895b94d0c996c2/analysis/1339690262/Recommended Usage: Copy the program to a place where you most likely wont move it. Then create a shortcut to the program and place it in your 'Startup' folder. This way the program will run when ever you open your PC and automatically detect new torrent's whenever you need it to. After you can run the exe once to create the 'Labeler_Settings.ini' file and configure it to fulfill your needs.Parting Words:Written in AutoHotkey. You can decompile the program and check out the source code. Though I wouldn't recommend it, because the code is a bit of a mess I hope some people get good use out of this program.Update: After adding tracker labeling support, i added another download link. Because to label according to trackers, the 'Advanced..' settings window is must be opened for a second to get the torrents tracker list.This is done automatically and the window is closed immediately, but it can get annoying if you don't want this feature. So if you don't want tracker support, download the one without the tracker support.Best Regards,Mukunku Link to comment Share on other sites More sharing options...
Gordon67 Posted January 21, 2012 Report Share Posted January 21, 2012 Very nice. Too bad for me I am not running PC. What if instead of using keywords the program would just look at the tracker. I know many people have one site for music, one for tv, etc.. so it could assume all torrents from one tracker to be similar. Link to comment Share on other sites More sharing options...
mukunku Posted January 23, 2012 Author Report Share Posted January 23, 2012 Very nice. Too bad for me I am not running PC. What if instead of using keywords the program would just look at the tracker. I know many people have one site for music, one for tv, etc.. so it could assume all torrents from one tracker to be similar.That's a good idea. If I ever decide to improve this, I will definitely keep that in mind as a functionality. Link to comment Share on other sites More sharing options...
johcagaorl Posted February 7, 2012 Report Share Posted February 7, 2012 I tried to decompile this to see if I could easily get it to look at the tracker field instead of the label name, and it says NotARC, so it's either corrupted or not an autohotkey file? Ah well. Here's another request to look at the tracker instead of label name. Link to comment Share on other sites More sharing options...
FullyBaked Posted February 13, 2012 Report Share Posted February 13, 2012 Oooh please update this to allow tracker based labels. That's what I've come in search of. I like your approach but I think it could be simplified for many users including myself. Shocking uTorrent doesn't have this implemented yet. Link to comment Share on other sites More sharing options...
mukunku Posted March 4, 2012 Author Report Share Posted March 4, 2012 I tried to decompile this to see if I could easily get it to look at the tracker field instead of the label name, and it says NotARC, so it's either corrupted or not an autohotkey file? Ah well. Here's another request to look at the tracker instead of label name.#Persistent#SingleInstance,Force#NoTrayIconSetTitleMatchMode,2var_PreviousWindows := ""if !(FileExist("Labeler_Settings.ini")) { GoSub,sub_IniWrite}SetTimer,sub_CheckNewTorrent,250SetTimer,sub_ClearPreviousWindows,20000 ;This will clear the string that holds: Previous Windows that had their Labels set. So Let's say a window with the id 0x0efab2 had it's label set to 'Movie'. Then this window's id is added to the string so it's label isn't constantly updated. Every 20 seconds we clear this string, to improve long term runnability.Returnsub_CheckNewTorrent: var_WinID := WinExist("Add New Torrent ahk_class #32770") if (var_WinID) { if var_PreviousWindows contains %var_WinID% ;checks if this windows label was set previously within 20 seconds.Prevents the program from frequently updating the label of the same window Return SetTimer,sub_CheckNewTorrent,OFF GOGOGO(var_WinID,var_PreviousWindows) SetTimer,sub_CheckNewTorrent,ON }ReturnGOGOGO(winid,ByRef previouswindowsstring) { ;First Let's get the File Name from 'Static2'.Should work for Multiple File torrents. Like 'Seasons 1-4 of House MD' ControlGetText,var_FileName,Static2,Add New Torrent ahk_id %winid% ;Next let's replace the '.' (period) 's from the file name. Since this is quite common among torrent files. StringReplace,var_FileName,var_FileName,.,%A_Space%,1 ;Now get the Labels and the keywords assigned to that label in one giant string. IniRead,var_IniOut,Labeler_Settings.ini,LABELS if !(FileExist("Labeler_Settings.ini")) { GoSub,sub_IniWrite } j := 0 ;First loops parses the giant string by line feeds.so we have 'LABEL1=KEYWORDS1', then next loop 'LABEL2=KEYWORDS2' ,.. etc Loop,Parse,var_IniOut,`n, { asd := A_LoopField Loop,Parse,asd,=, { ;This Loop seperates the Label and the Keyword list. For this example let's say LABEL1 and KEYWORDS1. if (j = 0) var_Label := A_LoopField ;LABEL1 else var_LabelList := A_LoopField ;KEYWORDS1 j++ } j := 0 ;Now Let's Check if any of KEYWORDS1 is present in the file name. if var_FileName contains %var_LabelList% { previouswindowsstring .= " " winid " " ;One of the keywords from KEYWORDS1 was matched in the file name.So LABEL1 must be selected from the combobox. Control,ChooseString,%var_Label%,ComboBox2,Add New Torrent ahk_id %winid% Break ;Break since we don't need to check LABEL2,LABEL3,..etc } }}sub_IniWrite:IniWrite,House`,How I Met Your Mother`,The Big Bang Theory,Labeler_Settings.ini,LABELS,TV-ShowsReturnsub_ClearPreviousWindows:var_PreviousWindows := ""SetTimer,sub_ClearPreviousWindowsReturn^r::reloadreturnI don't know why you got an error while decompiling. So here's the code for you =)I was going to look into the tracker based sorting. But i got too busy with other matters. If you happen to implement this. Do share, please.Sincerely,mukunku Link to comment Share on other sites More sharing options...
mukunku Posted March 6, 2012 Author Report Share Posted March 6, 2012 It's not perfect but, I added another download link with Tracker support. You can find the link in my original post. Please read all the details in my first post to get a general idea on how it works. Again you can decompile the program if you want. Here's a link to the decompiler: http://www.autohotkey.com/download/Exe2Ahk.exeI didn't have much time to test it. So any feedback would be greatly appreciated.Regards,Mukunku Link to comment Share on other sites More sharing options...
bbgmp Posted March 29, 2012 Report Share Posted March 29, 2012 Just a thought, but what about expanding the keyword handling to include wildcards or boolean logic. That way, rather than having to enter every single TV show name, you could simply enter something which all TV shows have in common: season and episode info.Entering a keyword such as...s??.e??... would mean any TV shows would be picked up.Similarly, since most movie files have the production date between (...), you could enter...(19??),(20??),... to pick up any movie files. Link to comment Share on other sites More sharing options...
tritono Posted March 31, 2012 Report Share Posted March 31, 2012 Thanks for making this useful auto labeler. I wanted to download it but I got "File Blocked for Violation" in Mediafire. Can upload it again to another page? I really need this . I appreciate it. Link to comment Share on other sites More sharing options...
johcagaorl Posted April 4, 2012 Report Share Posted April 4, 2012 Download links are down. Link to comment Share on other sites More sharing options...
mukunku Posted April 4, 2012 Author Report Share Posted April 4, 2012 Download links are down.They seem to be working for me?Just a thought, but what about expanding the keyword handling to include wildcards or boolean logic. That way, rather than having to enter every single TV show name, you could simply enter something which all TV shows have in common: season and episode info.Entering a keyword such as...s??.e??... would mean any TV shows would be picked up.Similarly, since most movie files have the production date between (...), you could enter...(19??),(20??),... to pick up any movie files.That sounds like a good idea, and can be implemented with Regular Expressions. But that would require the end-user to learn Regular Expression. Other solutions are possible but are much more complex. If i get around to it,i'll definitely try that out. Link to comment Share on other sites More sharing options...
tritono Posted April 4, 2012 Report Share Posted April 4, 2012 mukunku:File Blocked for Violation.The file you requested has been blocked for a violation of our Terms of Service. If you believe you have reached this page in error, please contact support.Click here to view our help resourcesI got that when I try to download the labeler. Can you upload it again? Thank you for such great invention. Link to comment Share on other sites More sharing options...
mukunku Posted April 5, 2012 Author Report Share Posted April 5, 2012 I re-uploaded the files to two different sites. Please tell me if you still experience problems. Link to comment Share on other sites More sharing options...
einixmax Posted June 8, 2012 Report Share Posted June 8, 2012 I can`t download from both of the site u Don`t work for me no matter what i try.Can someone reupload them to any different host like mediafire or sharebeast, rapidshare is fine too!Thanks in advance Link to comment Share on other sites More sharing options...
mukunku Posted June 11, 2012 Author Report Share Posted June 11, 2012 I can`t download from both of the site u Don`t work for me no matter what i try.Can someone reupload them to any different host like mediafire or sharebeast, rapidshare is fine too!Thanks in advance I uploaded it to one of my project servers. Hopefully no download problems will occur in the future. Link to comment Share on other sites More sharing options...
mukunku Posted June 14, 2012 Author Report Share Posted June 14, 2012 I updated the program to work with uTorrent version 3.1.3The program may not work with older versions of uTorrent. Link to comment Share on other sites More sharing options...
squowse Posted July 13, 2012 Report Share Posted July 13, 2012 Thanks it works well as long as the "Show a window when adding a torrent" option is enabled in utorrent preferences. I suppose because of the macro scripting it would not be possible to do it if the window was not opened. So it is not yet fully automatic, but still an improvement.Utorrent really should have this feature included and also automatic moving of torrent contents download location when a label is changed. Link to comment Share on other sites More sharing options...
Azothoras Posted July 29, 2012 Report Share Posted July 29, 2012 Thanks, this helps a lot with sorting torrents. Especially with torrents that usually finishes faster than you manually get time to label them (First world problems, hooo), and as such the automatic label sorting doesn't work.Is it possible to make it work on magnet links as well though? It doesn't seem to label them right now, probably because the torrent has the magnet link as a name before it starts downloading the file(s).EDIT:Also, a couple of groups use "_" instead of "." or " " between words, which probably also should be added as something that would be converted into spaces.I realize i could simply addStringReplace,var_FileName,var_FileName,_,%A_Space%,1just next toStringReplace,var_FileName,var_FileName,.,%A_Space%,1based on the old code a few posts above to make this work, but just like johcagaorl i couldn't decompile the newer version of the program to make this change for myself. NotARC error again. Link to comment Share on other sites More sharing options...
mukunku Posted August 2, 2012 Author Report Share Posted August 2, 2012 Thanks it works well as long as the "Show a window when adding a torrent" option is enabled in utorrent preferences. I suppose because of the macro scripting it would not be possible to do it if the window was not opened. So it is not yet fully automatic, but still an improvement.Utorrent really should have this feature included and also automatic moving of torrent contents download location when a label is changed.Yes unfortunately this is quite a simple script. You need the "torrent adding window" in order to label the new torrent.I really don't understand why uTorrent hasn't implemented this yet. Since it's such a simple feature. I've been looking into uTorrent apps to see if I could design one that accomplished this feature in a "fully automatic" fashion. But I really haven't had much time =] Link to comment Share on other sites More sharing options...
mukunku Posted August 2, 2012 Author Report Share Posted August 2, 2012 Thanks, this helps a lot with sorting torrents. Especially with torrents that usually finishes faster than you manually get time to label them (First world problems, hooo), and as such the automatic label sorting doesn't work.Is it possible to make it work on magnet links as well though? It doesn't seem to label them right now, probably because the torrent has the magnet link as a name before it starts downloading the file(s).EDIT:Also, a couple of groups use "_" instead of "." or " " between words, which probably also should be added as something that would be converted into spaces.I realize i could simply addStringReplace,var_FileName,var_FileName,_,%A_Space%,1just next toStringReplace,var_FileName,var_FileName,.,%A_Space%,1based on the old code a few posts above to make this work, but just like johcagaorl i couldn't decompile the newer version of the program to make this change for myself. NotARC error again.I haven't really ever downloaded a magnet link =P Thepiratebay is banned in my country and i really felt no need to use magnet links before. Not anytime soon but, i'll try to check that out..As for the updated source code:#Persistent#SingleInstance,Force#NoTrayIconSetTitleMatchMode,2var_PreviousWindows := ""if !(FileExist("Labeler_Settings.ini")) { GoSub,sub_IniWrite}SetTimer,sub_CheckNewTorrent,250SetTimer,sub_ClearPreviousWindows,40000 ;This will clear the string that holds: Previous Windows that had their Labels set. So Let's say a window with the id 0x0efab2 had it's label set to 'Movie'. Then this window's id is added to the string so it's label isn't constantly updated. Every 20 seconds we clear this string, to improve long term runnability.Returnsub_CheckNewTorrent: var_WinID := WinExist("Add New Torrent ahk_class #32770") if (var_WinID) { if var_PreviousWindows contains %var_WinID% ;checks if this windows label was set previously within 40 seconds.Prevents the program from frequently updating the label of the same window Return SetTimer,sub_CheckNewTorrent,OFF GOGOGO(var_WinID,var_PreviousWindows) SetTimer,sub_CheckNewTorrent,ON }ReturnGOGOGO(winid,ByRef previouswindowsstring) { ;First Let's get the File Name from 'Static2'.Should work for Multiple File torrents. Like 'Seasons 1-4 of House MD' ;ControlGetText,var_FileName,Static2,Add New Torrent ahk_id %winid% WinGetTitle, var_FileName, Add New Torrent ahk_id %winid% ;Now let's get tracker list for the torrent file. Unfortunately we have to open the 'Advanced..' window, to see trackers.. ControlClick,Button12,Add New Torrent ahk_id %winid% WinWait,Torrent Properties ahk_class #32770,,2.0 var_PropertiesWinID := WinExist("Torrent Properties ahk_class #32770") if (var_PropertiesWinID) { ControlGetText,var_TrackerList,Edit1,Torrent Properties ahk_id %var_PropertiesWinID% WinKill,Torrent Properties ahk_id %var_PropertiesWinID% } ;Next let's replace the '.' (period) 's from the file name. Since this is quite common among torrent files. StringReplace,var_FileName,var_FileName,.,%A_Space%,1 ;Now get the Labels and the keywords assigned to that label in one giant string. if !(FileExist("Labeler_Settings.ini")) { GoSub,sub_IniWrite } IniRead,var_IniOut,Labeler_Settings.ini,LABELS j := 0 ;First loops parses the giant string by line feeds.so we have 'LABEL1=KEYWORDS1', then next loop 'LABEL2=KEYWORDS2' ,.. etc Loop,Parse,var_IniOut,`n, { asd := A_LoopField Loop,Parse,asd,=, { ;This Loop seperates the Label and the Keyword list. For this example let's say LABEL1 and KEYWORDS1. if (j = 0) var_Label := A_LoopField ;LABEL1 else var_LabelList := A_LoopField ;KEYWORDS1 j++ } j := 0 ;First let's check if any of KEYWORDS1 is present in the Torrents Trackers if var_TrackerList contains %var_LabelList% { previouswindowsstring .= " " winid " " ;One of the keywords from KEYWORDS1 was matched with a tracker in the torrent. So LABEL1 must be selected from the combobox. Control,ChooseString,%var_Label%,ComboBox2,Add New Torrent ahk_id %winid% Return ; Return since we don't need to check LABEL2,LABEL3,..etc } ;Now Let's Check if any of KEYWORDS1 is present in the file name. if var_FileName contains %var_LabelList% { previouswindowsstring .= " " winid " " ;One of the keywords from KEYWORDS1 was matched in the file name.So LABEL1 must be selected from the combobox. Control,ChooseString,%var_Label%,ComboBox2,Add New Torrent ahk_id %winid% Return ; Return since we don't need to check LABEL2,LABEL3,..etc } }}sub_IniWrite:IniWrite,House`,How I Met Your Mother`,The Big Bang Theory,Labeler_Settings.ini,LABELS,TV-ShowsReturnsub_ClearPreviousWindows:var_PreviousWindows := ""SetTimer,sub_ClearPreviousWindowsReturnYou can compile this with the compiler at Autohotkey.com =] Add any thing you like. Link to comment Share on other sites More sharing options...
antoniocarlosribeiro Posted August 11, 2012 Report Share Posted August 11, 2012 That's an amazing app!I'm not an AutoHotKey programmer, Is there too much to do to port it to 3.2?Thanks! Link to comment Share on other sites More sharing options...
spdmn Posted August 24, 2012 Report Share Posted August 24, 2012 This is really great and the closest I've seen anyone get to almost getting this done. But alas, I say almost because it only (semi)works for me.. It changes to the right label at the pop screen (which is an improvement),but doesn't close it automatically. I have to.Any ideas as to why? Was this intended? Link to comment Share on other sites More sharing options...
mukunku Posted September 8, 2012 Author Report Share Posted September 8, 2012 That's an amazing app!I'm not an AutoHotKey programmer, Is there too much to do to port it to 3.2?Thanks! I can't work on the code right now but if you were to change this line:ControlClick,Button12,Add New Torrent ahk_id %winid%to:ControlClick,Button13,Add New Torrent ahk_id %winid%and then compile it,The program will work on 3.2 too.This is really great and the closest I've seen anyone get to almost getting this done. But alas, I say almost because it only (semi)works for me.. It changes to the right label at the pop screen (which is an improvement),but doesn't close it automatically. I have to.Any ideas as to why? Was this intended?It was intended that way because the user may want to select which files to download. But that's a good functionality that could be added. Again, I can't work on the original code right now, but if you were to edit the code (post #20) and compile it, you could achieve this functionality yourself.Note: This will work for uTorrent 3.2To achieve your requested functionality, change: ;First let's check if any of KEYWORDS1 is present in the Torrents Trackers if var_TrackerList contains %var_LabelList% { previouswindowsstring .= " " winid " " ;One of the keywords from KEYWORDS1 was matched with a tracker in the torrent. So LABEL1 must be selected from the combobox. Control,ChooseString,%var_Label%,ComboBox2,Add New Torrent ahk_id %winid% Return ; Return since we don't need to check LABEL2,LABEL3,..etc } ;Now Let's Check if any of KEYWORDS1 is present in the file name. if var_FileName contains %var_LabelList% { previouswindowsstring .= " " winid " " ;One of the keywords from KEYWORDS1 was matched in the file name.So LABEL1 must be selected from the combobox. Control,ChooseString,%var_Label%,ComboBox2,Add New Torrent ahk_id %winid% Return ; Return since we don't need to check LABEL2,LABEL3,..etc }To: ;First let's check if any of KEYWORDS1 is present in the Torrents Trackers if var_TrackerList contains %var_LabelList% { previouswindowsstring .= " " winid " " ;One of the keywords from KEYWORDS1 was matched with a tracker in the torrent. So LABEL1 must be selected from the combobox. Control,ChooseString,%var_Label%,ComboBox2,Add New Torrent ahk_id %winid% ControlClick,Button14,Add New Torrent ahk_id %winid% Return ; Return since we don't need to check LABEL2,LABEL3,..etc } ;Now Let's Check if any of KEYWORDS1 is present in the file name. if var_FileName contains %var_LabelList% { previouswindowsstring .= " " winid " " ;One of the keywords from KEYWORDS1 was matched in the file name.So LABEL1 must be selected from the combobox. Control,ChooseString,%var_Label%,ComboBox2,Add New Torrent ahk_id %winid% ControlClick,Button14,Add New Torrent ahk_id %winid% Return ; Return since we don't need to check LABEL2,LABEL3,..etc }I'm going to work on this program in the near future and try to add all the requested functionalities. Hopefully with some gui Link to comment Share on other sites More sharing options...
spdmn Posted September 13, 2012 Report Share Posted September 13, 2012 Thanks for the reply and looking forward to an update. Link to comment Share on other sites More sharing options...
Siggers Posted October 9, 2012 Report Share Posted October 9, 2012 hey this is good and all but i have edited the .ini file and started the labeler.exe and it its not working my .ini looks like this:[LABELS]TV-Shows=American Dad,How I Met Your Mother,The Big Bang Theory,Burn Notice,Castle,Family Guy,Merlin,Shameless,Star Wars The Clone Wars,Supernatural,The Mentalist,The Simpsons,Two and a Half Men,The Middlecan u tell me why its not working? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.