.*?href=.(.*?).>'
diff --git a/core/scrapertools.py b/core/scrapertools.py
index 362f5004..8e7f9264 100644
--- a/core/scrapertools.py
+++ b/core/scrapertools.py
@@ -438,15 +438,17 @@ def get_season_and_episode(title):
@return: Nseason and episode number in "1x01" format or empty string if not found
"""
filename = ""
-
- patrons = ["(\d+)\s*[x-]\s*(\d+)", "(\d+)\s*×\s*(\d+)", "(?:[Ss]|[Tt])(\d+)\s?(?:[Ee]|Ep\.?)(\d+)",
- "(?:[Ss]tag|[Ss]eason|[Ss]tagione\w*)\s*(\d+)\s*(?:[Ee]pi|[Ee]pisode|[Ee]pisodio\w*)\s*(\d+)"]
+ patrons = ["[ .](\d+)\s*[x-]\s*(\d+)[ .]", "(\d+)\s*×\s*(\d+)", "(?:s|t)(\d+)[ .]?(?:e|Ep\.?)(\d+)",
+ "(?:(?:stag|season|stagione\w*)\s*(\d+))?\s*(?:ep|epi|epis|episod[ioe]?|puntata)[ .-]*(\d+)"]
for patron in patrons:
try:
matches = re.compile(patron, re.I).search(title)
if matches:
- filename = str(int(matches.group(1))) + "x" + str(int(matches.group(2))).zfill(2)
+ season = matches.group(1)
+ if not season:
+ season = 1
+ filename = str(int(season)) + "x" + str(int(matches.group(2))).zfill(2)
break
except:
pass
diff --git a/lib/unshortenit.py b/lib/unshortenit.py
index deed8473..e7b2dd03 100644
--- a/lib/unshortenit.py
+++ b/lib/unshortenit.py
@@ -44,14 +44,15 @@ class UnshortenIt(object):
_snip_regex = r'[0-9a-z]+snip\.|uprotector\.xyz'
_linksafe_regex = r'linksafe\.cc'
_protectlink_regex = r'(?:s\.)?protectlink\.stream'
+ _uprot_regex = r'uprot\.net'
# for services that only include real link inside iframe
_simple_iframe_regex = r'cryptmango|xshield\.net|vcrypt\.club|isecure\.link'
# for services that only do redirects
- _simple_redirect = r'streamcrypt\.net/[^/]+|uprot\.net|is\.gd'
+ _simple_redirect = r'streamcrypt\.net/[^/]+|is\.gd|www\.vedere\.stream'
listRegex = [_adfly_regex, _linkbucks_regex, _adfocus_regex, _lnxlu_regex, _shst_regex, _hrefli_regex, _anonymz_regex,
_shrink_service_regex, _rapidcrypt_regex, _simple_iframe_regex, _linkup_regex, _linkhub_regex,
- _swzz_regex, _stayonline_regex, _snip_regex, _linksafe_regex, _protectlink_regex, _simple_redirect]
+ _swzz_regex, _stayonline_regex, _snip_regex, _linksafe_regex, _protectlink_regex, _uprot_regex, _simple_redirect]
_maxretries = 5
@@ -105,6 +106,8 @@ class UnshortenIt(object):
uri, code = self._unshorten_linksafe(uri)
if re.search(self._protectlink_regex, uri, re.IGNORECASE):
uri, code = self._unshorten_protectlink(uri)
+ if re.search(self._uprot_regex, uri, re.IGNORECASE):
+ uri, code = self._unshorten_uprot(uri)
if re.search(self._simple_redirect, uri, re.IGNORECASE):
p = httptools.downloadpage(uri)
uri = p.url
@@ -593,7 +596,11 @@ class UnshortenIt(object):
uri = 'https://linkhub.icu/view/' + re.search('\.\./view/([^"]+)', r.data).group(1)
logger.info(uri)
r = httptools.downloadpage(uri, follow_redirect=True, timeout=self._timeout, cookies=False)
- uri = re.search(']+href="([^"]+)'):
+ if link.startswith('https://maxstream.video') or link.startswith('https://uprot.net') and link != uri:
+ return link, 200
+ return uri, 200
+
+
def decrypt_aes(text, key):
try:
from Cryptodome.Cipher import AES
diff --git a/platformcode/launcher.py b/platformcode/launcher.py
index d3cb49bc..a7c85c2f 100644
--- a/platformcode/launcher.py
+++ b/platformcode/launcher.py
@@ -186,6 +186,8 @@ def run(item=None):
# db need to be closed when not used, it will cause freezes
from core import db
db.close()
+ import threading
+ logger.debug(threading.enumerate())
def new_search(item, channel=None):
diff --git a/servers/mixdrop.py b/servers/mixdrop.py
index 03ef9cf8..154cead5 100644
--- a/servers/mixdrop.py
+++ b/servers/mixdrop.py
@@ -46,3 +46,11 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
video_urls.append(["%s [Mixdrop]" % ext, media_url])
return video_urls
+
+
+def get_filename(page_url):
+ title = httptools.downloadpage(page_url.replace('/e/', '/f/')).data.split('
')[1].split('')[0]
+ prefix = 'MixDrop - Watch '
+ if title.startswith(prefix):
+ return title[len(prefix):]
+ return ""
diff --git a/servers/streamlare.py b/servers/streamlare.py
index e6042a5b..8972fd10 100644
--- a/servers/streamlare.py
+++ b/servers/streamlare.py
@@ -26,3 +26,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
media_url = data["result"]["Original"]["src"]
video_urls.append(["MP4", media_url])
return video_urls
+
+
+def get_filename(page_url):
+ from core import jsontools
+ file = jsontools.load(scrapertools.decodeHtmlentities(httptools.downloadpage(page_url).data.split(':file="')[1].split('"')[0]))
+ return file['name']
diff --git a/servers/streamsb.json b/servers/streamsb.json
index 96e2e56a..e1d2783d 100644
--- a/servers/streamsb.json
+++ b/servers/streamsb.json
@@ -4,7 +4,7 @@
"ignore_urls": [],
"patterns": [
{
- "pattern": "(?:streamsb|sbembed|sbembed1|sbplay1|sbplay|pelistop|tubesb|playersb|embedsb).\\w{2,4}/(?:embed-|d/|e/)?([A-z0-9]+)",
+ "pattern": "(?:streamsb|sbembed|sbembed1|sbplay1|sbplay|pelistop|tubesb|playersb|embedsb|watchsb).\\w{2,4}/(?:embed-|d/|e/)?([A-z0-9]+)",
"url": "https://streamsb.net/\\1"
},
{
diff --git a/servers/streamsb.py b/servers/streamsb.py
index ebbe8aa1..63592615 100644
--- a/servers/streamsb.py
+++ b/servers/streamsb.py
@@ -34,3 +34,11 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
if media_url:
video_urls.append([s[0], media_url])
return video_urls
+
+
+def get_filename(page_url):
+ title = httptools.downloadpage(page_url).data.split('')[1].split('')[0]
+ prefix = 'Watch '
+ if title.startswith(prefix):
+ return title[len(prefix):]
+ return ""
diff --git a/servers/streamtape.py b/servers/streamtape.py
index 1ec57d35..b6bced16 100644
--- a/servers/streamtape.py
+++ b/servers/streamtape.py
@@ -36,3 +36,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "")
video_urls.append(['MP4 [Streamtape]', url])
return video_urls
+
+
+def get_filename(page_url):
+ return httptools.downloadpage(page_url).data.split('')[1].split('')[0]
+ prefix = 'Watch '
+ if title.startswith(prefix):
+ return title[len(prefix):]
+ return ""