Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error downloading some videos from crunchyroll -- TypeError: argument of type 'NoneType' is not iterable #7930

Closed
Darklight-03 opened this issue Dec 21, 2015 · 5 comments

Comments

@Darklight-03
Copy link

@Darklight-03 Darklight-03 commented Dec 21, 2015

Downloading both this: http://www.crunchyroll.com/shin-sekai-yori-from-the-new-world/episode-6-escape-611581
and episode 20 cause this error to occur...

youtube-dl http://www.crunchyroll.com/shin-sekai-yori-from-the-new-world/episode-6-escape-611581 --write-sub --sub-lang enUS --embed-subs -v -u #######
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--prefer-ffmpeg', u'http://www.crunchyroll.com/shin-sekai-yori-from-the-new-world/episode-6-escape-611581', u'--write-sub', u'--sub-lang', u'enUS', u'--embed-subs', u'-v', u'-u', u'PRIVATE']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.12.18
[debug] Python version 2.7.6 - Linux-3.19.0-39-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 9.18-6, avprobe 9.18-6, ffmpeg N-76944-g15206ff, ffprobe N-76944-g15206ff, rtmpdump 2.4
[debug] Proxy map: {}
[Crunchyroll] Logging in
[Crunchyroll] 611581: Downloading webpage
[Crunchyroll] 611581: Downloading media info
[Crunchyroll] 611581: Downloading media info for 360p
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/bin/youtube-dl/__main__.py", line 19, in <module>
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 410, in main
  File "/usr/local/bin/youtube-dl/youtube_dl/__init__.py", line 400, in _real_main
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1675, in download
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 663, in extract_info
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 290, in extract
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/crunchyroll.py", line 342, in _real_extract
TypeError: argument of type 'NoneType' is not iterable
@CaptSolo
Copy link

@CaptSolo CaptSolo commented Dec 21, 2015

Like @dstftw noted this Crunchyroll URL is geo-restricted - only people from allowed regions can check the issue. (I can't access that URL)

Looking at the line where error is thrown (1) it would appear that video_url var (extracted earlier in the same function) is None.

  1. https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/crunchyroll.py#L342
@paetre
Copy link

@paetre paetre commented Dec 28, 2015

From what I can tell, what is throwing the error is actually a bug on crunchyroll's own website.

For @elitefroggy's two episodes:
http://www.crunchyroll.com/shin-sekai-yori-from-the-new-world/episode-6-escape-611581-- if you try to play the 360p ('SD') video it's busted in their own player but their site gives you the option to watch the higher qualities.

http://www.crunchyroll.com/shin-sekai-yori-from-the-new-world/episode-20-a-cold-and-sunlit-place-611609, if you try to play the 480p video it's broken on the site while 360p is just fine and dandy.

When crunchyroll.py hits these two errors is when it crashes and spits out the 'NoneType' error message (because technically being passed is an empty URL string). I'm not a coder so I wouldn't know how to make crunchyroll.py just ignore the dead link errors and just not let you download said dead format links.

Hope that helps.

Edit: To get a specific video format via web browser, you specify it as part of the URL, so example: http://www.crunchyroll.com/shin-sekai-yori-from-the-new-world/episode-6-escape-611581?p480=1 brings up the 480p video from elitefroggy's first problem link. if you use the same link with youtube-dl, it still tries to download all the media info for all the various formats and then tosses out the same 'NoneType' error.

@oittaa
Copy link
Contributor

@oittaa oittaa commented Jan 7, 2016

Maybe change https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/crunchyroll.py#L342:

 if video_url is not None and '.fplive.net/' in video_url:
@oittaa
Copy link
Contributor

@oittaa oittaa commented Jan 7, 2016

Works for me with my patched version.

python -m youtube_dl http://www.crunchyroll.com/shin-sekai-yori-from-the-new-world/episode-6-escape-611581
[Crunchyroll] 611581: Downloading webpage
[Crunchyroll] 611581: Downloading media info
[Crunchyroll] 611581: Downloading media info for 360p
[Crunchyroll] 611581: Downloading media info for 480p
[Crunchyroll] 611581: Checking 480p URL
[Crunchyroll] 611581: Downloading media info for 720p
[Crunchyroll] 611581: Checking 720p URL
[Crunchyroll] 611581: Downloading media info for 720p
[Crunchyroll] 611581: Checking 720p URL
[Crunchyroll] 611581: Downloading media info for 1080p
[Crunchyroll] 611581: Checking 1080p URL
[Crunchyroll] 611581: Downloading media info for 1080p
[Crunchyroll] 611581: Checking 1080p URL
[download] Destination: Shin Sekai Yori (From the New World) Episode 6 – Escape-611581.mp4
[download] 100% of 140.32MiB in 01:24
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jan 7, 2016

This issue will be fixed in the next version.

@dstftw dstftw closed this Jan 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
@CaptSolo @Darklight-03 @dstftw @oittaa @paetre and others
You can’t perform that action at this time.