PeterDing / iScript

各种脚本 -- 关于 虾米 xiami.com, 百度网盘 pan.baidu.com, 115网盘 115.com, 网易音乐 music.163.com, 百度音乐 music.baidu.com, 360网盘/云盘 yunpan.cn, 视频解析 flvxz.com, bt torrent ↔ magnet, ed2k 搜索, tumblr 图片下载, unzip

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

下载用户的所有收藏失败报错:IndexError: list index out of range

nujabse opened this issue · comments

批量下载收藏曲目报错如下
The Workhouse.mp3.tmp" [1]
Traceback (most recent call last):
File "/home/mathholic/git-repository/iScript/xiami.py", line 1169, in
main(argv)
File "/home/mathholic/git-repository/iScript/xiami.py", line 1149, in main
x.url_parser(urls)
File "/home/mathholic/git-repository/iScript/xiami.py", line 468, in url_parser
self.download_user_songs(url_lib_songs, u'收藏的歌曲')
File "/home/mathholic/git-repository/iScript/xiami.py", line 762, in download_user_songs
songs = self.get_song(i)
File "/home/mathholic/git-repository/iScript/xiami.py", line 640, in get_song
songs = self.get_songs(album_id, song_id=song_id)
File "/home/mathholic/git-repository/iScript/xiami.py", line 589, in get_songs
song_info['song_played'] = song_played[i]
IndexError: list index out of range

我这不能复现你的问题,贴一下你的要保存的 url

抱歉,之前忘记给出URL了。我要保存的url如下:
http://www.xiami.com/space/lib-song/u/22156413?spm=a1z1s.6928797.1561534513.1.NaUN7S

xiami.py 现在暂不支持保存用户。

目前只支持保存 song, artist, album, collect。

也就是说不能批量下载用户所有收藏?后续版本会添加吗?

批量下载用户所有收藏是可以的,就是不能关注用户。

下载收藏用:

python /path/to/xiami.py d http://www.xiami.com/u/22156413?spm=a1z1s.6928797.1561534497.1.hP0Pbn
  >> m   # 该用户歌曲库.
  >> c   # 最近在听
  >> s   # 分享的音乐
  >> rm  # 私人电台:来源于"收藏的歌曲","收藏的专辑",                                 "喜欢的艺人","收藏的精选集"
  >> rc  # 虾米猜:基于试听行为所建立的个性电台
  >> m
Traceback (most recent call last):
  File "/Users/Rashawn/Downloads/xiami/xiami.py", line 1169, in <module>
    main(argv)
  File "/Users/Rashawn/Downloads/xiami/xiami.py", line 1149, in main
    x.url_parser(urls)
  File "/Users/Rashawn/Downloads/xiami/xiami.py", line 468, in url_parser
    self.download_user_songs(url_lib_songs, u'收藏的歌曲')
  File "/Users/Rashawn/Downloads/xiami/xiami.py", line 762, in download_user_songs
    songs = self.get_song(i)
  File "/Users/Rashawn/Downloads/xiami/xiami.py", line 640, in get_song
    songs = self.get_songs(album_id, song_id=song_id)
  File "/Users/Rashawn/Downloads/xiami/xiami.py", line 610, in get_songs
    cd_serial_auth = int(songs[-1]['cd_serial']) > 1
IndexError: list index out of range

出现同样的问题

我也会出现这样的问题,具体症状就是下载用户收藏列表中的歌曲大约30首的时候,就会自动报错,显示“list index out of range".

On Oct 7, 2016 7:04 PM, "yqrashawn" notifications@github.com wrote:

m # 该用户歌曲库.
c # 最近在听
s # 分享的音乐
rm # 私人电台:来源于"收藏的歌曲","收藏的专辑",
"喜欢的艺人","收藏的精选集"
rc # 虾米猜:基于试听行为所建立的个性电台
m
Traceback (most recent call last):
File "/Users/Rashawn/Downloads/xiami/xiami.py", line 1169, in
main(argv)
File "/Users/Rashawn/Downloads/xiami/xiami.py", line 1149, in main
x.url_parser(urls)
File "/Users/Rashawn/Downloads/xiami/xiami.py", line 468, in url_parser
self.download_user_songs(url_lib_songs, u'收藏的歌曲')
File "/Users/Rashawn/Downloads/xiami/xiami.py", line 762, in
download_user_songs
songs = self.get_song(i)
File "/Users/Rashawn/Downloads/xiami/xiami.py", line 640, in get_song
songs = self.get_songs(album_id, song_id=song_id)
File "/Users/Rashawn/Downloads/xiami/xiami.py", line 610, in get_songs
cd_serial_auth = int(songs[-1]['cd_serial']) > 1
IndexError: list index out of range

出现同样的问题


