-Ridefinito il modo in cui vengono scritti i canali, per assicurare migliore stabilità, debuggabilità e coerenza
-Riscritti di conseguenza molti canali, corregendo di fatto moltissimi problemi che avete segnalato
-Quando aggiungi in videoteca da fonti in più lingue (ita/sub ita) o più qualità, ti viene chiesto quale tipo di fonte vuoi.
-Per gli amanti degli anime, aggiunto VVVVID (senza bisogno di account!)
-Aggiunti i server supervideo e hdload, fixato wstream
-migliorie varie
This commit is contained in:
marco
2019-11-07 19:10:53 +01:00
parent 29660ea54d
commit aea652c703
587 changed files with 12069 additions and 19856 deletions
+11 -8
View File
@@ -1,4 +1,5 @@
import urllib2
import traceback
class Cursor(object):
def __init__(self, file):
@@ -21,9 +22,11 @@ class Cursor(object):
req.headers['Range'] = 'bytes=%s-' % (offset)
try:
self.conn = urllib2.urlopen(req)
self.prepare_decoder(offset)
try:
self.prepare_decoder(offset)
except:
print(traceback.format_exc())
except:
#La url del archivo expira transcurrido un tiempo, si da error 403, reintenta volviendo a solicitar la url mediante la API
self.mega_request(offset, True)
def read(self,n=None):
@@ -35,7 +38,6 @@ class Cursor(object):
self.pos+=len(res)
return res
def seek(self,n):
if n>self._file.size:
n=self._file.size
@@ -53,20 +55,21 @@ class Cursor(object):
def __exit__(self,exc_type, exc_val, exc_tb):
self._file.cursors.remove(self)
if len(self._file.cursors) == 0: self._file.cursor = False
def decode(self, data):
return self.decryptor.decrypt(data)
def prepare_decoder(self,offset):
initial_value = self.initial_value + int(offset/16)
try:
from Cryptodome.Cipher import AES
from Cryptodome.Util import Counter
self.decryptor = AES.new(self._file._client.a32_to_str(self.k), AES.MODE_CTR, counter = Counter.new(128, initial_value = initial_value))
except:
from Crypto.Cipher import AES
from Crypto.Util import Counter
self.decryptor = AES.new(self._file._client.a32_to_str(self.k), AES.MODE_CTR, counter = Counter.new(128, initial_value = initial_value))
except:
from pyaes import aes
self.decryptor = aes.AESModeOfOperationCTR(f=self,key=self._client.a32_to_str(self.k),counter=aes.Counter(initial_value=initial_value))
rest = offset - int(offset/16)*16
if rest:
self.decode(str(0)*rest)
self.decode(str(0)*rest)