diff --git a/README.md b/README.md index 5ee9bea..48073c0 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ Requires Python modules: - lxml (https://pypi.python.org/pypi/lxml/3.2.5) - m3u8 (https://pypi.python.org/pypi/m3u8/) - cfscrape (https://pypi.python.org/pypi/cfscrape/) +- Node.js is required for (safe) Javascript execution. + Your computer or server may already have it (check with node -v). If not, you can install it with apt-get install + nodejs on Ubuntu and Debian. Otherwise, please read ( https://nodejs.org/en/download/package-manager/ )Node's installation instructions. crunchy-xml-decoder will try to install PyCrypto and lxml automatically, if they are missing. m3u8 and crscrape can be installed using PIP. diff --git a/crunchy-xml-decoder/altfuncs.py b/crunchy-xml-decoder/altfuncs.py index 6249a41..a9b5720 100644 --- a/crunchy-xml-decoder/altfuncs.py +++ b/crunchy-xml-decoder/altfuncs.py @@ -67,10 +67,12 @@ def gethtml(url): u'العربية' : 'arME' , u'Deutsch' : 'deDE'}[lang] if forceusa: try: - session.cookies['sess_id'] = requests.get('http://www.crunblocker.com/sess_id.php').text + session.cookies['sess_id'] = re.split('"',requests.get('https://cr.onestay.moe/getid').text)[5] + #print 'I recommend to re-login so we don\'t overload crunchyroll unblocker' except: sleep(10) # sleep so we don't overload crunblocker - session.cookies['sess_id'] = requests.get('http://www.crunblocker.com/sess_id.php').text + session.cookies['sess_id'] = re.split('"',requests.get('https://rubbix.net/crunchyroll/').text)[5] + #print 'I recommend to re-login so we don\'t overload crunchyroll unblocker' parts = urlparse.urlsplit(url) if not parts.scheme or not parts.netloc: print 'Apparently not a URL' @@ -103,15 +105,20 @@ def getxml(req, med_id): u'العربية' : 'arME' , u'Deutsch' : 'deDE'}[lang] if forceusa: try: - session.cookies['sess_id'] = requests.get('http://www.crunblocker.com/sess_id.php').text + session.cookies['sess_id'] = session.cookies['usa_sess_id'] except: - sleep(10) # sleep so we don't overload crunblocker - session.cookies['sess_id'] = requests.get('http://www.crunblocker.com/sess_id.php').text + try: + session.cookies['sess_id'] = re.split('"',requests.get('https://cr.onestay.moe/getid').text)[5] + + except: + sleep(10) # sleep so we don't overload crunblocker + session.cookies['sess_id'] = re.split('"',requests.get('https://rubbix.net/crunchyroll/').text)[5] headers = {'Referer': 'http://static.ak.crunchyroll.com/versioned_assets/ChromelessPlayerApp.17821a0e.swf', 'Host': 'www.crunchyroll.com', 'Content-type': 'application/x-www-form-urlencoded', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:26.0) Gecko/20100101 Firefox/26.0)'} res = session.post(url, params=payload, headers=headers) res.encoding = 'UTF-8' + #print session.cookies return res.text diff --git a/crunchy-xml-decoder/functtest.py b/crunchy-xml-decoder/functtest.py index 2c690da..5641b9d 100644 --- a/crunchy-xml-decoder/functtest.py +++ b/crunchy-xml-decoder/functtest.py @@ -92,12 +92,24 @@ def unzip_(filename_,out): except ImportError: print 'Installing Cfscrape...', try: - if python_bit_=="32 bit" or python_bit_=="64 bit": + #if python_bit_=="32 bit" or python_bit_=="64 bit": pip.main(['install', '--quiet', 'cfscrape']) print "Installed" except KeyError: print "Something Has Gone Wrong While Retrieving Cfscrape link\nPlease Download Cfscrape Manually" +try: + import m3u8 + print('m3u8 installed') +except ImportError: + print 'Installing m3u8...', + try: + #if python_bit_=="32 bit" or python_bit_=="64 bit": + pip.main(['install', '--quiet', 'm3u8']) + print "Installed" + except KeyError: + print "Something Has Gone Wrong While Retrieving m3u8 link\nPlease Download m3u8 Manually" + if Crypto_link_ or lxml_link_: if not os.path.exists("temp"): os.makedirs("temp") diff --git a/crunchy-xml-decoder/login.py b/crunchy-xml-decoder/login.py index 94edd86..6a04660 100644 --- a/crunchy-xml-decoder/login.py +++ b/crunchy-xml-decoder/login.py @@ -55,6 +55,11 @@ def login(username, password): c.expires = 9999999999 # Saturday, November 20th 2286, 17:46:39 (GMT) del session.cookies['c_visitor'] + #try: + #session.cookies['usa_sess_id'] = re.split('"',requests.get('https://cr.onestay.moe/getid').text)[5] + #except: + #sleep(10) # sleep so we don't overload crunblocker + #session.cookies['usa_sess_id'] = re.split('"',requests.get('https://rubbix.net/crunchyroll/').text)[5] userstatus = getuserstatus(session) if username != '' and userstatus[1] == 'Guest': diff --git a/crunchy-xml-decoder/ultimate.py b/crunchy-xml-decoder/ultimate.py index bbd8327..2f847ff 100644 --- a/crunchy-xml-decoder/ultimate.py +++ b/crunchy-xml-decoder/ultimate.py @@ -224,6 +224,7 @@ def ultimate(page_url, seasonnum, epnum): #h = HTMLParser.HTMLParser() title = re.findall('(.+?)', html)[0].replace('Crunchyroll - Watch ', '') + print format('Now Downloading - '+title) if len(os.path.join('export', title+'.flv')) > 255: title = re.findall('^(.+?) \- ', title)[0]