diff --git a/channels.json b/channels.json index 8e0d1e26..1f7aa7c4 100644 --- a/channels.json +++ b/channels.json @@ -39,6 +39,8 @@ "serietvsubita": "http://serietvsubita.xyz", "serietvu": "https://www.serietvu.live", "streamtime": "https://t.me/s/StreamTime", + "streamingita": "https://www.streamingita.pro", + "streamingcommunity": "https://streamingcommunity.space", "tantifilm": "https://www.tantifilm.cfd", "tapmovie": "https://it.tapmovie.net", "toonitalia": "https://toonitalia.co", @@ -47,7 +49,6 @@ "findhost": { "altadefinizionecommunity": "https://altaregistrazione.net", "animealtadefinizione": "https://www.animealtadefinizione.it", - "filmpertutti": "https://filmpertuttiii.nuovo.live", - "streamingcommunity": "https://streamingcommunity-nuovo.link" + "filmpertutti": "https://filmpertuttiii.nuovo.live" } } \ No newline at end of file diff --git a/channels/streamingcommunity.py b/channels/streamingcommunity.py index e90349a5..dc455f7e 100644 --- a/channels/streamingcommunity.py +++ b/channels/streamingcommunity.py @@ -9,33 +9,34 @@ from core import support, channeltools, httptools from platformcode import logger -def findhost(url): - return 'https://' + support.match(url, patron='var domain\s*=\s*"([^"]+)').match +# def findhost(url): +# return 'https://' + support.match(url, patron='var domain\s*=\s*"([^"]+)').match -host = support.config.get_channel_url(findhost) +host = support.config.get_channel_url() session = requests.Session() session.request = functools.partial(session.request, timeout=httptools.HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT) headers = {} + def getHeaders(forced=False): global headers global host if not headers: - try: - headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14'} - response = session.get(host, headers=headers) - if not response.url.startswith(host): - host = support.config.get_channel_url(findhost, forceFindhost=True) - csrf_token = support.match(response.text, patron='name="csrf-token" content="([^"]+)"').match - headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14', - 'content-type': 'application/json;charset=UTF-8', - 'Referer': host, - 'x-csrf-token': csrf_token, - 'Cookie': '; '.join([x.name + '=' + x.value for x in response.cookies])} - except: - host = support.config.get_channel_url(findhost, forceFindhost=True) - if not forced: getHeaders(True) + # try: + headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14'} + response = session.get(host, headers=headers) + # if not response.url.startswith(host): + # host = support.config.get_channel_url(findhost, forceFindhost=True) + csrf_token = support.match(response.text, patron='name="csrf-token" content="([^"]+)"').match + headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14', + 'content-type': 'application/json;charset=UTF-8', + 'Referer': host, + 'x-csrf-token': csrf_token, + 'Cookie': '; '.join([x.name + '=' + x.value for x in response.cookies])} + # except: + # host = support.config.get_channel_url(findhost, forceFindhost=True) + # if not forced: getHeaders(True) getHeaders() diff --git a/channels/streamingita.json b/channels/streamingita.json new file mode 100644 index 00000000..940536e8 --- /dev/null +++ b/channels/streamingita.json @@ -0,0 +1,11 @@ +{ + "id": "streamingita", + "name": "StreamingITA", + "language": ["ita"], + "active": true, + "thumbnail": "streamingita.png", + "banner": "streamingita.png", + "categories": ["tvshow", "movie"], + "not_active": ["include_in_newest_peliculas", "include_in_newest_anime", "include_in_newest_series"], + "settings": [] +} diff --git a/channels/streamingita.py b/channels/streamingita.py new file mode 100644 index 00000000..6a2f8ebf --- /dev/null +++ b/channels/streamingita.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Canale per streamingITA +# ------------------------------------------------------------ + +from core import support +from platformcode import logger, config + +host = config.get_channel_url() + + +@support.menu +def mainlist(item): + + film = ['/film'] + top = [('Generi', ['/film', 'menu', 'genres']), + ('Anno', ['/film', 'menu', 'releases'])] + tvshow = ['/tv'] + search = '' + return locals() + + +def search(item, text): + logger.info('search', text) + item.url = item.url + "/?s=" + text + try: + return support.dooplay_search(item) + except: + import sys + for line in sys.exc_info(): + logger.error("%s" % line) + return [] + + +def peliculas(item): + return support.dooplay_peliculas(item, False) + + +def episodios(item): + itemlist = support.dooplay_get_episodes(item) + return itemlist + + +def findvideos(item): + itemlist = [] + for link in support.dooplay_get_links(item, host): + itemlist.append( + item.clone(action="play", url=link['url'])) + # if item.contentType == 'episode': + # linkHead = support.httptools.downloadpage(item.url, only_headers=True).headers['link'] + # epId = support.scrapertools.find_single_match(linkHead, r'\?p=([0-9]+)>') + # for link in support.dooplay_get_links(item, host, paramList=[['tv', epId, 1, 'title', 'server']]): + # itemlist.append( + # item.clone(action="play", url=link['url'])) + # else: + # for link, quality in support.match(item.url, patron="(" + host + """links/[^"]+).*?class="quality">([^<]+)""").matches: + # srv = support.servertools.find_video_items(data=support.httptools.downloadpage(link).data) + # for s in srv: + # s.quality = quality + # itemlist.extend(srv) + return support.server(item, itemlist=itemlist) + + +@support.scrape +def menu(item): + action = 'peliculas' + # debug = True + if item.args in ['genres', 'releases']: + patronBlock = r'