DaProgrammer Posted November 14, 2007 Share Posted November 14, 2007 (edited) How To :1) Create Settings.INI and Filters.INI and copy the content from here (customize if needed)2) Create Something.au3 and copy the script.3) Complile and run4) When an episode from your favorite show is relesed it will be automaticly added to UTorrent.Completely remade now uses INI files for settings in a step towards GUI Settings.u must have these 2 files in the script folder, of course Filters should be customized to your needs.Settings.INICODE[Global]FeedURL=http://tvrss.net/feed/eztv/TorrentClient=C:\Program Files\uTorrent\uTorrent.exeFilters.INICODE[1]MustHave=Prison|Break|HDTVCantHave=720P|HR[2]MustHave=Heroes|HDTVCantHave=720P|HR[3]MustHave=Nip|TuckCantHave=[4]MustHave=Scrubs[5]MustHave=Numb3rs|HDTVCantHave=720P|HR[6]MustHave=House|HDTVCantHave=720P|HR[7]MustHave=Smallville|HDTVCantHave=720P|HRexpandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=0006.ico #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Allow_Decompile=n #AutoIt3Wrapper_AU3Check_Stop_OnWarning=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <INet.au3> #include <String.au3> ;~ #include <KJ.au3> ;~ #include <Array.au3> Opt("MustDeclareVars", 1) ;~ Opt("TrayIconDebug", 1) IniWrite(@ScriptDir & "\Downloaded.ini", "Files", "0", "0") Global $TorrentClient = IniRead(@ScriptDir & "\Settings.ini", "Global", "TorrentClient", "") While 1 Local $a = Check() If $a = -1 Then Sleep(300000) ContinueLoop EndIf Sleep(3600000) WEnd Func Check() Local $i, $i2, $i3 Local $Source = IniRead(@ScriptDir & "\Settings.ini", "Global", "FeedURL", "") Local $Feed = _INetGetSource($Source) If @error Or StringLen($Feed) < 5000 Then Return -1 Local $Title = _StringBetween($Feed, "<title>", "</title>") Local $Link = _StringBetween($Feed, "<link>", "</link>") Local $PubDate = _StringBetween($Feed, "<pubdate>", "</pubdate>") Local $List = IniReadSection(@ScriptDir & "\Downloaded.ini", "Files") Local $FiltersTemp = IniReadSectionNames(@ScriptDir & "\Filters.ini") Local $Filters[$FiltersTemp[0] + 1][2] $Filters[0][0] = $FiltersTemp[0] For $i = 1 To $FiltersTemp[0] $Filters[$i][0] = IniRead(@ScriptDir & "\Filters.ini", $FiltersTemp[$i], "MustHave", "") $Filters[$i][1] = IniRead(@ScriptDir & "\Filters.ini", $FiltersTemp[$i], "CantHave", "") Next For $i = 1 To UBound($Title) - 1 For $i2 = 1 To $Filters[0][0] Local $Filter1 = StringSplit($Filters[$i2][0], "|") Local $Filter2 = StringSplit($Filters[$i2][1], "|") For $i3 = 1 To $Filter1[0] If Not StringInStr($Title[$i], $Filter1[$i3]) Then ContinueLoop 2 Next For $i3 = 1 To $Filter2[0] If StringInStr($Title[$i], $Filter2[$i3]) Then ContinueLoop 2 Next If Not Inlist($Title[$i], $List) Then Download($Title[$i], $Link[$i]) Next Next ;~ If IniRead(@ScriptDir & "\Settings.ini", "Stats", "Last Torrent Published", "") <> $PubDate[0] Then ;~ IniWrite(@ScriptDir & "\Settings.ini", "Stats", "Last Torrent Published Time", _Date ("Long")) ;~ IniWrite(@ScriptDir & "\Settings.ini", "Stats", "Last Torrent Published", $PubDate[0]) ;~ EndIf ;~ IniWrite(@ScriptDir & "\Settings.ini", "Stats", "Last RSS Feed Check", _Date ("Long")) EndFunc ;==>Check Func Download($TempTitle, $TempLink) Local $FileName = @ScriptDir & "\z.torrent" If Not InetGet($TempLink, $FileName, 1, 0) Then Return -1 Sleep(5000) ShellExecute($TorrentClient, ' "' & $FileName & '"') IniWrite(@ScriptDir & "\Downloaded.ini", "Files", $TempTitle, "1") Sleep(5000) FileDelete($FileName) Sleep(5000) EndFunc ;==>Download Func Inlist($TitleToCheck, $TempList) Local $Count For $Count = 1 To $TempList[0][0] If $TempList[$Count][0] = $TitleToCheck Then Return 1 Next Return 0 EndFunc ;==>InlistPlz Post comments and bugs if you encounter any. Edited November 16, 2007 by DaProgrammer Link to comment Share on other sites More sharing options...
DaProgrammer Posted November 16, 2007 Author Share Posted November 16, 2007 Big Update Link to comment Share on other sites More sharing options...
Buey Posted November 17, 2007 Share Posted November 17, 2007 uTorrent already has a fairly powerful RSS Feed downloader, how does this differ from the one already there? Link to comment Share on other sites More sharing options...
DaProgrammer Posted November 17, 2007 Author Share Posted November 17, 2007 uTorrent already has a fairly powerful RSS Feed downloader, how does this differ from the one already there?i wrote before i remade the first post that UTorrents RSS didnt work for me and gave me hell, so for all ya out there with the same problem besides this is made in autoit so its much more customizable if u know ur way around here. Link to comment Share on other sites More sharing options...
Ahmedmb Posted December 4, 2007 Share Posted December 4, 2007 Very Good Link to comment Share on other sites More sharing options...
jonessc Posted January 2, 2008 Share Posted January 2, 2008 This is a very nice script, and way simpler to use than the RSS feeds built into UTorrent Well done I am a complete beginner using AIT but ive managed to figure the basics Im playing with your code, to try and add a 'View Downloads", 'Exit' and 'TV Airing Schedule' to the tray menu Also trying to add Traypopups with the name of the download added while the program is running. Wots the best way to get this data from the ini file (I believe downloaded.ini) ie if an episode of prison break is added the tray will popup with 'Prison break added) etc Cheers! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now