Sign in to follow this  
Followers 0
DaProgrammer

Download Your Favorite Shows Automaticly

6 posts in this topic

#1 ·  Posted (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 run

4) 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.INI

CODE
[Global]

FeedURL=http://tvrss.net/feed/eztv/

TorrentClient=C:\Program Files\uTorrent\uTorrent.exe

Filters.INI

CODE
[1]

MustHave=Prison|Break|HDTV

CantHave=720P|HR

[2]

MustHave=Heroes|HDTV

CantHave=720P|HR

[3]

MustHave=Nip|Tuck

CantHave=

[4]

MustHave=Scrubs

[5]

MustHave=Numb3rs|HDTV

CantHave=720P|HR

[6]

MustHave=House|HDTV

CantHave=720P|HR

[7]

MustHave=Smallville|HDTV

CantHave=720P|HR

#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   ;==>Inlist

Plz Post comments and bugs if you encounter any.

Edited by DaProgrammer

Share this post


Link to post
Share on other sites

Big Update :P


Share this post


Link to post
Share on other sites

uTorrent already has a fairly powerful RSS Feed downloader, how does this differ from the one already there?

Share this post


Link to post
Share on other sites

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 :P

besides this is made in autoit ;) so its much more customizable if u know ur way around here.


Share this post


Link to post
Share on other sites

Very Good

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0