pornboss: cambio de estructura porntrex: cambio estructura y thumbnail videosXYZ: cambio de estructura xms: cambio host
70 lines
2.8 KiB
Python
70 lines
2.8 KiB
Python
# -*- coding: utf-8 -*-
|
|
#------------------------------------------------------------
|
|
import urlparse,urllib2,urllib,re
|
|
import os, sys
|
|
from core import scrapertools
|
|
from core import servertools
|
|
from core.item import Item
|
|
from platformcode import config, logger
|
|
from core import httptools
|
|
|
|
host = 'http://free-porn-videos.xyz'
|
|
|
|
def mainlist(item):
|
|
logger.info()
|
|
itemlist = []
|
|
itemlist.append( Item(channel=item.channel, title="Peliculas" , action="lista", url=host + "/topics/adult-movie/"))
|
|
itemlist.append( Item(channel=item.channel, title="Parody" , action="lista", url=host + "/topics/free-porn-parodies/"))
|
|
itemlist.append( Item(channel=item.channel, title="Videos" , action="lista", url=host + "/topics/porn-videos/"))
|
|
itemlist.append( Item(channel=item.channel, title="BigTits" , action="lista", url=host + "/?s=big+tit"))
|
|
itemlist.append( Item(channel=item.channel, title="Buscar", action="search"))
|
|
return itemlist
|
|
|
|
|
|
def search(item, texto):
|
|
logger.info()
|
|
texto = texto.replace(" ", "+")
|
|
item.url = host + "/?s=%s" % texto
|
|
try:
|
|
return lista(item)
|
|
except:
|
|
import sys
|
|
for line in sys.exc_info():
|
|
logger.error("%s" % line)
|
|
return []
|
|
|
|
|
|
def lista(item):
|
|
logger.info()
|
|
itemlist = []
|
|
data = httptools.downloadpage(item.url).data
|
|
patron = '<article id="post-\d+".*?<a href="([^"]+)".*?data-src="([^"]+)".*?alt="([^"]+)"'
|
|
matches = re.compile(patron,re.DOTALL).findall(data)
|
|
scrapertools.printMatches(matches)
|
|
for scrapedurl,scrapedthumbnail,scrapedtitle in matches:
|
|
scrapedplot = ""
|
|
scrapedtitle = scrapedtitle.replace("Permalink to Watch ", "").replace("Porn Online", "").replace("Permalink to ", "")
|
|
itemlist.append( Item(channel=item.channel, action="play", title=scrapedtitle, url=scrapedurl,
|
|
thumbnail=scrapedthumbnail, fanart=scrapedthumbnail, contentTitle=scrapedtitle, plot=scrapedplot) )
|
|
next_page_url = scrapertools.find_single_match(data,'<a class="nextpostslink" rel="next" href="([^"]+)">»</a>')
|
|
if next_page_url!="":
|
|
next_page_url = urlparse.urljoin(item.url,next_page_url)
|
|
itemlist.append(item.clone(action="lista", title="Página Siguiente >>", text_color="blue", url=next_page_url) )
|
|
return itemlist
|
|
|
|
|
|
def play(item):
|
|
logger.info()
|
|
itemlist = []
|
|
data = httptools.downloadpage(item.url).data
|
|
scrapedurl = scrapertools.find_single_match(data,'<iframe src="([^"]+)"')
|
|
scrapedurl = scrapedurl.replace("%28", "(").replace("%29", ")")
|
|
itemlist = servertools.find_video_items(data=data)
|
|
for videoitem in itemlist:
|
|
videoitem.title = item.title
|
|
videoitem.fulltitle = item.fulltitle
|
|
videoitem.thumbnail = item.thumbnail
|
|
videoitem.channel = item.channel
|
|
return itemlist
|
|
|