cinemalibero: supporto filecrypt

This commit is contained in:
marco
2021-12-28 16:49:50 +01:00
parent 682eeddce6
commit 17a33a6ed9
4 changed files with 54 additions and 55 deletions
+31 -11
View File
@@ -7,6 +7,7 @@ import re
from core import httptools, support, scrapertools from core import httptools, support, scrapertools
from core.item import Item from core.item import Item
from core.support import typo
from platformcode import config from platformcode import config
import sys import sys
if sys.version_info[0] >= 3: if sys.version_info[0] >= 3:
@@ -57,13 +58,13 @@ def peliculas(item):
patron = r'<div class="col-lg-3">[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>(?:[^>]+>)?\s?(?P<rating>[\d\.]+)?[^>]+>.+?(?:[ ]\((?P<year>\d{4})\))?<[^>]+>[^>]+>(.?[\d\-x]+\s\(?(?P<lang>[sSuUbBiItTaA\-]+)?\)?\s?(?P<quality>[\w]+)?[|]?\s?(?:[fFiInNeE]+)?\s?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?)?' patron = r'<div class="col-lg-3">[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>(?:[^>]+>)?\s?(?P<rating>[\d\.]+)?[^>]+>.+?(?:[ ]\((?P<year>\d{4})\))?<[^>]+>[^>]+>(.?[\d\-x]+\s\(?(?P<lang>[sSuUbBiItTaA\-]+)?\)?\s?(?P<quality>[\w]+)?[|]?\s?(?:[fFiInNeE]+)?\s?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?)?'
pagination = 25 pagination = 25
elif item.contentType == 'movie': elif item.contentType == 'movie':
action = 'findvideos' # action = 'findvideos'
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>.+?)(?:[ ]\[(?P<lang>[sSuUbB\-iItTaA]+)\])?(?:[ ]\((?P<year>\d{4})\))?"\s*alt="[^"]+"\s*class="[^"]+"(?: style="background-image: url\((?P<thumb>.+?)\)">)?\s*<div class="voto">[^>]+>[^>]+>.(?P<rating>[\d\.a-zA-Z\/]+)?[^>]+>[^>]+>[^>]+>(?:<div class="genere">(?P<quality>[^<]+)</div>)?' patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>.+?)(?:[ ]\[(?P<lang>[sSuUbB\-iItTaA]+)\])?(?:[ ]\((?P<year>\d{4})\))?"\s*alt="[^"]+"\s*class="[^"]+"(?: style="background-image: url\((?P<thumb>.+?)\)">)?\s*<div class="voto">[^>]+>[^>]+>.(?P<rating>[\d\.a-zA-Z\/]+)?[^>]+>[^>]+>[^>]+>(?:<div class="genere">(?P<quality>[^<]+)</div>)?'
if item.args == 'update': if item.args == 'update':
patronBlock = r'<section id="slider">(?P<block>.*?)</section>' patronBlock = r'<section id="slider">(?P<block>.*?)</section>'
patron = r'<a href="(?P<url>(?:https:\/\/.+?\/(?P<title>[^\/]+[a-zA-Z0-9\-]+)(?P<year>\d{4})))/".+?url\((?P<thumb>[^\)]+)\)">' patron = r'<a href="(?P<url>(?:https:\/\/.+?\/(?P<title>[^\/]+[a-zA-Z0-9\-]+)(?P<year>\d{4})))/".+?url\((?P<thumb>[^\)]+)\)">'
elif item.contentType == 'tvshow': elif item.contentType == 'tvshow':
action = 'episodios' # action = 'episodios'
if item.args == 'update': if item.args == 'update':
patron = r'<a href="(?P<url>[^"]+)"[^<]+?url\((?P<thumb>.+?)\)">\s*?<div class="titolo">(?P<title>.+?)(?: &#8211; Serie TV)?(?:\([sSuUbBiItTaA\-]+\))?[ ]?(?P<year>\d{4})?</div>\s*?(?:<div class="genere">)?(?:[\w]+?\.?\s?[\s|S]?[\dx\-S]+?\s\(?(?P<lang>[iItTaA]+|[sSuUbBiItTaA\-]+)\)?\s?(?P<quality>[HD]+)?|.+?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?</div>)' patron = r'<a href="(?P<url>[^"]+)"[^<]+?url\((?P<thumb>.+?)\)">\s*?<div class="titolo">(?P<title>.+?)(?: &#8211; Serie TV)?(?:\([sSuUbBiItTaA\-]+\))?[ ]?(?P<year>\d{4})?</div>\s*?(?:<div class="genere">)?(?:[\w]+?\.?\s?[\s|S]?[\dx\-S]+?\s\(?(?P<lang>[iItTaA]+|[sSuUbBiItTaA\-]+)\)?\s?(?P<quality>[HD]+)?|.+?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?</div>)'
pagination = 25 pagination = 25
@@ -94,7 +95,7 @@ def peliculas(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
data = item.data data = item.data
# debug = True # debugBlock = True
if item.args == 'anime': if item.args == 'anime':
support.info("Anime :", item) support.info("Anime :", item)
# blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555', 'Cloudvideo'] # blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555', 'Cloudvideo']
@@ -134,7 +135,7 @@ def episodios(item):
with futures.ThreadPoolExecutor() as executor: with futures.ThreadPoolExecutor() as executor:
for s in servers: for s in servers:
executor.submit(get_ep, s) executor.submit(get_ep, s)
ret.extend([it.clone(title=ep, contentSeason=int(ep.split('x')[0]), contentEpisodeNumber=int(ep.split('x')[1]), servers=[srv.tourl() for srv in episodes[ep]]) for ep in episodes]) ret.extend([it.clone(title=ep+typo(it.contentLanguage, '_ [] color kod'), contentSeason=int(ep.split('x')[0]), contentEpisodeNumber=int(ep.split('x')[1]), servers=[srv.tourl() for srv in episodes[ep]]) for ep in episodes])
else: else:
ret.append(it) ret.append(it)
return sorted(ret, key=lambda i: i.title) return sorted(ret, key=lambda i: i.title)
@@ -144,7 +145,6 @@ def episodios(item):
@support.scrape @support.scrape
def genres(item): def genres(item):
action='peliculas' action='peliculas'
patron_block=r'<div id="bordobar" class="dropdown-menu(?P<block>.*?)</li>' patron_block=r'<div id="bordobar" class="dropdown-menu(?P<block>.*?)</li>'
patronMenu=r'<a class="dropdown-item" href="(?P<url>[^"]+)" title="(?P<title>[A-z]+)"' patronMenu=r'<a class="dropdown-item" href="(?P<url>[^"]+)" title="(?P<title>[A-z]+)"'
@@ -191,8 +191,6 @@ def newest(categoria):
def check(item): def check(item):
support.info() support.info()
# support.dbg()
from platformcode.launcher import run
data = support.match(item.url, headers=headers).data data = support.match(item.url, headers=headers).data
if data: if data:
ck = support.match(data, patron=r'Supportaci condividendo quest[oa] ([^:]+)').match.lower() ck = support.match(data, patron=r'Supportaci condividendo quest[oa] ([^:]+)').match.lower()
@@ -207,13 +205,17 @@ def check(item):
item.contentType = 'tvshow' item.contentType = 'tvshow'
item.args = 'anime' item.args = 'anime'
item.data = data item.data = data
return episodios(item) itemlist = episodios(item)
if not itemlist:
item.data = data
item.action = 'findvideos'
return findvideos(item)
elif ck == 'film': elif ck == 'film':
item.contentType = 'movie' item.contentType = 'movie'
item.data = data item.data = data
item.action = 'findvideos' item.action = 'findvideos'
return run(item) return findvideos(item)
else: else:
item.contentType = 'tvshow' item.contentType = 'tvshow'
@@ -223,7 +225,7 @@ def check(item):
item.contentType = 'movie' item.contentType = 'movie'
item.data = data item.data = data
item.action = 'findvideos' item.action = 'findvideos'
return run(item) return findvideos(item)
@@ -240,9 +242,27 @@ def findvideos(item):
if item.servers: if item.servers:
return support.server(item, itemlist=[Item().fromurl(s) for s in item.servers]) return support.server(item, itemlist=[Item().fromurl(s) for s in item.servers])
if not item.data: if not item.data:
item.data = support.match(item, patron='<p>\s*<strong>\s*<u>.*?</p>').match item.data = httptools.downloadpage(item.url)
item.data = scrapertools.find_single_match(item.data, '<div class="at-above-post addthis_tool"(.*?)<div class="at-below-post')
servers = [] servers = []
if item.args == 'anime':
if item.urls: # this is a episode
return support.server(item, itemlist=[Item(url=support.unshortenit.FileCrypt().unshorten(u)) for u in item.urls])
itemlist = []
episodes = {}
# support.dbg()
for uri in support.unshortenit.FileCrypt().find(item.data):
for ep in support.unshortenit.FileCrypt(uri).list_files():
ep = ('.'.join(ep[0].split('.')[:-1]), ep[1]) # remove extension
if not ep[0] in episodes:
episodes[ep[0]] = []
episodes[ep[0]].append(ep[1])
for ep in episodes.keys():
itemlist.append(item.clone(title=ep, urls=episodes[ep], action='findvideos', data=''))
return itemlist
total_servers = support.server(item, data=item.data) total_servers = support.server(item, data=item.data)
if item.contentType == 'episode' and len(set([srv.server for srv in total_servers])) < len([srv.server for srv in total_servers]): if item.contentType == 'episode' and len(set([srv.server for srv in total_servers])) < len([srv.server for srv in total_servers]):
# i link contengono più puntate, cerco quindi quella selezionata # i link contengono più puntate, cerco quindi quella selezionata
with futures.ThreadPoolExecutor() as executor: with futures.ThreadPoolExecutor() as executor:
+23 -2
View File
@@ -695,14 +695,13 @@ class UnshortenIt(object):
return httptools.downloadpage(uri, only_headers=True, follow_redirects=False).headers.get('location', uri), 200 return httptools.downloadpage(uri, only_headers=True, follow_redirects=False).headers.get('location', uri), 200
def _unshorten_uprot(self, uri): def _unshorten_uprot(self, uri):
# from core.support import dbg
# dbg()
for link in scrapertools.find_multiple_matches(httptools.downloadpage(uri, cloudscraper=True).data, '<a[^>]+href="([^"]+)'): for link in scrapertools.find_multiple_matches(httptools.downloadpage(uri, cloudscraper=True).data, '<a[^>]+href="([^"]+)'):
if link.startswith('https://maxstream.video') or link.startswith('https://uprot.net') and link != uri: if link.startswith('https://maxstream.video') or link.startswith('https://uprot.net') and link != uri:
return link, 200 return link, 200
return uri, 200 return uri, 200
def decrypt_aes(text, key): def decrypt_aes(text, key):
try: try:
from Cryptodome.Cipher import AES from Cryptodome.Cipher import AES
@@ -775,3 +774,25 @@ def findlinks(text):
else: else:
text += '\n' + str(link.result()[0]) text += '\n' + str(link.result()[0])
return text return text
class FileCrypt:
def __init__(self, uri=None):
self.uri = uri
def find(self, data):
_filecrypt_regex = r'https?://\w+\.filecrypt\.cc/[a-zA-Z0-9_=/]+'
return scrapertools.find_multiple_matches(data, _filecrypt_regex)
def list_files(self):
reg = """<td title="([^"]+).*?<button onclick="openLink\('([^']+)"""
data = httptools.downloadpage(self.uri).data
ret = scrapertools.find_multiple_matches(data, reg)
return ret
def unshorten(self, link):
link_data = httptools.downloadpage('https://www.filecrypt.cc/Link/' + link + '.html').data
time.sleep(0.1)
url = httptools.downloadpage(scrapertools.find_single_match(link_data, "location.href='([^']+)"), headers={'Referer': 'http://www.filecrypt.cc/'}, only_headers=True).url
logger.info(url)
return url
-29
View File
@@ -1,29 +0,0 @@
{
"active": true,
"find_videos": {
"ignore_urls": [],
"patterns": [
{
"pattern": "(rapidgator.net/file/\\w+(?:\\.html|))",
"url": "http://\\1"
}
]
},
"free": false,
"id": "rapidgator",
"name": "Rapid Gator",
"premium": [
"realdebrid",
"alldebrid"
],
"settings": [
{
"default": false,
"enabled": true,
"id": "black_list",
"label": "@70708",
"type": "bool",
"visible": true
}
]
}
-13
View File
@@ -1,13 +0,0 @@
# -*- coding: utf-8 -*-
from platformcode import logger
def test_video_exists(page_url):
return True, ""
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
logger.debug("(page_url='%s')" % page_url)
video_urls = []
return video_urls