[Youku]好像如果优酷专辑中有限制观看的会出现404错误并中断程序 #122

Closed
reverland opened this Issue Mar 6, 2013 · 6 comments

Comments

Projects
None yet
2 participants
Contributor

reverland commented Mar 6, 2013

✘ ⮀ ~/Work/project/quju ⮀ python3 ~/.local/bin/you-get http://www.youku.com/playlist_show/id_3958669.html
Processing 1 of 43 videos...
Video Site: Youku.com
Title: 曲剧 刘海砍樵 周玉珍、李振乾演唱
Type: Flash video (video/x-flv)
Size: 2.35 MB (2467589 Bytes)

Skipping ./曲剧/曲剧 刘海砍樵 周玉珍、李振乾演唱.flv: file already exists

Processing 2 of 43 videos...
Video Site: Youku.com
Title: 曲剧 小寡妇劝坟B
Type: Flash video (video/x-flv)
Size: 53.62 MB (56224103 Bytes)

Skipping ./曲剧/曲剧 小寡妇劝坟B.flv: file already exists

Processing 3 of 43 videos...
Video Site: Youku.com
Title: 曲剧 小寡妇开店上A(2)
Type: Flash video (video/x-flv)
Size: 36.38 MB (38148204 Bytes)

Skipping ./曲剧/曲剧 小寡妇开店上A(2).flv: file already exists

Processing 4 of 43 videos...
Video Site: Youku.com
Title: 曲剧 小寡妇开店A(1)
Type: Flash video (video/x-flv)
Size: 33.96 MB (35614239 Bytes)

Skipping ./曲剧/曲剧 小寡妇开店A(1).flv: file already exists

Processing 5 of 43 videos...
Video Site: Youku.com
Title: 曲剧 小二姐做梦
Type: Flash video (video/x-flv)
Size: 88.48 MB (92773573 Bytes)

Skipping ./曲剧/曲剧 小二姐做梦.flv: file already exists

Processing 6 of 43 videos...
Video Site: Youku.com
Title: 曲剧 小寡妇开店A(3)
Type: Flash video (video/x-flv)
Size: 32.19 MB (33752569 Bytes)

Skipping ./曲剧/曲剧 小寡妇开店A(3).flv: file already exists

Processing 7 of 43 videos...
Traceback (most recent call last):
File "/home/lyy/.local/bin/you-get", line 9, in
load_entry_point('you-get==0.3.0', 'console_scripts', 'you-get')()
File "/home/lyy/.local/lib64/python3.2/site-packages/you_get/main.py", line 67, in main
script_main('you-get', any_download, any_download_playlist)
File "/home/lyy/.local/lib64/python3.2/site-packages/you_get/common.py", line 657, in script_main
download_main(download, download_playlist, args, playlist, output_dir, merge, info_only)
File "/home/lyy/.local/lib64/python3.2/site-packages/you_get/common.py", line 577, in download_main
download(url, output_dir = output_dir, merge = merge, info_only = info_only)
File "/home/lyy/.local/lib64/python3.2/site-packages/you_get/main.py", line 60, in any_download
m.download(url, output_dir = output_dir, merge = merge, info_only = info_only)
File "/home/lyy/.local/lib64/python3.2/site-packages/you_get/downloader/youku.py", line 137, in youku_download
youku_download_playlist(url, output_dir, merge, info_only)
File "/home/lyy/.local/lib64/python3.2/site-packages/you_get/downloader/youku.py", line 198, in youku_download_playlist
youku_download(id, output_dir, merge = merge, info_only = info_only)
File "/home/lyy/.local/lib64/python3.2/site-packages/you_get/downloader/youku.py", line 143, in youku_download
youku_download_by_id(id2, title, output_dir, merge = merge, info_only = info_only)
File "/home/lyy/.local/lib64/python3.2/site-packages/you_get/downloader/youku.py", line 129, in youku_download_by_id
urls = url_locations(urls) # Use real (redirected) URLs for resuming of downloads
File "/home/lyy/.local/lib64/python3.2/site-packages/you_get/common.py", line 147, in url_locations
response = request.urlopen(request.Request(url))
File "/usr/lib64/python3.2/urllib/request.py", line 138, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python3.2/urllib/request.py", line 375, in open
response = meth(req, response)
File "/usr/lib64/python3.2/urllib/request.py", line 487, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python3.2/urllib/request.py", line 413, in error
return self._call_chain(_args)
File "/usr/lib64/python3.2/urllib/request.py", line 347, in _call_chain
result = func(_args)
File "/usr/lib64/python3.2/urllib/request.py", line 495, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

✘ ⮀ ~/Work/project/quju ⮀ ~/.local/bin/you-get -V
You-Get 0.3.0, a video downloader.

Contributor

reverland commented Mar 6, 2013

I just tweaked it to work for me : )
vim ~/.local/lib64/python3.2/site-packages/you_get/downloader/youku.py

196     for i, id in enumerate(ids):
197         try:
198             print('Processing %s of %s videos...' % (i + 1, len(ids)))
199             youku_download(id, output_dir, merge = merge, info_only = info_only)
200         except KeyboardInterrupt:
201             raise KeyboardInterrupt
202         else:
203             continue
Owner

soimort commented Mar 7, 2013

I believe you'd have already caught the exception properly:

except:    # instead of 'else'
    continue

soimort closed this in 56e2595 Mar 7, 2013

Owner

soimort commented Mar 7, 2013

Next time you can send me a pull request.

Owner

soimort commented Mar 7, 2013

@reverland

Ctrl-Z and kill %% will do that.
Ctrl-C should provide users an easy way to skip the downloading of current video, if it is too large or simply not what they want.

Owner

soimort commented Mar 7, 2013

GitHub娘吞我在commit下面的回复O.o

Contributor

reverland commented Mar 23, 2013

github娘也会吞评论= =

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment