Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[ff9f0d]: plugin.video.pelisalacarta / channels / cine15.py Maximize Restore History

Download this file

cine15.py    213 lines (168 with data), 8.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para cine15
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
import scrapertools
import servertools
import logger
import buscador
from item import Item
CHANNELNAME = "cine15"
DEBUG = True
def isGeneric():
return True
def mainlist(item):
logger.info("[cine15.py] mainlist")
itemlist = []
itemlist.append( Item(channel=CHANNELNAME, action="listvideos" , title="Películas - Novedades" ,url="http://www.cine15.com/"))
itemlist.append( Item(channel=CHANNELNAME, action="peliscat" , title="Películas - Lista por categorías" ,url="http://www.cine15.com/"))
#itemlist.append( Item(channel=CHANNELNAME, action=""search" , category , "Buscar" ,"","","")
return itemlist
def search(item):
buscador.listar_busquedas(params,url,category)
def searchresults(item):
logger.info("[cine15.py] search")
buscador.salvar_busquedas(params,url,category)
tecleado = url.replace(" ", "+")
searchUrl = "http://www.cine15.com/?s="+tecleado+"&x=0&y=0"
listvideos(params,searchUrl,category)
def performsearch(texto):
logger.info("[cine15.py] performsearch")
url = "http://www.cine15.com/?s="+texto+"&x=0&y=0"
# Descarga la página
data = scrapertools.cachePage(url)
# Extrae las entradas (carpetas)
patronvideos = '<div class="videoitem">[^<]+'
patronvideos += '<div class="ratings">[^<]+'
patronvideos += '<div id="post-ratings[^>]+><img[^>]+><img[^>]+><img[^>]+><img[^>]+><img[^>]+></div>[^<]+'
patronvideos += '<div id="post-ratings[^>]+><img[^>]+>&nbsp;Loading ...</div>[^<]+'
patronvideos += '</div>[^<]+'
patronvideos += '<div class="comments">[^<]+</div>[^<]+'
patronvideos += '<div class="thumbnail">[^<]+'
patronvideos += '<a href="([^"]+)" title="([^"]+)"><img style="background: url\(([^\)]+)\)" [^>]+></a>[^<]+'
patronvideos += '</div>[^<]+'
patronvideos += '<h2 class="itemtitle"><a[^>]+>[^<]+</a></h2>[^<]+'
patronvideos += '<p class="itemdesc">([^<]+)</p>[^<]+'
patronvideos += '<small class="gallerydate">([^<]+)</small>'
matches = re.compile(patronvideos,re.DOTALL).findall(data)
scrapertools.printMatches(matches)
resultados = []
for match in matches:
scrapedtitle = match[1]
scrapedurl = urlparse.urljoin(url,match[0])
scrapedthumbnail = urlparse.urljoin(url,match[2])
scrapedplot = match[3]
if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")
# Ańade al listado de XBMC
resultados.append( [CHANNELNAME , "detail" , "buscador" , scrapedtitle , scrapedurl , scrapedthumbnail, scrapedplot ] )
return resultados
def peliscat(item):
logger.info("[cine15.py] peliscat")
# Descarga la página
data = scrapertools.cachePage(item.url)
# Extrae las entradas (carpetas)
patronvideos = '<li class="cat-item cat-item[^"]+"><a href="([^"]+)" title="[^"]+">([^<]+)</a>'
matches = re.compile(patronvideos,re.DOTALL).findall(data)
scrapertools.printMatches(matches)
itemlist = []
for match in matches:
scrapedtitle = match[1]
scrapedurl = urlparse.urljoin(item.url,match[0])
scrapedthumbnail = ""
scrapedplot = ""
if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")
itemlist.append( Item(channel=CHANNELNAME, action="listvideos", title=scrapedtitle , url=scrapedurl , thumbnail=scrapedthumbnail , plot=scrapedplot , folder=True) )
return itemlist
def listvideos(item):
logger.info("[cine15.py] listvideos")
# Descarga la página
data = scrapertools.cachePage(item.url)
#logger.info(data)
# Extrae las entradas (carpetas)
'''
<div class="thumbnail-div">
<a href="http://www.cine15.com/peliculas/accion/zombieland/" title="Zombieland"> <img src="http://www.cine15.com/wp-content/themes/cine2.00/timthumb.php?src=http://www.cine15.com/wp-content/uploads/2010/05/x14z.jpg&amp;h=225&amp;w=141&amp;q=80&amp;zc=1" alt="" style="border: none;" /> </a>
<div id="play">
<ul class="playimg">
<li><a href="http://www.cine15.com/peliculas/accion/zombieland/" class="boton" ></a></li>
</ul></div>
<div class="post-info2">
<h2><a href="http://www.cine15.com/peliculas/accion/zombieland/" class="post-info-title" title="Permanent Link to Zombieland">
Zombieland... </a></h2>
<p class="itemdesc">TÍTULO ORIGINAL: Zombieland
AŃO: 2009 Ver trailer externo
DURACIÓN: ...</p>
'''
patronvideos = '<div class="thumbnail-div">[^<]+'
patronvideos += '<a href="([^"]+)" title="([^"]+)"> <img src="([^"]+)"'
matches = re.compile(patronvideos,re.DOTALL).findall(data)
scrapertools.printMatches(matches)
itemlist = []
for match in matches:
scrapedtitle = match[1]
scrapedurl = urlparse.urljoin(item.url,match[0])
scrapedthumbnail = urlparse.urljoin(item.url,match[2])
scrapedplot = ""
if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")
# Ańade al listado de XBMC
itemlist.append( Item(channel=CHANNELNAME, action="detail", title=scrapedtitle , url=scrapedurl , thumbnail=scrapedthumbnail , plot=scrapedplot , folder=True) )
# Extrae la marca de siguiente página
patronvideos = "<span class='current'>[^<]+</span><a href='([^']+)' class='page'>"
matches = re.compile(patronvideos,re.DOTALL).findall(data)
scrapertools.printMatches(matches)
if len(matches)>0:
scrapedtitle = "Página siguiente"
scrapedurl = urlparse.urljoin(item.url,matches[0])
scrapedthumbnail = ""
scrapedplot = ""
itemlist.append( Item(channel=CHANNELNAME, action="listvideos", title=scrapedtitle , url=scrapedurl , thumbnail=scrapedthumbnail , plot=scrapedplot , folder=True) )
return itemlist
def detail(item):
logger.info("[cine15.py] detail")
title = item.title
thumbnail = item.thumbnail
plot = item.plot
# Descarga la página
data = scrapertools.cachePage(item.url)
#logger.info(data)
# ------------------------------------------------------------------------------------
# Busca los enlaces a videos no megavideo (playlist xml)
# ------------------------------------------------------------------------------------
patronvideos = 'flashvars[^f]+file=([^\&]+)\&amp'
matches = re.compile(patronvideos,re.DOTALL).findall(data)
scrapertools.printMatches(matches)
itemlist = []
if len(matches)>0:
if ("xml" in matches[0]):
data2 = scrapertools.cachePage(matches[0])
logger.info("data2="+data2)
patronvideos = '<track>[^<]+'
patronvideos += '<title>([^<]+)</title>[^<]+'
patronvideos += '<location>([^<]+)</location>[^<]+'
patronvideos += '</track>'
matches = re.compile(patronvideos,re.DOTALL).findall(data2)
scrapertools.printMatches(matches)
for match in matches:
scrapedtitle = match[0]
scrapedurl = match[1].strip()
scrapedthumbnail = thumbnail
scrapedplot = plot
if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")
itemlist.append( Item(channel=CHANNELNAME, action="play" , title=scrapedtitle + " [Directo]" , url=scrapedurl, thumbnail=scrapedthumbnail, plot=scrapedplot, server="Directo", folder=False))
else:
itemlist.append( Item(channel=CHANNELNAME, action="play" , title=title + " [Directo]" , url=matches[0], thumbnail=thumbnail, plot=plot, server="Directo", folder=False))
# ------------------------------------------------------------------------------------
# Busca los enlaces a los videos
# ------------------------------------------------------------------------------------
listavideos = servertools.findvideos(data)
for video in listavideos:
videotitle = video[0]
url = video[1]
server = video[2]
itemlist.append( Item(channel=CHANNELNAME, action="play" , title=title.strip() + " - " + videotitle , url=url, thumbnail=thumbnail, plot=plot, server=server, folder=False))
# ------------------------------------------------------------------------------------
return itemlist