2011-02-22, 01:54
grajen3 Wrote:right, sorry for misleading You
...
[/code]
thanks again, will try it out tomorrow!
grajen3 Wrote:right, sorry for misleading You
...
[/code]
21:45:00 T:504 M:2348601344 NOTICE: one
21:45:00 T:504 M:2348564480 DEBUG: Win32DllLoader::Load(ADVAPI32.DLL)
21:45:00 T:504 M:2348564480 DEBUG: Win32DllLoader::Load(KERNEL32.DLL)
21:45:00 T:504 M:2348564480 DEBUG: Win32DllLoader::Load(USER32.DLL)
21:45:00 T:504 M:2348564480 DEBUG: Win32DllLoader::Load(NETAPI32.DLL)
21:45:00 T:504 M:2348564480 DEBUG: FreeLibrary(NETAPI32.DLL) -> 07BF6268
21:45:00 T:504 M:2348564480 DEBUG: Win32DllLoader::Unload NETAPI32.DLL
21:45:00 T:504 M:2348564480 DEBUG: FreeLibrary(ADVAPI32.DLL) -> 07BF64E8
21:45:00 T:504 M:2348564480 DEBUG: Win32DllLoader::Unload ADVAPI32.DLL
21:45:00 T:504 M:2348564480 DEBUG: FreeLibrary(USER32.DLL) -> 07BF5CA8
21:45:00 T:504 M:2348564480 DEBUG: Win32DllLoader::Unload USER32.DLL
21:45:10 T:504 M:2348662784 DEBUG: FreeLibrary(KERNEL32.DLL) -> 07BF69E8
21:45:10 T:504 M:2348662784 DEBUG: Win32DllLoader::Unload KERNEL32.DLL
21:45:11 T:504 M:2348621824 NOTICE: two
import string, urllib2, urllib, re, cookielib, xbmc, xbmcgui, xbmcplugin, sys, os, traceback, xbmcaddon, string
__settings__ = xbmcaddon.Addon(id='plugin.video.torrentsite')
username = __settings__.getSetting('username')
user_password = __settings__.getSetting('user_password')
downloadPath = __settings__.getSetting('downloadPath')
print 'username: ' + username
print 'user_password: ' + user_password
print 'downloadPath: ' + downloadPath
def addLink(name,url,mode,iconimage):
u = sys.argv[0] + '?url=' + urllib.quote_plus(url) + '&mode='+str(mode) + '&name=' +urllib.quote_plus(name)
ok = True
liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
liz.setInfo( type="Video", infoLabels={ "Title": name } )
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz)
return ok
def addDir(name,url,mode,iconimage):
u=sys.argv[0]+'?url='+urllib.quote_plus(url)+'&mode='+str(mode)+'&name='+urllib.quote_plus(name)
ok=True
liz=xbmcgui.ListItem(name, iconImage='DefaultFolder.png',thumbnailImage=iconimage)
liz.setInfo( type='Video', infoLabels={ 'Title': name })
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
return ok
def CATEGORIES():
addDir('Ordered by amount of leechers','http://torrentsite.com/browse.php?c1=1&co1=1&m3=1&page=0&sort=leechers&h=11&d=DESC',1,'')
addDir("Ordered by amount of seeders",'http://torrentsite.com/browse.php?c1=1&co1=1&m3=1&sort=seeders&h=10&d=DESC',1,'')
addDir("Ordered by date added",'https://torrentsite.com/browse.php?c1=1&co1=1&m3=1&incldead=0&descriptions=0&from=&to=&imdbgt=0&imdblt=10&uppedby=&imdb=&search=',1,'')
def DOWNLOAD():
url=urllib.unquote_plus(params['url'])
name=urllib.unquote_plus(params['name'])
resp = opener.open(url)
svar4 = resp.read()
resp.close()
valid_chars = "-_.() %s%s" % (string.ascii_letters, string.digits)
cleanfilename = ''.join(c for c in name if c in valid_chars)
torrent_filename = downloadPath + '/' + cleanfilename + '.torrent'
torrent_file = open(torrent_filename, 'wb')
torrent_file.write(svar4)
torrent_file.close()
def TORRENTS(url):
movies = [['null']*3 for i in range(25)]
print 'three'
resp = opener.open(url)
print 'four'
svar2 = resp.read()
resp.close()
items = re.compile('<a href="details\.php\?id=(.+?)&hit=1">(.+?)</a>.+?<a href="http://www\.imdb\.com/title/tt(.+?)/">IMDB').findall(svar2)
for i in range(0, len(items)):
movies[i][0] = str('https://torrentsite.com/download.php?id=' + items[i][0])
movies[i][1] = str(items[i][1])
movies[i][2] = str('https://torrentsite.com/pic/imdb_poster_cache/' + items[i][2] + '_big.jpg')
xbmc
addLink(movies[i][1], movies[i][0], 2, movies[i][2])
url=None
name=None
mode=None
def get_params():
param=[]
paramstring=sys.argv[2]
if len(paramstring)>=2:
params=sys.argv[2]
cleanedparams=params.replace('?','')
if (params[len(params)-1]=='/'):
params=params[0:len(params)-2]
pairsofparams=cleanedparams.split('&')
param={}
for i in range(len(pairsofparams)):
splitparams={}
splitparams=pairsofparams[i].split('=')
if (len(splitparams))==2:
param[splitparams[0]]=splitparams[1]
return param
params = get_params();
try:
url=urllib.unquote_plus(params['url'])
except:
pass
try:
name=urllib.unquote_plus(params['name'])
except:
pass
try:
mode=int(params['mode'])
except:
pass
if mode==1 or mode==2:
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)
print 'one'
resp = opener.open('https://torrentsite.com/login.php')
print 'two'
svar3 = resp.read()
resp.close()
lols = re.compile('<input type="hidden" name="lol" value="(.+?)" />').findall(svar3)
if len(lols) == 1:
lol = str(lols[0])
data = urllib.urlencode({'uname':username,'password':user_password,'lol':lol})
resp = opener.open('https://torrentsite.com/takelogon.php', data)
svar1 = resp.read()
resp.close()
if mode==None or url==None or len(url)<1:
CATEGORIES()
elif mode==1:
TORRENTS(url)
elif mode==2:
DOWNLOAD()
TORRENTS(url)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
unom Wrote:Could you post a link where i could get this code to install? thanks