feeluown / FeelUOwn

trying to be a robust, user-friendly and hackable music player
http://feeluown.readthedocs.io
GNU General Public License v3.0
3.54k stars 597 forks source link

虾米插件bug #379

Closed hjlarry closed 3 years ago

hjlarry commented 4 years ago

Describe the bug 未登录搜索时报错,如果没报错,多搜索一下就报错

To Reproduce 输入fuo search 周杰伦

错误信息:

Search 周杰伦 in <fuo_xiami.provider.XiamiProvider object at 0x110e5b860> failed.
Traceback (most recent call last):
  File "/Users/hejl/JianGuo/FeelUOwn/fuocore/library.py", line 134, in search
    result = provider.search(keyword=keyword, type_=type_, **kwargs)
  File "/Users/hejl/JianGuo/FeelUOwn/.venv/lib/python3.7/site-packages/fuo_xiami/models.py", line 333, in search
    data = provider.api.search(keyword, type_=type_type_map[type_])
  File "/Users/hejl/JianGuo/FeelUOwn/.venv/lib/python3.7/site-packages/fuo_xiami/api.py", line 168, in search
    _, _, rv = self.request(action, payload)
  File "/Users/hejl/JianGuo/FeelUOwn/.venv/lib/python3.7/site-packages/fuo_xiami/api.py", line 105, in request
    rv = response.json()
  File "/Users/hejl/JianGuo/FeelUOwn/.venv/lib/python3.7/site-packages/fuo_xiami/api.py", line 105, in request
    rv = response.json()
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/bdb.py", line 88, in trace_dispatch
    return self.dispatch_line(frame)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/bdb.py", line 113, in dispatch_line
    if self.quitting: raise BdbQuit
bdb.BdbQuit

debug后的返回:

(Pdb) response.content.decode()
'\r\n<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset="utf-8">\n\n    <meta name="renderer" content="webkit">\n    <meta http-equiv="X-UA-Compatible" content="IE=edge">\n\n    <title>登录 - 虾米网(xiami.com) - 乐随心动</title>\n    <meta name="keywords" content="虾米网(xiami.com) - 乐随心动">\n    <meta name="description" content="虾米网(xiami.com) - 乐随心动">\n\n    <link rel="dns-prefetch" href="//g.alicdn.com">\n    <link rel="dns-prefetch" href="//gw.alicdn.com">\n    <link rel="dns-prefetch" href="//img.alicdn.com">\n    <link rel="dns-prefetch" href="//oxiami.alicdn.com">\n    <link rel="dns-prefetch" href="//at.alicdn.com">\n\n    <meta name="data-spm" content="a2oaf">\n    <meta name="verify-v1" content="gNntuhTm2rH7Qa/GPp6lf0mIp9KQsjejNs+i1LZhG7U=">\n\n    <link rel="icon" type="image/png" href="//img.alicdn.com/tfs/TB1qP4zgY5YBuNjSspoXXbeNFXa-550-550.png">\n    <link rel="stylesheet" href="//g.alicdn.com/xiami-frontend/web-xiami-login-node/0.0.29/desktop/layout/index.css">\n    <script src="//g.alicdn.com/alilog/mlog/aplus_v2.js" crossorigin></script>\n    <script src="//g.alicdn.com/de/music-static/login/static/lib/jQuery/1.9.1/jquery.min.js" crossorigin></script>\n    <script src="//g.alicdn.com/sd/sufei/0.3.7/app/common/sufei-jquery.js" crossorigin></script>\n    <script src="//g.alicdn.com/sd/ncpc/nc.js?t=2020062316" crossorigin></script>\n\n    <script src="//g.alicdn.com/AWSC/AWSC/awsc.js" crossorigin></script>\n    <script>\n    AWSC.use(\'uab\', function (state, uab) {\n      if (state === \'loaded\') {\n        window.uab = uab;\n      }\n    });\n    AWSC.use(\'um\', function (state, um) {\n      if (state === \'loaded\') {\n        um.init({\n          appName: \'web-xiami-login-node\',\n        }, (state, result) => {\n          if(state === \'success\') {\n            document.cookie = `_xm_umtoken=${result.tn}; secure;`;\n          }\n        });\n      }\n    });\n    </script>\n\n    <script src="https://g.alicdn.com/dt/tracker/3.4.11/??tracker.Tracker.js" crossorigin></script>\n    <script>\n    var tracker = new window.Tracker({\n      pid: \'xiami-login\',\n    });\n    tracker.install();\n    </script>\n  </head>\n  <body data-spm="11261996">\n    \n    <div id="header" data-spm="226669510">\n\t<div class="primary">\n\t\t<div class="gap">\n      <div class="wrapper">\n        <table>\n          <tbody>\n            <tr>\n            <td class="logo"><a href="//www.xiami.com/" title="虾米音乐网(xiami.com) - 高品质音乐 发现 分享">虾米音乐网(xiami.com) - 高品质音乐 发现 分享</a></td>\n            <td class="nav">\n              <a href="//www.xiami.com/">发现音乐</a>\n              <a href="//www.xiami.com/space/lib-song">我的音乐</a>\n            </td>\n            <td class="subnav">\n              <a class="first" href="//www.xiami.com/collect">歌单</a>\n              <a class="middle" href="//www.xiami.com/radio" target="_blank">电台</a>\n              <a class="middle" href="//i.xiami.com">音乐人</a>\n              <a class="last" href="//www.xiami.com/apps/mobile" target="_blank">客户端</a>\n            </td>\n            <td class="search">\n            </td>\n            <td class="reg">\n              <a href="//www.xiami.com/member/register">免费注册</a>\n            </td>\n          </tr>\n        </tbody></table>\n      </div>\n\t\t</div>\n\t</div>\n</div>\n    \n\n    <div id="body">\n    \n\n<link rel="stylesheet" href="//g.alicdn.com/xiami-frontend/web-xiami-login-node/0.0.29/desktop/login/index.css">\n<link rel="stylesheet" href="//g.alicdn.com/music/x-login/0.1.2/qrcode/index.css">\n\n<div class="wrapper">\n  <div id="main">\n    <div id="login">\n      <div class="login-xm" style="display:none;">\n        <h2 class="tit">虾米账号密码登录</h2>\n        <div class="content">\n          <div id="xiami-login">\n            <div id="error"></div>\n            \n              \n              <input type="hidden" name="redirectURL" value="http%3A%2F%2Fh5api.m.xiami.com%2Fh5%2Fmtop.alimusic.search.searchservice.searchsongs%2F1.0%2F%3Ft%3D1592899694208%26appKey%3D23649156%26sign%3D3d4e4362e76ceeb42c6041de08aca878%26data%3D%257B%2522requestStr%2522%253A%2B%2522%257B%255C%2522header%255C%2522%253A%2B%257B%255C%2522appId%255C%2522%253A%2B200%252C%2B%255C%2522platformId%255C%2522%253A%2B%255C%2522h5%255C%2522%257D%252C%2B%255C%2522model%255C%2522%253A%2B%257B%255C%2522key%255C%2522%253A%2B%255C%2522%255C%255Cu5468%255C%255Cu6770%255C%255Cu4f26%255C%2522%252C%2B%255C%2522pagingVO%255C%2522%253A%2B%257B%255C%2522page%255C%2522%253A%2B1%252C%2B%255C%2522pageSize%255C%2522%253A%2B30%257D%257D%257D%2522%257D">\n              \n              <p>\n                <!--[if lt IE 10 ]><label for="account">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请输入邮箱/手机号</label><![endif]-->\n                <input class="input" name="account" id="account" value="" placeholder="请输入邮箱/手机号" tabindex="1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">\n                <span id="popup"></span>\n              </p>\n              <p>\n                <!--[if lt IE 10 ]><label for="pw">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请输入密码</label><![endif]-->\n                <input class="input" type="password" name="password" id="password" placeholder="请输入密码" tabindex="2" autocomplete="off">\n              </p>\n              \n              \n              <script>\n              window.needValidate = 1;\n              </script>\n              \n              <div class="captcha-wrapper" style="display:block;">\n                  <div id="captcha" class="nc-container"></div>\n              </div>\n              <p>\n                <input type="submit" name="submit" id="submit" value="登 录" tabindex="4">\n              </p>\n              <p class="action">\n                <a href="//www.xiami.com/member/register" target="_blank" class="major">新用户注册</a>\n                <a href="//www.xiami.com/member/getpassword" target="_blank" class="minor">忘记密码?</a>\n              </p>\n            \n          </div>\n        </div>\n        <div class="extra">\n          <a class="taobao" href="https://oauth.taobao.com/authorize?response_type=code&client_id=23355923&redirect_uri=https%3A%2F%2Fpassport.xiami.com%2Fthird-login%3Fplatform%3Dtaobao%26action%3Dlogin&view=web&state=0bb641b615928996945072397e88e7" title="淘宝登录"><b class="icon"></b></a>\n          <!-- <a class="alipay" href="https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=2017073107973310&scope=SCOPE&redirect_uri=https%3A%2F%2Fpassport.xiami.com%2Fthird-login%3Fplatform%3Dalipay%26action%3Dlogin&state={thirdLogin.alipay.state}" title="支付宝登录"><b class="icon"></b></a> -->\n          <a class="weibo" href="https://api.weibo.com/oauth2/authorize?client_id=3845915579&response_type=code&redirect_uri=https%3A%2F%2Fpassport.xiami.com%2Fthird-login%3Fplatform%3Dweibo%26action%3Dlogin&state=0bb641b615928996945072397e88e7" title="微博登录"><b class="icon"></b></a>\n          <a class="wechat" href="https://open.weixin.qq.com/connect/qrconnect?response_type=code&appid=wx535f2b3fcbbf6720&redirect_uri=https%3A%2F%2Fpassport.xiami.com%2Fthird-login%3Fplatform%3Dwechat%26action%3Dlogin&scope=snsapi_login&state=0bb641b615928996945072397e88e7" title="微信登录"><b class="icon"></b></a>\n          <a class="qq" href="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=205297&redirect_uri=https%3A%2F%2Fpassport.xiami.com%2Fthird-login%3Fplatform%3Dqq%26action%3Dlogin&state=0bb641b615928996945072397e88e7" title="QQ登录"><b class="icon"></b></a>\n        </div>\n      </div>\n      <div class="login-qrcode">\n        <h2 class="tit">虾米APP扫一扫,登录安全又快速</h2>\n        <div class="qrcode-container">\n          <div class="qrcode-ing J_QRCodeIng">\n            <div class="qrcode-main">\n              <div class="qrcode-img J_QRCodeImg">\n                <img class="loadvl" src="https://oxiami.alicdn.com/res/img/default/loading2.gif">\n              </div>\n              <div class="qrcode-err J_QRCodeErr">\n                <h5>二维码已失效</h5>\n                <a href="javascript:;" class="refresh J_QRCodeRefresh">刷新获取</a>\n              </div>\n            </div>\n            <div class="qrcode-description">\n              <p>7.0版本以上:<a class="alink" href="//www.xiami.com/apps/mobile">虾米APP</a> - 个人中心 - 右上角<i class="iconfont">&#xe601;</i></p>\n              <small>6.0版本以上:<a class="alink" href="//www.xiami.com/apps/mobile">虾米APP</a> - 账号 - 左上角</small>\n            </div>\n            <div class="qrcode-notice">手机号注册账户,需在虾米5.7.6及以上版本使用</div>\n          </div>\n          <div class="qrcode-msg J_QRCodeMsg">\n            <div class="qrcode-msg-ok">\n              <div class="msg-icon">\n                <i class="iconfont icon-phone">&#xe603;</i>\n              </div>\n              <h6>扫描成功!</h6>\n              <p>请在手机上确认登录</p>\n              <div class="alink"><a href="#" class="alink J_QRCodeRefresh">返回二维码扫描</a></div>\n            </div>\n          </div>\n        </div>\n      </div>\n      <a href="javascript:void(0);" action-type="tbxm" id="J_LoginSwitch" class="login-switch">\n        <i class="iconfont">&#xe600;</i>\n      </a>\n    </div>\n    <div class="qrcode-tips J_QRCodeTips"><span class="tit">用户名密码登录</span><i class="iconfont arrow">&#xe604;</i></div>\n  </div>\n  <div id="sidebar">\n    <script src="//g.alicdn.com/de/music-static/login/ad.js" crossorigin></script>\n  </div>\n</div>\n\n<script src="//g.alicdn.com/xiami-frontend/web-xiami-login-node/0.0.29/desktop/login/index.js" crossorigin></script>\n<script src="//g.alicdn.com/music/x-login/0.1.2/qrcode/index.js" crossorigin></script>\n\n\n    </div>\n\n    \n    <div id="footer" data-spm="1110930425">\n    <div class="gap">\n      <div class="wrapper">\n        <div class="content">\n          <div class="sitemap">\n            <dl>\n              <dt>关于</dt>\n              <dd><a title="关于我们" href="//www.xiami.com/about">关于我们</a></dd>\n              <dd><a title="虾米招聘" href="https://job.alibaba.com/zhaopin/positionList.htm?keyWord=JXU5NjNGJXU5MUNDJXU5N0YzJXU0RTUw&amp;_input_charset=UTF-8" target="_blank">虾米招聘</a><sup class="hot"></sup></dd>\n              <dd><a title="独立音乐人合作" href="//i.xiami.com/musician/pr" target="_blank">独立音乐人合作</a></dd>\n              <dd><a title="联系我们" href="//www.xiami.com/contact">联系我们</a></dd>\n              <dd><a title="友情链接" href="//www.xiami.com/links">友情链接</a></dd>\n            </dl>\n            <dl>\n              <dt>特色服务</dt>\n              <dd><a title="虾米 VIP" href="//www.xiami.com/vip">虾米 VIP</a></dd>\n              <dd><a title="虾米播播" href="//www.xiami.com/widget">虾米播播</a></dd>\n              <dd><a title="音乐专题" href="//www.xiami.com/events">音乐专题</a></dd>\n            </dl>\n            <dl>\n              <dt>虾米客户端</dt>\n              <dd><a title="虾米 for iPhone" href="//www.xiami.com/apps/iphone">虾米 for iPhone</a><sup class="hot"></sup></dd>\n              <dd><a title="虾米 for Android" href="//www.xiami.com/apps/android">虾米 for Android</a></dd>\n              <dd><a title="虾米 for Windows" href="//www.xiami.com/apps/win">虾米 for Windows</a></dd>\n              <dd><a title="虾米 for Mac" href="//www.xiami.com/apps/mac">虾米 for Mac</a></dd>\n              <dd><a title="虾米 for iPad" href="//www.xiami.com/apps/ipad">虾米 for iPad</a></dd>\n            </dl>\n            <dl>\n              <dt>更多</dt>\n              <dd><a title="分类找歌" href="//www.xiami.com/music/category">分类找歌</a></dd>\n              <dd><a title="帮助中心" href="//www.xiami.com/alicare">帮助中心</a></dd>\n              <dd><a title="添加虾米还没有的资料" href="//www.xiami.com/wiki/addalbum">添加虾米还没有的资料</a></dd>\n              <dd><a title="提交大家想要的专辑" href="//www.xiami.com/music/want">提交大家想要的专辑</a></dd>\n              <dd><a title="音频上传" href="//www.xiami.com/space/upload-audio">音频上传</a></dd>\n              <dd><a title="添加歌词" href="//www.xiami.com/music/words">添加歌词</a></dd>\n            </dl>\n          </div>\n        </div>\n        <div class="ali_group">\n          <a href="http://page.1688.com/shtml/about/ali_group1.shtml" target="_blank">阿里巴巴集团</a>\n          <a href="http://www.alibaba.com" target="_blank">阿里巴巴国际站</a>\n          <a href="http://www.1688.com" target="_blank">阿里巴巴中国站</a>\n          <a href="http://www.aliexpress.com" target="_blank">全球速卖通</a>\n          <a href="http://www.taobao.com" target="_blank">淘宝网</a>\n          <a href="http://www.tmall.com" target="_blank">天猫</a>\n          <a href="http://ju.taobao.com" target="_blank">聚划算</a>\n          <a href="http://www.etao.com" target="_blank">一淘</a>\n          <a href="http://www.alimama.com" target="_blank">阿里妈妈</a>\n          <a href="http://www.fliggy.com" target="_blank">飞猪</a>\n          <a href="http://www.aliyun.com" target="_blank">阿里云计算</a>\n          <a href="http://www.alios.cn/" target="_blank">AliOS</a>\n          <a href="http://aliqin.tmall.com" target="_blank">阿里通信</a>\n          <a href="http://www.laiwang.com/" target="_blank">来往</a>\n          <a href="http://www.alipay.com" target="_blank">支付宝</a>\n          <a href="http://www.net.cn" target="_blank">万网</a>\n          <a href="http://www.autonavi.com/" target="_blank">高德</a>\n          <a href="http://www.uc.cn/" target="_blank">优视</a>\n          <a href="http://www.umeng.com/" target="_blank">友盟</a>\n          <a href="http://kanbox.com/" target="_blank">酷盘</a>\n          <a href="//www.xiami.com" target="_blank">虾米</a>\n          <a href="http://www.alibabaplanet.com/" target="_blank">阿里星球</a>\n          <a href="http://www.dingtalk.com/?lwfrom=20150205111444391" target="_blank">钉钉</a>\n          <a href="http://www.aligames.com/" target="_blank">阿里游戏</a>\n        </div>\n        <div class="extra">\n          <div class="sns">\n            关注虾米:\n            <a href="http://t.sina.com.cn/xiamixiamixiami" title="新浪微博"><b class="icon sina"></b></a>\n            <a href="http://page.renren.com/699099957/index" title="人人网"><b class="icon renren"></b></a>\n            <a href="http://new.qzone.qq.com/810167634" title="QQ 空间"><b class="icon qzone"></b></a>\n            <a href="http://t.qq.com/xiaxiaomi" title="腾讯微博"><b class="icon tqq"></b></a>\n            <a href="http://www.douban.com/people/xiaxiaomi" title="豆瓣"><b class="icon douban"></b></a>\n          </div>\n          <div class="copyright">© 2007 - <script>document.write(new Date().getFullYear());</script> <a href="//www.xiami.com/">阿里巴巴(杭州)文化创意有限公司</a> - <a href="//www.xiami.com/sitemap" title="网站地图">网站地图</a> <strong class="xiami_motto ti" title="give music a chance">"give music a chance"</strong><br><a href="//img.alicdn.com/tps/TB15ZpGKpXXXXabXpXXXXXXXXXX-843-597.jpg" target="_blank">浙网文[2015]0294-064号</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.miibeian.gov.cn/" target="_blank" title="浙ICP备08103200号-2">浙ICP备08103200号-2</a>&nbsp;&nbsp;&nbsp;&nbsp;阿里巴巴旗下网站</div>\n        </div>\n      </div>\n    </div>\n  </div>\n    \n\n  </body>\n</html>\n'

可能捕捉异常,提醒用户先登录再搜索能解决该问题

cosven commented 3 years ago

虾米倒闭了,这个 issue 也 close 了。