# -*- coding: utf-8 -*- # import urllib, urllib2, re, sys, os # web- def GetHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urlencode({}), headers)) html = conn.read() conn.close() return html # html = GetHTML('http://www.linecinema.org/') print html
python test.py
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<a href="/newsz/drama-online/" title="" class="mainmenu"></a><br />
print html
genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251')) # (.+?) url title ( ) for url, title in genre_links: print title + ' [' + url + ']'
python test.py
isLinkUseful()
, especially for the Site, isLinkUseful()
"extra" links will be declared inside: def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] # ββ return needle not in haystack
for url, title in genre_links: if isLinkUseful(url): print title + ' [' + url + ']'
#url = 'http://www.linecinema.org/' #html = GetHTML(url) #genre_links = re.compile('<a href="(.+?)">(.+?)</a>').findall(html.decode('windows-1251')) #for url, title in genre_links: #if isLinkUseful(url): #print title + ' [' + url + ']' url = 'http://www.linecinema.org/newsz/dokumentalnyij-online/' html = GetHTML(url) genre_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251')) for url, title in genre_links: print title
(.+?)
(.+?)
, we would get all the links from the page. And we need it?[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .
ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .
ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .
ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .
ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .
ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .
ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .
ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .
ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .
ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .
ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .
ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
[.].
( , - ) :
plugin.video.linecinema
. // add-on' ( , -) , :
addon.py
addon.xml
changelog.txt
fanart.jpg
icon.png
LICENSE.txt
/resources
settings.xml
/language/
/lib/
/media/
addon.py β . , ( addon.xml). default.py addon.xml β XBMC: (, , , ); ( *.py); ; , . . changelog.txt , LICENSE.txt β , . fanart.jpg β . . icon.png β "" . . /resources/settings.xml β (, , / ), .. , addon.py. , , . . /resources/language/ - . , , . /resources/lib/ - Python. /resources/media/ - , , . .
: addon.py, addon.xml β¦ . , .
addon.xml:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <addon id="plugin.video.linecinema" name="LineCinema" version="0.0.1" provider-name="noname"> <requires> <import addon="xbmc.python" version="1.0"/> </requires> <extension point="xbmc.python.pluginsource" provides="video" library="addon.py"> <provides>video</provides> </extension> <extension point="xbmc.addon.metadata"> <summary>LineCinema.org</summary> <description> , . LineCinema.org </description> <platform>all</platform> </extension> </addon>
. XBMC , "plugin.video.linecinema", "LineCinema", 0.0.1, "noname".
/>
, xbmc.python 1.0.
video
β "addon.py". " ".
, addon.xml .
addon.py:
# -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui 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
xbmcplugin xbmcgui β xbmc.python.
get_params()
β , , . , , . , . , , .
:
def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True)
addDir(title, url, mode)
β . Mode
β , ( ).
addLink(title, url)
β , url
. url
// ..
:
params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
" ". xbmcplugin.endOfDirectory(int(sys.argv[1]))
XBMC, "" .
. getHTML(url)
isLinkUseful(needle)
addon.py :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass xbmcplugin.endOfDirectory(int(sys.argv[1]))
? , .
: ; ; . . : Categories() β , Movies() β , Videos() β . :
def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20)
addDir(title, url + link, 20)
print title + ' [' + url + ']'
. Categories()
- url
. , β link
.
20
β , Movies(url)
. , xbmcplugin.endOfDirectory(int(sys.argv[1]))
, :
if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title)
? ? , . , , , . .
:
def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30)
. title[:-12]
? [:-12], , " / Magnificent movie (2013) HDRip ". ""? !
. . , ! :
<script language="javascript"> flashvars = { uid: "player_uppod", bufferproc2 :1, bufferproc_reloadsec :10, st: "/templates/linecinema-dle90/swf/video30-365.txt", file: "http://st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv" }; params = {bgcolor:"#ffffff", allowFullScreen:"true", allowScriptAccess:"always",wmode:"opaque"}; attributes = { id: "player_uppod", name: "player_uppod" }; swfobject.embedSWF("/templates/linecinema-dle90/swf/uppod.swf", "player_uppod", "570", "440", "10.0.0",false,flashvars,params,attributes); </script>
: st7.linecinema.org/s/820e31e7cbe3e8c362785b733db56c57/film10/Druzea.navek.DVDRip.flv
( ). :
def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link)
. :
addon.py # -*- coding: utf-8 -*- import urllib, urllib2, re, sys import xbmcplugin, xbmcgui def getHTML(url): headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3', 'Content-Type':'application/x-www-form-urlencoded'} conn = urllib2.urlopen(urllib2.Request(url, urllib.urlencode({}), headers)) html = conn.read() conn.close() return html def isLinkUseful(needle): haystack = ['/index.php', '/newsz/Televydenye/100432-2008-3-11-432.html', '/newsz/500183-tex-podderzhka.html'] return needle not in haystack def Categories(): url = 'http://www.linecinema.org' html = getHTML(url) genre_links = re.compile('<a href="(.+?)" title="" class="mainmenu">(.+?)</a><br />').findall(html.decode('windows-1251').encode('utf-8')) for link, title in genre_links: if isLinkUseful(link): addDir(title, url + link, 20) def Movies(url): html = getHTML(url) movie_links = re.compile('<h1> <a href="(.+?)">(.+?)</a> </h1>').findall(html.decode('windows-1251').encode('utf-8')) for link, title in movie_links: addDir(title[:-12], link, 30) def Videos(url, title): html = getHTML(url) link = re.compile('file: "(.+?)"').findall(html.decode('windows-1251').encode('utf-8'))[0] addLink(title, link) 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 def addLink(title, url): item = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=url, listitem=item) def addDir(title, url, mode): sys_url = sys.argv[0] + '?title=' + urllib.quote_plus(title) + '&url=' + urllib.quote_plus(url) + '&mode=' + urllib.quote_plus(str(mode)) item = xbmcgui.ListItem(title, iconImage='DefaultFolder.png', thumbnailImage='') item.setInfo( type='Video', infoLabels={'Title': title} ) xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys_url, listitem=item, isFolder=True) params = get_params() url = None title = None mode = None try: title = urllib.unquote_plus(params['title']) except: pass try: url = urllib.unquote_plus(params['url']) except: pass try: mode = int(params['mode']) except: pass if mode == None: Categories() elif mode == 20: Movies(url) elif mode == 30: Videos(url, title) xbmcplugin.endOfDirectory(int(sys.argv[1]))
-, . : ZIP. . ZIP (!) . XBMC, () > > ZIP . , " ", > > LineCinema .




ZIP : HOW-TO:Write plugins for XBMC (wiki) XBMC Addon Developers Guide (pdf) : 3rd party add-on repositories XBMC Russia XBMC Community Forum
. β¦ . , , .
PS , .
Source: https://habr.com/ru/post/166097/
All Articles