Skip to content

Commit

Permalink
Update CrunchySubs.py
Browse files Browse the repository at this point in the history
Algunos cambios en sintaxis.
  • Loading branch information
7ouma committed Aug 31, 2015
1 parent 896d375 commit dd6ffe4
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions CrunchySubs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# encoding=utf8
#!/usr/bin/env python
'''# -*- coding: utf-8 -*-'''

from __future__ import print_function
import sys
reload(sys)
Expand All @@ -12,7 +10,7 @@
from time import sleep
import re
try:
from BeautifulSoup import BeautifulSoup
from BeautifulSoup import BeautifulSoup, BeautifulStoneSoup
except ImportError as e:
print("CrunchySubs necesita de BeautifulSoup3 para poder funcionar.")
sleep(60)
Expand All @@ -30,9 +28,17 @@
import math as Math
from crypto.cipher.aes_cbc import AES_CBC
from crypto.cipher.base import noPadding
from BeautifulSoup import BeautifulSoup, BeautifulStoneSoup
from array import array
about = '''
CrunchySubs es un script hecho en python que permite descargar subtítulos de Crunchyroll de forma premium y free.
Créditos:
Autor original de la función para desencriptar: Desconocido para mí, si alguien sabe, favor dejar un comentario en el blog, por Github o mediante un correo.
Autor del resto del script: Touman (Miguel A.). Más información del script en: http://crunchysubs.blogspot.com/ y https://github.com/7ouma/CrunchySubs
Puedes contactarme mediante mi correo: [email protected]
'''
class Base64Decoder:
def __init__(self):
pass
Expand Down Expand Up @@ -252,7 +258,6 @@ def __init__(self, setConfig = True):

def setConfig(self, config):
try:
print (config)
self.dir = config["dir"]
while True:
if self.dir.lower() == "default":
Expand Down Expand Up @@ -322,8 +327,7 @@ def checkFile(self, name):


def returnTitle(self,lang):
titulo = self.titulo
titulo = titulo[0:39] if len(titulo) > 40 else titulo
titulo = self.titulo[0:39] if len(self.titulo) > 40 else self.titulo
i = 1
assfilename = self.checkStr(titulo + " - " + self.episodio + " ["+lang+"].ass")
while True:
Expand All @@ -335,7 +339,7 @@ def returnTitle(self,lang):
return assfilename

def saveSubs(self, subs, title):
f = open(os.path.join(self.dir,title), 'wb')
f = open(os.path.join(self.dir,title), 'w')
f.write(subs.encode('utf-8-sig'))
f.close()
def checkStr(self, string):
Expand Down Expand Up @@ -648,8 +652,6 @@ def print2(string):
cls()
elif option == "5":
print(about)
elif option == "6":
print (changelog)
elif option == "0":
print("Gracias por usar CrunchySubs (:...")
Menu = False
Expand Down

0 comments on commit dd6ffe4

Please sign in to comment.