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

Download this file

85 lines (65 with data), 2.8 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
# -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para capitancinema
# 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 = "capitancinema"
DEBUG = True
def isGeneric():
return True
def mainlist(item):
logger.info("[capitancinema.py] mainlist")
itemlist=[]
itemlist.append( Item(channel=CHANNELNAME, action="novedades" , title="Películas - Novedades" , url="http://www.capitancinema.com/peliculas-online-novedades.htm"))
return itemlist
def novedades(item):
logger.info("[capitancinema.py] novedades")
# Descarga la página
data = scrapertools.cachePage(item.url)
# Extrae las entradas (carpetas)
patronvideos = '<td width="23\%"><a href="([^"]+)"[^>]+><img style="[^"]+" src="([^"]+)" border="0" alt="([^"]+)"[^>]+></a></td>'
matches = re.compile(patronvideos,re.DOTALL).findall(data)
scrapertools.printMatches(matches)
itemlist=[]
for match in matches:
# Atributos
scrapedtitle = match[2]
scrapedtitle = scrapedtitle.replace("&quot;","")
scrapedtitle = scrapertools.entityunescape(scrapedtitle)
scrapedurl = urlparse.urljoin(item.url,match[0])
scrapedthumbnail = urlparse.urljoin(item.url,match[1])
scrapedplot = ""
if (DEBUG): logger.info("title=["+scrapedtitle+"], url=["+scrapedurl+"], thumbnail=["+scrapedthumbnail+"]")
itemlist.append( Item(channel=CHANNELNAME, action="mirrors", title=scrapedtitle , url=scrapedurl , thumbnail=scrapedthumbnail , plot=scrapedplot , folder=True) )
return itemlist
def mirrors(item):
logger.info("[capitancinema.py] mirrors")
title = item.title
thumbnail = item.thumbnail
plot = item.plot
# Descarga la página
data = scrapertools.cachePage(item.url)
patronvideos = '<li><strong>DISPONIBLE EN EL FORO</strong>[^<]+<a href="([^"]+)"'
matches = re.compile(patronvideos,re.DOTALL).findall(data)
itemlist = []
if len(matches)>0:
url = matches[0]
data = scrapertools.cachePage(url)
# ------------------------------------------------------------------------------------
# Busca los enlaces a los videos
# ------------------------------------------------------------------------------------
listavideos = servertools.findvideos(data)
for video in listavideos:
scrapedtitle = title.strip() + " - " + video[0]
scrapedurl = video[1]
server = video[2]
itemlist.append( Item(channel=CHANNELNAME, action="play" , title=scrapedtitle , url=scrapedurl, thumbnail=item.thumbnail, plot=item.plot, server=server, folder=False))
return itemlist

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks