jaw20 / Crunchyroll-XML-Decoder

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

re-write the code to use python3 #65

Open alzamer2 opened 5 years ago

alzamer2 commented 5 years ago

as you know 2.7 is coming to end at 2020 what does that mean? the code will still work but if they changed their page we may new code that only supported on python3 i need some tester to check this code it work at python 3.3 or newer https://github.com/alzamer2/Crunchyroll-XML-Decoder-py3

darkhelmet2016 commented 5 years ago

https://www.crunchyroll.com/anime-news/2017/05/10/crunchyroll-adds-el-hazard-the-wanderers-and-the-third-the-girl-with-the-blue-eye-to-anime-catalog Here is the link for the info.

alzamer2 commented 5 years ago

@darkhelmet2016 these 2 anime are not us only anime, in fact, they are not restricted at all here trick to check if that anime in which country this anime is restricted get the series page link then add ".rss" at end then open that link look for media:restriction relationship="allow" type="country" and within it will be which country can watch this anime

alzamer2 commented 5 years ago

ok i tried new way for auto catch @Virusf can you try it out

  1. it can take these kinds of link:

    https://www.crunchyroll.com/the-rising-of-the-shield-hero https://www.crunchyroll.com/fr/the-rising-of-the-shield-hero https://www.crunchyroll.com/the-rising-of-the-shield-hero/episode-1-the-shield-hero-781148 https://www.crunchyroll.com/fr/the-rising-of-the-shield-hero/episode-1-the-shield-hero-781148

  2. skip dub episods if they exit in page

alzamer2 commented 5 years ago

@darkhelmet2016 these 2 anime are not us only anime, in fact, they are not restricted at all here trick to check if that anime in which country this anime is restricted get the series page link then add ".rss" at end then open that link look for media:restriction relationship="allow" type="country" and within it will be which country can watch this anime

lol chevked thiere pag now , they locked now only these country has view to them ca pr us vi as gu mp um

darkhelmet2016 commented 5 years ago

@alzamer2 https://www.crunchyroll.com/publisher/nozomientertainment Usually only services rights to US/CA because they are based solely in the US, you can even ask Crunchyroll or Nozomi, or just look in the blog when they post info and watch the rage post when other countries can not view a show because of not having rights to stream outside of North America. If they did update the territories as you say then they should have updated that link I showed as that is normally where they will say what country has what viewing rights.

darkhelmet2016 commented 5 years ago

@alzamer2 https://www.crunchyroll.com/publisher/nozomientertainment Usually only services rights to US/CA because they are based solely in the US, you can even ask Crunchyroll or Nozomi, or just look in the blog when they post info and watch the rage post when other countries can not view a show because of not having rights to stream outside of North America. If they did update the territories as you say then they should have updated that link I showed as that is normally where they will say what country has what viewing rights.

Virusf commented 5 years ago

@alzamer2 OK everything works well for me on the auto catch

alzamer2 commented 5 years ago

lol i dont remember the name but i remember there was anime that was us/ca locked too i enabled proxy option in settings

alzamer2 commented 5 years ago

and i cleaned HLS code i found it faster on my machine can some1 test it out?

Virusf commented 5 years ago

hold another test with no account

Do you have an account [Y/N]?n Traceback (most recent call last): File "crunchy-xml-decoder-py3.py", line 99, in login('', '') File "crunchy-xml-decoder\login.py", line 123, in login userstatus = getuserstatus(False, sess_id_usa) File "crunchy-xml-decoder\login.py", line 43, in getuserstatus checkusaid2 = session.get('http://api.crunchyroll.com/start_session.0.json?session_id=' + sessid).json() UnboundLocalError: local variable 'sessid' referenced before assignment

edit and with an account:

Do you have an account [Y/N]?y Username: xxx Password(don't worry the password are typing but hidden: Traceback (most recent call last): File "crunchy-xml-decoder-py3.py", line 97, in login(username, password) File "crunchy-xml-decoder\login.py", line 123, in login userstatus = getuserstatus(False, sess_id_usa) File "crunchy-xml-decoder\login.py", line 43, in getuserstatus checkusaid2 = session.get('http://api.crunchyroll.com/start_session.0.json?session_id=' + sessid).json() UnboundLocalError: local variable 'sessid' referenced before assignment

alzamer2 commented 5 years ago

UnboundLocalError

fixed, try it out

alzamer2 commented 5 years ago

hold another test with no account

Do you have an account [Y/N]?n Traceback (most recent call last): File "crunchy-xml-decoder-py3.py", line 99, in login('', '') File "crunchy-xml-decoder\login.py", line 123, in login userstatus = getuserstatus(False, sess_id_usa) File "crunchy-xml-decoder\login.py", line 43, in getuserstatus checkusaid2 = session.get('http://api.crunchyroll.com/start_session.0.json?session_id=' + sessid).json() UnboundLocalError: local variable 'sessid' referenced before assignment

edit and with an account:

Do you have an account [Y/N]?y Username: xxx Password(don't worry the password are typing but hidden: Traceback (most recent call last): File "crunchy-xml-decoder-py3.py", line 97, in login(username, password) File "crunchy-xml-decoder\login.py", line 123, in login userstatus = getuserstatus(False, sess_id_usa) File "crunchy-xml-decoder\login.py", line 43, in getuserstatus checkusaid2 = session.get('http://api.crunchyroll.com/start_session.0.json?session_id=' + sessid).json() UnboundLocalError: local variable 'sessid' referenced before assignment

fixed try it out

Virusf commented 5 years ago

OK everything works fine good work

Virusf commented 5 years ago

new bug

1


---- Start New Export ----

CrunchyRoll Downloader Toolkit DX v0.98b

Crunchyroll hasn't changed anything.

If you don't have a premium account, go and sign up for one now. It's well worth it, and supports the animators.


Booting up...

Please enter Crunchyroll video URL: https://www.crunchyroll.com/fr/hitoribocchi-no-marumaruseikatsu/episode-2-actually-thank-you-782899 Traceback (most recent call last): File "crunchy-xml-decoder-py3.py", line 378, in make_choise() File "crunchy-xml-decoder-py3.py", line 329, in make_choise ultimate() File "crunchy-xml-decoder\ultimate.py", line 128, in ultimate hls_url = stream_url[None] KeyError: None

alzamer2 commented 5 years ago

hmm can you try it again and see if the error getting repeated? if the error is repeated right click on the page(not video) and choose view sourcecode then looks for a line that begins with "vilos.config.media" and post it here

alzamer2 commented 5 years ago

@Virusf i'm not sure but i think i fixed your prpblem can you try it out?

Virusf commented 5 years ago

your old version is working now and the new one is working too

darkhelmet2016 commented 5 years ago

Traceback (most recent call last): |%100.0 File "C:\Program Files (x86)\Python36-32\lib\threading.py", line 916, in _boot strap_inner self.run() File "C:\Program Files (x86)\Python36-32\lib\threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "crunchy-xml-decoder\hls.py", line 289, in down_thread download(video, output, seg_url[i-1], i, connection_n) File "crunchy-xml-decoder\hls.py", line 279, in download copy_with_decrypt(raw, output, video.keys[0], video.media_sequence + seg_n-1 ) File "crunchy-xml-decoder\hls.py", line 204, in copy_with_decrypt data = input.read(blocksize) File "crunchy-xml-decoder\hls.py", line 95, in read downloadsize[self.cur-1] = self.offset IndexError: list assignment index out of range

alzamer2 commented 5 years ago

@darkhelmet2016 i updated the code the new code should use hls_.py (still under test) not hls.py

alzamer2 commented 5 years ago

can you download the new code and post the link you used so i can test it on my pc?

alzamer2 commented 5 years ago

hi @darkhelmet2016 you did not replay to me everything ok?

darkhelmet2016 commented 5 years ago

Sorry, was long day and git hub has for some reason reduced me to making one or two post a day. This time it would seem it is not decoding the characters for Russian as you can see in the log.

Please enter Crunchyroll video URL: http://www.crunchyroll.com/hitoribocchi-no-marumaruseikatsu/episode-3-getting-it -across-by-spinning-your-wheels-782900 Now Downloading - Hitoribocchi no Marumaruseikatsu Episode 3 - Getting It Across by Spinning Your Wheels 949MB/949MB |%100 @ 10.78Mb/s Part#145 |%100.0


---- Downloading Subtitle ----

Attempting to download English (US) subtitle... Attempting to download Português (Brasil) subtitle... Attempting to download ??????? subtitle... Attempting to download Español subtitle... Attempting to download Español (España) subtitle... Attempting to download Français (France) subtitle... Attempting to download Italiano subtitle... Attempting to download Deutsch subtitle... Starting mkv merge Deutsch English (US) English (US) English (US) English (US) English (US) Français (France) English (US) English (US) English (US) Italiano English (US) English (US) English (US) Português (Brasil) English (US) English (US) English (US) ??????? English (US) English (US) English (US) Español (España) English (US) English (US) English (US) Español English (US) English (US) English (US) mkvmerge v10.0.0 ('To Drown In You') 32bit 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels .ts': Using the demultiplexer for the format 'MPEG transport stream'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [deu][Deutsch].ass': Using the demultiplexer for the format 'SSA/ASS subtitles'.

'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [eng][English (US)].ass': Using the demultiplexer for the format 'SSA/ASS subtit les'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [fre][Français (France)].ass': Using the demultiplexer for the format 'SSA/ASS s ubtitles'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [ita][Italiano].ass': Using the demultiplexer for the format 'SSA/ASS subtitles' . 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [por][Português (Brasil)].ass': Using the demultiplexer for the format 'SSA/ASS subtitles'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [rus][???????].ass': Using the demultiplexer for the format 'SSA/ASS subtitles'.

'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [spa][Español (España)].ass': Using the demultiplexer for the format 'SSA/ASS su btitles'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [spa][Español].ass': Using the demultiplexer for the format 'SSA/ASS subtitles'.

'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels .ts' track 0: Using the output module for the format 'AVC/h.264 (unframed)'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels .ts' track 1: Using the output module for the format 'AAC'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [deu][Deutsch].ass' track 0: Using the output module for the format 'text subtit les'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [eng][English (US)].ass' track 0: Using the output module for the format 'text s ubtitles'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [fre][Français (France)].ass' track 0: Using the output module for the format 't ext subtitles'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [ita][Italiano].ass' track 0: Using the output module for the format 'text subti tles'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [por][Português (Brasil)].ass' track 0: Using the output module for the format ' text subtitles'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [rus][???????].ass' track 0: Using the output module for the format 'text subtit les'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [spa][Español (España)].ass' track 0: Using the output module for the format 'te xt subtitles'. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels [spa][Español].ass' track 0: Using the output module for the format 'text subtit les'. The file 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export \Hitoribocchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Yo ur Wheels[1080p].mkv' has been opened for writing. 'C:\Users\Owner\Downloads\Crunchyroll-XML-Decoder-py3-master (1)\export\Hitoribo cchi no Marumaruseikatsu Episode - 3 - Getting It Across by Spinning Your Wheels .ts' track 0: Extracted the aspect ratio information from the MPEG-4 layer 10 (A VC) video data and set the display dimensions to 1920/1080. Progress: 100% The cue entries (the index) are being written... Multiplexing took 31 seconds. Merge process complete Starting Final Cleanup

alzamer2 commented 5 years ago

lol you can forget this error its just your console cant print RUS character, from what i saw it downloaded the episode and mux the subtitle alright check export folder to see if the downloaded episode is there or not

darkhelmet2016 commented 5 years ago

But did notice one issue, it will overwrite files if there is an uncensored version like https://www.crunchyroll.com/senran-kagura-shinovi-master, some shows have multiple versions for cut/uncut or if it has more than one dub like Spanish or Russian. https://www.crunchyroll.com/konosuba-gods-blessing-on-this-wonderful-world.

alzamer2 commented 5 years ago

ohh ok will look into it @darkhelmet2016 can you open issue in the code so i can track it there

darkhelmet2016 commented 5 years ago

@alzamer2 You mean submit it here? https://github.com/alzamer2/Crunchyroll-XML-Decoder-py3/issues

alzamer2 commented 5 years ago

yep