Merge remote-tracking branch 'origin/master'
This commit is contained in:
+10
-17
@@ -12,15 +12,9 @@ from platformcode import logger, config
|
|||||||
|
|
||||||
|
|
||||||
def findhost():
|
def findhost():
|
||||||
page = httptools.downloadpage('https://cb01.uno/')
|
host = httptools.downloadpage('https://cb01.uno/', follow_redirect=True).url
|
||||||
# permUrl = page.headers
|
if host == 'https://cb01.uno/':
|
||||||
# if 'location' in permUrl:
|
host = support.match(host, patron=r'<a href="([^"]+)', debug=True).match
|
||||||
# if 'google' in permUrl['location']:
|
|
||||||
# host = permUrl['location'].replace('https://www.google.it/search?q=site:', '')
|
|
||||||
# else:
|
|
||||||
# host = permUrl['location']
|
|
||||||
# else:
|
|
||||||
host = support.match(page.data, patron=r'<a href="([^"]+)').match
|
|
||||||
return host
|
return host
|
||||||
|
|
||||||
|
|
||||||
@@ -118,7 +112,7 @@ def peliculas(item):
|
|||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
else:
|
else:
|
||||||
patronBlock = r'Ultime SerieTv aggiornate(?P<block>.*?)Lista'
|
patronBlock = r'Ultime SerieTv aggiornate(?P<block>.*?)Lista'
|
||||||
patron = r'src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: – \d+×\d+)?(?:"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>[^>]+>[^>]+><a href="(?P<url>[^"]+)".*?<div class="rpwe-summary">.*?\((?P<year>\d{4})[^\)]*\) (?P<plot>[^<]+)<'
|
patron = r'src=(?:")?(?P<thumb>[^ "]+)(?:")? alt=(?:")?(?P<title>.*?)(?: – \d+×\d+)?(?:>|"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>[^\(]*)\((?P<year>\d{4})[^\)]*\) (?P<plot>[^<]+)<'
|
||||||
action = 'episodios'
|
action = 'episodios'
|
||||||
|
|
||||||
elif '/serietv/' not in item.url:
|
elif '/serietv/' not in item.url:
|
||||||
@@ -126,7 +120,7 @@ def peliculas(item):
|
|||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
|
|
||||||
else:
|
else:
|
||||||
patron = r'div class="card-image">.*?<img src="(?P<thumb>[^ ]+)" alt.*?<a href="(?P<url>[^ >]+)">(?P<title>.*?)(?: –\s*(?:[SS]tagione \d|\d).*?)?(?P<lang>(?:[Ss][Uu][Bb]-)?[Ii][Tt][Aa])?<\/a>.*?(?:<strong><span style="[^"]+">(?P<genre>[^<>0-9(]+)\((?P<year>[0-9]{4}).*?</(?:p|div)>(?P<plot>.*?))?</div'
|
patron = r'card-image[^>]*>\s*<a href=(?:")?(?P<url>[^" >]+)(?:")?\s*>\s*<img src=(?:")?(?P<thumb>[^" ]+)(?:")? alt="(?P<title>.*?)(?: – \d+×\d+)?(?:"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>(?P<genre>[^\(]+)\((?P<year>\d{4})[^>]*>[^>]+>[^>]+>[^>]+>(?:<p>)?(?P<plot>[^<]+)'
|
||||||
action = 'episodios'
|
action = 'episodios'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
|
|
||||||
@@ -137,10 +131,9 @@ def peliculas(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
data = httptools.downloadpage(item.url, headers=headers).data
|
# support.dbg()
|
||||||
data = data.replace("'", '"')
|
data = support.match(item.url, headers=headers).data
|
||||||
data = re.sub('\n|\t', ' ', data)
|
support.log(data)
|
||||||
data = re.sub(r'>\s+<', '> <', data)
|
|
||||||
if 'TUTTA LA ' in data:
|
if 'TUTTA LA ' in data:
|
||||||
folderUrl = scrapertools.find_single_match(data, 'TUTTA LA \w+\s+(?:–|-)\s+<a href="([^"]+)')
|
folderUrl = scrapertools.find_single_match(data, 'TUTTA LA \w+\s+(?:–|-)\s+<a href="([^"]+)')
|
||||||
data = httptools.downloadpage(folderUrl).data
|
data = httptools.downloadpage(folderUrl).data
|
||||||
@@ -150,7 +143,7 @@ def episodios(item):
|
|||||||
item.serieFolder = True
|
item.serieFolder = True
|
||||||
return item
|
return item
|
||||||
else:
|
else:
|
||||||
patronBlock = r'(?P<block><div class="sp-head[a-z ]*?" title="Espandi">\s*(?:STAGION[EI]\s*(?:DA\s*[0-9]+\s*A)?\s*[0-9]+|MINISERIE) - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?[^<>]*?<\/div>.*?)<div class="spdiv">\[riduci\]<\/div>'
|
patronBlock = r'(?P<block>sp-head[^>]+>\s*(?:STAGION[EI]\s*(?:DA\s*[0-9]+\s*A)?\s*[0-9]+|MINISERIE) - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?<\/div>.*?)spdiv[^>]*>'
|
||||||
patron = r'(?:/>|<p>|<strong>)(?P<url>.*?(?P<episode>[0-9]+(?:×|ÃÂ)[0-9]+)\s*(?P<title2>.*?)?(?:\s*–|\s*-|\s*<).*?)(?:<\/p>|<br)'
|
patron = r'(?:/>|<p>|<strong>)(?P<url>.*?(?P<episode>[0-9]+(?:×|ÃÂ)[0-9]+)\s*(?P<title2>.*?)?(?:\s*–|\s*-|\s*<).*?)(?:<\/p>|<br)'
|
||||||
def itemlistHook(itemlist):
|
def itemlistHook(itemlist):
|
||||||
title_dict = {}
|
title_dict = {}
|
||||||
@@ -236,7 +229,7 @@ def findvid_serie(item):
|
|||||||
def load_vid_series(html, item, itemlist, blktxt):
|
def load_vid_series(html, item, itemlist, blktxt):
|
||||||
support.log('HTML',html)
|
support.log('HTML',html)
|
||||||
# Estrae i contenuti
|
# Estrae i contenuti
|
||||||
matches = support.match(html, patron=r'<a href="([^"]+)"[^=]+="_blank"[^>]+>(?!<!--)(.*?)(?:</a>|<img)').matches
|
matches = support.match(html, patron=r'<a href=(?:")?([^ "]+)[^>]+>(?!<!--)(.*?)(?:</a>|<img)').matches
|
||||||
for url, server in matches:
|
for url, server in matches:
|
||||||
item = Item(channel=item.channel,
|
item = Item(channel=item.channel,
|
||||||
action="play",
|
action="play",
|
||||||
|
|||||||
+10
-2
@@ -214,8 +214,12 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
|||||||
|
|
||||||
if scraped['season']:
|
if scraped['season']:
|
||||||
stagione = scraped['season']
|
stagione = scraped['season']
|
||||||
|
item.infoLabels['season'] = int(scraped['season'])
|
||||||
|
item.infoLabels['episode'] = int(scraped['episode'])
|
||||||
episode = str(int(scraped['season'])) +'x'+ str(int(scraped['episode'])).zfill(2)
|
episode = str(int(scraped['season'])) +'x'+ str(int(scraped['episode'])).zfill(2)
|
||||||
elif item.season:
|
elif item.season:
|
||||||
|
item.infoLabels['season'] = int(item.season)
|
||||||
|
item.infoLabels['episode'] = int(scrapertools.find_single_match(scraped['episode'], r'(\d+)'))
|
||||||
episode = item.season +'x'+ scraped['episode']
|
episode = item.season +'x'+ scraped['episode']
|
||||||
elif item.contentType == 'tvshow' and (scraped['episode'] == '' and scraped['season'] == '' and stagione == ''):
|
elif item.contentType == 'tvshow' and (scraped['episode'] == '' and scraped['season'] == '' and stagione == ''):
|
||||||
item.news = 'season_completed'
|
item.news = 'season_completed'
|
||||||
@@ -225,6 +229,8 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
|||||||
if 'x' in episode:
|
if 'x' in episode:
|
||||||
ep = episode.split('x')
|
ep = episode.split('x')
|
||||||
episode = str(int(ep[0])).zfill(1) + 'x' + str(int(ep[1])).zfill(2)
|
episode = str(int(ep[0])).zfill(1) + 'x' + str(int(ep[1])).zfill(2)
|
||||||
|
item.infoLabels['season'] = int(ep[0])
|
||||||
|
item.infoLabels['episode'] = int(ep[1])
|
||||||
second_episode = scrapertools.find_single_match(episode, r'x\d+x(\d+)')
|
second_episode = scrapertools.find_single_match(episode, r'x\d+x(\d+)')
|
||||||
if second_episode: episode = re.sub(r'(\d+x\d+)x\d+',r'\1-', episode) + second_episode.zfill(2)
|
if second_episode: episode = re.sub(r'(\d+x\d+)x\d+',r'\1-', episode) + second_episode.zfill(2)
|
||||||
|
|
||||||
@@ -239,6 +245,9 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
|||||||
# necessaria l'aggiunta di == scraped["title"] altrimenti non prende i gruppi dopo le categorie
|
# necessaria l'aggiunta di == scraped["title"] altrimenti non prende i gruppi dopo le categorie
|
||||||
if item.infoLabels["title"] == scraped["title"]:
|
if item.infoLabels["title"] == scraped["title"]:
|
||||||
infolabels = item.infoLabels
|
infolabels = item.infoLabels
|
||||||
|
else:
|
||||||
|
if function == 'episodios':
|
||||||
|
infolabels = item.infoLabels
|
||||||
else:
|
else:
|
||||||
infolabels = {}
|
infolabels = {}
|
||||||
if scraped['year']:
|
if scraped['year']:
|
||||||
@@ -246,8 +255,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
|||||||
if scraped["plot"]:
|
if scraped["plot"]:
|
||||||
infolabels['plot'] = plot
|
infolabels['plot'] = plot
|
||||||
if scraped['duration']:
|
if scraped['duration']:
|
||||||
matches = scrapertools.find_multiple_matches(scraped['duration'],
|
matches = scrapertools.find_multiple_matches(scraped['duration'],r'([0-9])\s*?(?:[hH]|:|\.|,|\\|\/|\||\s)\s*?([0-9]+)')
|
||||||
r'([0-9])\s*?(?:[hH]|:|\.|,|\\|\/|\||\s)\s*?([0-9]+)')
|
|
||||||
for h, m in matches:
|
for h, m in matches:
|
||||||
scraped['duration'] = int(h) * 60 + int(m)
|
scraped['duration'] = int(h) * 60 + int(m)
|
||||||
if not matches:
|
if not matches:
|
||||||
|
|||||||
+2
-5
@@ -196,10 +196,7 @@ def get_trakt_watched(id_type, mediatype, update=False):
|
|||||||
|
|
||||||
|
|
||||||
def trakt_check(itemlist):
|
def trakt_check(itemlist):
|
||||||
from core.support import typo
|
|
||||||
id_result = ''
|
id_result = ''
|
||||||
# check = u'\u221a'
|
|
||||||
check = typo(u'\u221a','color kod bold')+' '
|
|
||||||
synced = False
|
synced = False
|
||||||
try:
|
try:
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
@@ -221,7 +218,7 @@ def trakt_check(itemlist):
|
|||||||
id_result = get_trakt_watched(id_type, mediatype)
|
id_result = get_trakt_watched(id_type, mediatype)
|
||||||
if info['mediatype'] == 'movie':
|
if info['mediatype'] == 'movie':
|
||||||
if info[id_type + '_id'] in id_result:
|
if info[id_type + '_id'] in id_result:
|
||||||
item.title = check + item.title
|
item.infoLabels['playcount'] = 1
|
||||||
|
|
||||||
elif info['mediatype'] == 'episode':
|
elif info['mediatype'] == 'episode':
|
||||||
if info[id_type + '_id'] in id_result:
|
if info[id_type + '_id'] in id_result:
|
||||||
@@ -236,7 +233,7 @@ def trakt_check(itemlist):
|
|||||||
season_watched = id_result[id][season]
|
season_watched = id_result[id][season]
|
||||||
|
|
||||||
if episode in season_watched:
|
if episode in season_watched:
|
||||||
item.title = check + item.title
|
item.infoLabels['playcount'] = 1
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import base64
|
import base64, json, random, struct, time, sys, traceback
|
||||||
import json
|
if sys.version_info[0] >= 3:
|
||||||
import random
|
import urllib.request as urllib
|
||||||
import struct
|
xrange = range
|
||||||
import time
|
else:
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from core import httptools
|
from core import httptools
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
@@ -102,7 +103,7 @@ class Client(object):
|
|||||||
return files
|
return files
|
||||||
|
|
||||||
except:
|
except:
|
||||||
print(traceback.format_exc())
|
logger.info(traceback.format_exc())
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return files
|
return files
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import urllib2
|
import sys, traceback
|
||||||
import traceback
|
from platformcode import logger
|
||||||
|
if sys.version_info[0] >= 3:
|
||||||
|
from urllib.request import Request, urlopen
|
||||||
|
else:
|
||||||
|
from urllib2 import Request, urlopen
|
||||||
|
|
||||||
|
|
||||||
class Cursor(object):
|
class Cursor(object):
|
||||||
def __init__(self, file):
|
def __init__(self, file):
|
||||||
@@ -18,14 +23,14 @@ class Cursor(object):
|
|||||||
file = self._file._client.api_req({'a': 'g', 'g': 1, 'p': self._file.file_id})
|
file = self._file._client.api_req({'a': 'g', 'g': 1, 'p': self._file.file_id})
|
||||||
self._file.url= file["g"]
|
self._file.url= file["g"]
|
||||||
|
|
||||||
req = urllib2.Request(self._file.url)
|
req = Request(self._file.url)
|
||||||
req.headers['Range'] = 'bytes=%s-' % (offset)
|
req.headers['Range'] = 'bytes=%s-' % (offset)
|
||||||
try:
|
try:
|
||||||
self.conn = urllib2.urlopen(req)
|
self.conn = urlopen(req)
|
||||||
try:
|
try:
|
||||||
self.prepare_decoder(offset)
|
self.prepare_decoder(offset)
|
||||||
except:
|
except:
|
||||||
print(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
except:
|
except:
|
||||||
self.mega_request(offset, True)
|
self.mega_request(offset, True)
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,3 @@ class File(object):
|
|||||||
self.cursor = True
|
self.cursor = True
|
||||||
self.cursors.append(c)
|
self.cursors.append(c)
|
||||||
return c
|
return c
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
import BaseHTTPServer
|
import time, os, re, sys
|
||||||
|
|
||||||
|
if sys.version_info[0] >= 3:
|
||||||
|
from http.server import BaseHTTPRequestHandler
|
||||||
|
import urllib.request as urllib
|
||||||
|
import urllib.parse as urlparse
|
||||||
|
else:
|
||||||
|
from BaseHTTPServer import BaseHTTPRequestHandler
|
||||||
import urlparse
|
import urlparse
|
||||||
import time
|
|
||||||
import urllib
|
import urllib
|
||||||
import types
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
|
|
||||||
|
|
||||||
class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
|
class Handler(BaseHTTPRequestHandler):
|
||||||
protocol_version = 'HTTP/1.1'
|
protocol_version = 'HTTP/1.1'
|
||||||
|
|
||||||
def log_message(self, format, *args):
|
def log_message(self, format, *args):
|
||||||
@@ -73,7 +76,7 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
|
|||||||
start, end = self.parse_range(self.headers.get('Range', ""))
|
start, end = self.parse_range(self.headers.get('Range', ""))
|
||||||
self.size = size
|
self.size = size
|
||||||
|
|
||||||
if start <> None:
|
if start != None:
|
||||||
if end == None: end = size - 1
|
if end == None: end = size - 1
|
||||||
self.offset=int(start)
|
self.offset=int(start)
|
||||||
self.size=int(end) - int(start) + 1
|
self.size=int(end) - int(start) + 1
|
||||||
@@ -108,7 +111,7 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
|
|||||||
self.send_header('Accept-Ranges', 'bytes')
|
self.send_header('Accept-Ranges', 'bytes')
|
||||||
|
|
||||||
if range:
|
if range:
|
||||||
if isinstance(range, (types.TupleType, types.ListType)) and len(range)==3:
|
if isinstance(range, (tuple, list)) and len(range)==3:
|
||||||
self.send_header('Content-Range', 'bytes %d-%d/%d' % range)
|
self.send_header('Content-Range', 'bytes %d-%d/%d' % range)
|
||||||
self.send_header('Content-Length', range[1]-range[0]+1)
|
self.send_header('Content-Length', range[1]-range[0]+1)
|
||||||
else:
|
else:
|
||||||
@@ -119,4 +122,3 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
|
|||||||
self.send_header('Connection', 'close')
|
self.send_header('Connection', 'close')
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
|
|
||||||
|
|
||||||
@@ -1,14 +1,18 @@
|
|||||||
import traceback
|
import sys, traceback
|
||||||
import BaseHTTPServer
|
if sys.version_info[0] >= 3:
|
||||||
|
from http.server import HTTPServer
|
||||||
|
else:
|
||||||
|
from BaseHTTPServer import HTTPServer
|
||||||
from SocketServer import ThreadingMixIn
|
from SocketServer import ThreadingMixIn
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
|
|
||||||
class Server(ThreadingMixIn, BaseHTTPServer.HTTPServer):
|
class Server(ThreadingMixIn, HTTPServer):
|
||||||
daemon_threads = True
|
daemon_threads = True
|
||||||
timeout = 1
|
timeout = 1
|
||||||
def __init__(self, address, handler, client):
|
def __init__(self, address, handler, client):
|
||||||
BaseHTTPServer.HTTPServer.__init__(self,address,handler)
|
HTTPServer.__init__(self,address,handler)
|
||||||
self._client = client
|
self._client = client
|
||||||
self.running=True
|
self.running=True
|
||||||
self.request = None
|
self.request = None
|
||||||
@@ -21,7 +25,7 @@ class Server(ThreadingMixIn, BaseHTTPServer.HTTPServer):
|
|||||||
try:
|
try:
|
||||||
self.handle_request()
|
self.handle_request()
|
||||||
except:
|
except:
|
||||||
print traceback.format_exc()
|
logger.error(traceback.format_exc())
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
t=Thread(target=self.serve, name='HTTP Server')
|
t=Thread(target=self.serve, name='HTTP Server')
|
||||||
@@ -30,4 +34,4 @@ class Server(ThreadingMixIn, BaseHTTPServer.HTTPServer):
|
|||||||
|
|
||||||
def handle_error(self, request, client_address):
|
def handle_error(self, request, client_address):
|
||||||
if not "socket.py" in traceback.format_exc():
|
if not "socket.py" in traceback.format_exc():
|
||||||
print traceback.format_exc()
|
logger.error(traceback.format_exc())
|
||||||
@@ -6011,6 +6011,10 @@ msgctxt "#70806"
|
|||||||
msgid "Changing this parameter permanently overwrites the Elementum settings.\nDo you want to continue?"
|
msgid "Changing this parameter permanently overwrites the Elementum settings.\nDo you want to continue?"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#70807"
|
||||||
|
msgid "Elementum does not support network folder downloads, do you want to change the download location?"
|
||||||
|
msgstr "Elementum non supporta i download su cartella di rete, vuoi cambiare il percorso di download?"
|
||||||
|
|
||||||
# DNS start [ settings and declaration ]
|
# DNS start [ settings and declaration ]
|
||||||
msgctxt "#707401"
|
msgctxt "#707401"
|
||||||
msgid "Enable DNS check alert"
|
msgid "Enable DNS check alert"
|
||||||
|
|||||||
@@ -6011,6 +6011,10 @@ msgctxt "#70806"
|
|||||||
msgid "Changing this parameter permanently overwrites the Elementum settings.\nDo you want to continue?"
|
msgid "Changing this parameter permanently overwrites the Elementum settings.\nDo you want to continue?"
|
||||||
msgstr "Modificando questo parametro vengono sovrascritte permanentemente le impostazioni di Elementum.\nVuoi continuare?"
|
msgstr "Modificando questo parametro vengono sovrascritte permanentemente le impostazioni di Elementum.\nVuoi continuare?"
|
||||||
|
|
||||||
|
msgctxt "#70807"
|
||||||
|
msgid "Elementum does not support network folder downloads, do you want to change the download location?"
|
||||||
|
msgstr "Elementum non supporta i download su cartella di rete, vuoi cambiare il percorso di download?"
|
||||||
|
|
||||||
# DNS start [ settings and declaration ]
|
# DNS start [ settings and declaration ]
|
||||||
msgctxt "#707401"
|
msgctxt "#707401"
|
||||||
msgid "Enable DNS check alert"
|
msgid "Enable DNS check alert"
|
||||||
|
|||||||
+20
-22
@@ -12,9 +12,8 @@ from platformcode import platformtools, logger
|
|||||||
files = None
|
files = None
|
||||||
|
|
||||||
def test_video_exists(page_url):
|
def test_video_exists(page_url):
|
||||||
types= "Archivo"
|
types= "File"
|
||||||
gen = "o"
|
msg = "The link has a problem."
|
||||||
msg = "El link tiene algún problema."
|
|
||||||
id_video = None
|
id_video = None
|
||||||
get = ""
|
get = ""
|
||||||
seqno = random.randint(0, 0xFFFFFFFF)
|
seqno = random.randint(0, 0xFFFFFFFF)
|
||||||
@@ -29,25 +28,24 @@ def test_video_exists(page_url):
|
|||||||
get = "&n=" + f_id
|
get = "&n=" + f_id
|
||||||
post = {"a":"f","c":1,"r":0}
|
post = {"a":"f","c":1,"r":0}
|
||||||
isfolder = True
|
isfolder = True
|
||||||
types= "Carpeta"
|
types= "Folder"
|
||||||
gen = "a"
|
|
||||||
if id_video:
|
if id_video:
|
||||||
#Aqui ya para hacer un check se complica, no hay una manera directa aún teniendo la id del video dentro de la carpeta
|
#Aqui ya para hacer un check se complica, no hay una manera directa aún teniendo la id del video dentro de la carpeta
|
||||||
return True, ""
|
return True, ""
|
||||||
|
|
||||||
codes = {-1: 'Se ha producido un error interno en Mega.nz',
|
codes = {-1: 'An internal error has occurred in Mega.nz',
|
||||||
-2: 'Error en la petición realizada, Cod -2',
|
-2: 'Error in the request made, Cod -2',
|
||||||
-3: 'Un atasco temporal o malfuncionamiento en el servidor de Mega impide que se procese su link',
|
-3: 'A temporary jam or malfunction in the Mega server prevents your link from being processed',
|
||||||
-4: 'Ha excedido la cuota de transferencia permitida. Vuelva a intentarlo más tarde',
|
-4: 'You have exceeded the allowed transfer fee. Try it again later',
|
||||||
-6: types + ' no encontrad' + gen + ', cuenta eliminada',
|
-6: types + ' not find deleted account',
|
||||||
-9: types + ' no encontrad'+ gen,
|
-9: types + ' not find',
|
||||||
-11: 'Acceso restringido',
|
-11: 'Restricted access',
|
||||||
-13: 'Está intentando acceder a un archivo incompleto',
|
-13: 'You are trying to access an incomplete file',
|
||||||
-14: 'Una operación de desencriptado ha fallado',
|
-14: 'Decryption operation failed',
|
||||||
-15: 'Sesión de usuario expirada o invalida, logueese de nuevo',
|
-15: 'User session expired or invalid, log in again',
|
||||||
-16: types + ' no disponible, la cuenta del uploader fue baneada',
|
-16: types + ' not available, the uploader account was banned',
|
||||||
-17: 'La petición sobrepasa su cuota de transferiencia permitida',
|
-17: 'The request exceeds your allowable transfer fee',
|
||||||
-18: types + ' temporalmente no disponible, intentelo de nuevo más tarde'
|
-18: types + ' temporarily unavailable, please try again later'
|
||||||
}
|
}
|
||||||
api = 'https://g.api.mega.co.nz/cs?id=%d%s' % (seqno, get)
|
api = 'https://g.api.mega.co.nz/cs?id=%d%s' % (seqno, get)
|
||||||
req_api = httptools.downloadpage(api, post=json.dumps([post])).data
|
req_api = httptools.downloadpage(api, post=json.dumps([post])).data
|
||||||
@@ -65,16 +63,16 @@ def test_video_exists(page_url):
|
|||||||
return False, msg
|
return False, msg
|
||||||
else:
|
else:
|
||||||
#Comprobación limite cuota restante
|
#Comprobación limite cuota restante
|
||||||
from megaserver import Client
|
from lib.megaserver import Client
|
||||||
|
global c
|
||||||
c = Client(url=page_url, is_playing_fnc=platformtools.is_playing)
|
c = Client(url=page_url, is_playing_fnc=platformtools.is_playing)
|
||||||
global files
|
global files
|
||||||
files = c.get_files()
|
files = c.get_files()
|
||||||
if files == 509:
|
if files == 509:
|
||||||
msg1 = "[B][COLOR tomato]El video excede el limite de visionado diario que Mega impone a los usuarios Free."
|
msg1 = "The video exceeds the daily viewing limit."
|
||||||
msg1 += " Prueba en otro servidor o canal.[/B][/COLOR]"
|
|
||||||
return False, msg1
|
return False, msg1
|
||||||
elif isinstance(files, (int, long)):
|
elif isinstance(files, (int, long)):
|
||||||
return False, "Error codigo %s" % str(files)
|
return False, "Error code %s" % str(files)
|
||||||
|
|
||||||
return True, ""
|
return True, ""
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,11 @@ def elementum_download(item):
|
|||||||
if elementum_setting:
|
if elementum_setting:
|
||||||
set_elementum(True)
|
set_elementum(True)
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
if config.get_setting('downloadpath').startswith('smb'):
|
||||||
|
select = platformtools.dialog_yesno('Elementum', config.get_localized_string(70807))
|
||||||
|
if select:
|
||||||
|
xbmc.executebuiltin("RunPlugin(plugin://plugin.video.kod/?eyJjaGFubmVsIjoic2hvcnRjdXRzIiwgImFjdGlvbiI6IlNldHRpbmdPblBvc2l0aW9uIiwgImNhdGVnb3J5Ijo2LCAic2V0dGluZyI6MX0=)")
|
||||||
|
else:
|
||||||
TorrentName = match(item.url, patron=r'btih(?::|%3A)([^&%]+)', string=True).match
|
TorrentName = match(item.url, patron=r'btih(?::|%3A)([^&%]+)', string=True).match
|
||||||
post = 'uri=%s&file=null&all=1' % urllib.quote_plus(item.url)
|
post = 'uri=%s&file=null&all=1' % urllib.quote_plus(item.url)
|
||||||
match(elementum_host + 'add', post=post, timeout=5, alfa_s=True, ignore_response_code=True)
|
match(elementum_host + 'add', post=post, timeout=5, alfa_s=True, ignore_response_code=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user