dinostreaming: new channel (work in progress)

This commit is contained in:
ilmich
2024-07-07 11:25:44 +02:00
parent d378d31677
commit 2c901fdbf1
4 changed files with 82 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
{
"id": "dinostreaming",
"name": "DinoStreaming",
"language": ["ita"],
"active": true,
"thumbnail": "dinostreaming.png",
"banner": "dinostreaming.png",
"categories": ["movie"],
"settings": [],
"not_active": ["include_in_newest"]
}

69
channels/dinostreaming.py Normal file
View File

@@ -0,0 +1,69 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# Canale per Dinostreaming
# by ilmich
# ------------------------------------------------------------
from core import httptools, support
from core.item import Item
from platformcode import logger
host = support.config.get_channel_url()
headers = [['Referer', host]]
@support.menu
def mainlist(item):
menu = [('Film',['/sfoglia', 'peliculas']),
]
search = ''
return locals()
@support.scrape
def peliculas(item):
if not item.args == 'search': # pagination not works
if not item.nextpage:
item.page = 1
else:
item.page = item.nextpage
if not item.parent_url:
item.parent_url = item.url
item.nextpage = item.page + 1
nextPageUrl = "{}/page/{}".format(item.parent_url, item.nextpage)
resp = httptools.downloadpage(nextPageUrl, only_headers = True)
if (resp.code > 399): # no more elements
nextPageUrl = ''
patron = r'<div data-elementor-type="loop-item".*?<a.*?url="(?P<thumb>[^"]+).*?<a href=\"(?P<url>[^"]+)\">(?P<title>.*?)</a>.*?<span class="elementor-heading-title elementor-size-default">(?P<year>.*?)</span>'
def itemlistHook(itemlist):
return itemlist[:-1:]
return locals()
def search(item, text):
item.url = "{}/?{}".format(host, support.urlencode({'s': text}))
item.args = 'search'
try:
return peliculas(item)
except:
import sys
for line in sys.exc_info():
logger.error("search except: %s" % line)
return []
def findvideos(item):
support.info()
data = httptools.downloadpage(item.url).data
video_url = support.match(data, patron=r'<a href="([^"]+)" rel="nofollow" title="Guarda il film in streaming">' ).match
if (video_url == ''):
return []
item.url = video_url
itemlist = support.server(item)
return itemlist