einstein95 / crunchy-xml-decoder

GNU General Public License v2.0
35 stars 14 forks source link

autocatch link #75

Open rcyclope opened 8 years ago

rcyclope commented 8 years ago

add few line in crunchy-xml-decode.py

...
import re, urllib2
...
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#(autocatch)#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
def autocatch():
    print 'indicate the url : '
    url=raw_input()
    mykey = urllib2.urlopen(url)
    take = open("queue_.txt", "w")

    for text in mykey:
        match = re.search('<a href="/(.+?)" title=', text)
        if match:
            print >> take, 'http://www.crunchyroll.com/'+match.group(1)

    take.close()

    with open('queue_.txt') as f,  open('queue.txt', 'w') as fout:
        fout.writelines(reversed(f.readlines()))
    os.remove('queue_.txt')

like this one d0c470e731 1

and add line in menu 296 => autocatch crunchylink :)

and line 330 :

    elif seleccion == 8 :
        autocatch()
        queueu('.\\queue.txt')
    elif seleccion == 9 :
        import debug
    elif seleccion == 0 :
        sys.exit()
jsonn commented 8 years ago

I don't understand the purpose of this change.

rcyclope commented 8 years ago

he catch all link from series exemple : in menu choice 8 indicate the url of the series (not episode link) http://puu.sh/qMpPX/e551ba83b3.png

and he catch all episodes url in queue.txt and start it http://puu.sh/qMpWu/d8b684abde.png

Dokman commented 8 years ago

@rcyclope not works i have this error ;D image

rcyclope commented 8 years ago

have you inserted the lignes like this one http://puu.sh/rjNgj/199e5069d4.png

i think it's a space problem in the code try to see with python idle if you have a red ligne on "elif seleccion == 8 :"

C/P this lignes :

    try:
        seleccion = int(input("> "))
    except:
        try:
            os.system('cls')
        except:
            try:
                os.system('clear')
            except:
                pass
        print "ERROR: Invalid option."
        makechoise()
    if seleccion == 1 :
        ultimate.ultimate(raw_input('Please enter Crunchyroll video URL:\n'), '', '')
    elif seleccion == 2 :
        decode.decode(raw_input('Please enter Crunchyroll video URL:\n'))
    elif seleccion == 3 :
        username = raw_input(u'Username: ')
        password = getpass('Password(don\'t worry the password are typing but hidden:')
        login.login(username, password)
        makechoise()
    elif seleccion == 4 :
        login.login('', '')
        makechoise()
    elif seleccion == 5 :
        queueu('.\\queue.txt')
    makechoice()
    elif seleccion == 6 :
        settings_()
        makechoise()
    elif seleccion == 7 :
        autocatch()
        queueu('.\\queue.txt')
    elif seleccion == 8 :
        import debug
    elif seleccion == 0 :
        sys.exit()
    else:
        try:
            os.system('cls')
        except:
            try:
                os.system('clear')
            except:
                pass
        print "ERROR: Invalid option."
        makechoise() 
Dokman commented 8 years ago

@rcyclope don't worry i downloaded an IDE for python and i fixed the code, then i make a pull request now all we have the autocatch function so... yeah!

Dokman commented 8 years ago

@rcyclope i don't have any knowledge of python lang and i don't know how this library works, but this autocatch need to get the season, for example if you use jojo bizarre adventure it will download like 3 or 4 seasons

rcyclope commented 8 years ago

get link by season ?? i'll see that if possible

Dokman commented 8 years ago

@rcyclope thanks to watch if it can be done, cause if we download an extense anime with a lot of seasons we have all the episodes in the same location and messy episodes

rcyclope commented 8 years ago

I tried to catch a link per season, but it is very difficult to select some link in the html tag, because it's too broad

if someone has the soluce please answer it