You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
#74 (comment),
or mute
the thread
https://github.com/notifications/unsubscribe-auth/AJBHBzl9XYa3S1CmPvACSXL3l6dz3GERks5qxicigaJpZM4JD0ny
.

@yqrashawn @nujabse 能给我你们出错的连接吗

已修复,看看还有什么问题

下载多了会一直失败,换个IP能好一点, 过一会又出问题。

报什么错

~/D/xiami ❯❯❯ python2 xiami.py d http://www.xiami.com/space/lib-song/u/9808355                                                                                                                    I zprezto ✱ ◼
  >> m   # 该用户歌曲库.
  >> c   # 最近在听
  >> s   # 分享的音乐
  >> rm  # 私人电台:来源于"收藏的歌曲","收藏的专辑",                                 "喜欢的艺人","收藏的精选集"
  >> rc  # 虾米猜:基于试听行为所建立的个性电台
  >> m

  ++ download: #1/73# 3.迷航 - Glow Curve.mp3
  |-- Error: can't get durl

  ++ download: #1/93# 01.白日梦蓝 - 刺猬.mp3
  |-- Error: can't get durl

  ++ download: #1/105# 02.The Rest of the Day - Bedhead.mp3
  |-- Error: can't get durl

  ++ download: #1/111# 04.Jerk It Out - Caesars.mp3
  |-- Error: can't get durl

  ++ download: #1/116# 06.New Slang - The Shins.mp3
  |-- Error: can't get durl

  ++ download: #1/118# 04.Use Somebody - Kings of Leon.mp3
  |-- Error: can't get durl

  ++ download: #1/129# 02.Take My Hand - Simple Plan.mp3
  |-- Error: can't get durl

  ++ download: #1/130# [Disc-1 # iTunes Deluxe Edition] 01.You Suck At Love - Simple Plan.mp3
  |-- Error: can't get durl

  ++ download: #1/131# 02.Welcome To My Life - Simple Plan.mp3
  |-- Error: can't get durl

  ++ download: #1/132# 06.Crazy - Simple Plan.mp3
  |-- Error: can't get durl

  ++ download: #1/133# 04.Your Love Is a Lie - Simple Plan.mp3
  |-- Error: can't get durl

  ++ download: #1/148# [Disc-1 # 2011 Legacy Edition] 08.Such a Night - Elvis Presley.mp3
  |-- Error: can't get durl
Traceback (most recent call last):
  File "xiami.py", line 1180, in <module>
    main(argv)
  File "xiami.py", line 1160, in main
    x.url_parser(urls)
  File "xiami.py", line 468, in url_parser
    self.download_user_songs(url_lib_songs, u'收藏的歌曲')
  File "xiami.py", line 766, in download_user_songs
    songs = self.get_song(i)
  File "xiami.py", line 644, in get_song
    songs = self.get_songs(album_id, song_id=song_id)
  File "xiami.py", line 527, in get_songs
    html1, html2 = html.split('<div id="album_acts')
ValueError: need more than 1 value to unpack

Error: can't get durl 还有最下面这个ValueError: need more than 1 value to unpack

փ xm d http://www.xiami.com/space/lib-song/u/9808355
  >> m   # 该用户歌曲库.
  >> c   # 最近在听
  >> s   # 分享的音乐
  >> rm  # 私人电台:来源于"收藏的歌曲","收藏的专辑",     "喜欢的艺人","收藏的精选集"
  >> rc  # 虾米猜:基于试听行为所建立的个性电台
  >> m

  ++ download: #1/1# 10.Steppin' Out X 威风堂々 - Kyle Xian.mp3
  |-- MP3-Quality: High
2016-10-11 11:42:15 URL:http://m6.file.xiami.com/894/214391894/2100283084/1775688762_59775478_h.mp3?auth_key=9c1137470bc025f7485b4501a1f5b141-1476759600-0-null[26800891/26800891] -> "/private/tmp/t/虾米用户 9808355 收藏的歌曲/10.Steppin' Out X 威风堂々 - Kyle Xian.mp3.tmp" [1]

  ++ download: #1/2# 02.Girls - MARiA.mp3
  |-- MP3-Quality: High
2016-10-11 11:42:25 URL:http://m6.file.xiami.com/452/115452/520464/1771081969_3535466_h.mp3?auth_key=8b5df380fa25934702b2c90a2f4f682d-1476759600-0-null [9293470/9293470] -> "/private/tmp/t/虾米用户 9808355 收藏的歌曲/02.Girls - MARiA.mp3.tmp" [1]

我这里正常。
是不是你下载的太多了,把你ip封了

有可能 下了700首 还剩下400首 三个IP都不行了, 但是听歌正常啊,用的不是同一个api?

下载,听歌都是用的同一个 api,不会影响下载数量(vip 的下载数量是不会变的)。

你的脚本解析的index与我的不一样,应该不是最新版,下一个最新版试试。

好的 等等我试一下