aa112901 / remusic

仿网易云音乐 安卓版,netease android,音乐播放器 在线 下载
6.29k stars 1.93k forks source link

加载不了网络数据 #73

Open 1247934711 opened 7 years ago

1247934711 commented 7 years ago

是不是网络接口变了

XQFHNB commented 7 years ago

同加载不出来网络数据,怀着激动心情运行了起来,,发现效果跑不出来哈哈,裤子都脱了,,就看这!

wyz1535 commented 7 years ago

同样没数据,接口不对外提供了??

Sufengxixi commented 7 years ago

同……没数据,小白一脸懵逼

qyliuyawei commented 7 years ago

同问....同情上面脱裤子那位...

VVictorWang commented 6 years ago

同上面几位码友。估计可能是网易api那边的密钥变了…

KunCho commented 6 years ago

单独在浏览器里面请求接口是通的,但是在应用里面请求接口返回403.

KunCho commented 6 years ago

加上这段代码就可以了。.addHeader("user-agent","Mozilla/5.0 (Windows;U;Windows NT 5.1;en-US;rv:0.9.4)")

Zhangxd77 commented 6 years ago

添加这句话后,歌单能看到了,但是播放不了,有新的解决办法吗

yancheng1022 commented 6 years ago

弱弱的问一句 。。接口是在哪里配着?

gs666 commented 5 years ago

弱弱的问一句 。。接口是在哪里配着?

也许是这里

try {
            mOkHttpClient.setConnectTimeout(3000, TimeUnit.MINUTES);
            mOkHttpClient.setReadTimeout(3000, TimeUnit.MINUTES);
            Request request = new Request.Builder()
                    .url(action1)
                    .addHeader("user-agent","Mozilla/5.0 (Windows;U;Windows NT 5.1;en-US;rv:0.9.4)")
//                    .addHeader("Referer","http://music.163.com/")
//                    .addHeader("Cookie", "appver=1.5.0.75771")
                    .build();
            Response response = mOkHttpClient.newCall(request).execute();
            if (response.isSuccessful()) {
                String c = response.body().string();
//                FileOutputStream fileOutputStream = new FileOutputStream("/sdcard/" + System.currentTimeMillis() + ".txt");
//                fileOutputStream.write(c.getBytes());
//                fileOutputStream.close();
                JsonParser parser = new JsonParser();
                JsonElement el = parser.parse(c);
                return el.getAsJsonObject();

            }

        } catch (Exception e) {
            e.printStackTrace();
        }
sonichy commented 5 years ago

没数据

ShaunSheep commented 5 years ago

添加这句话后,歌单能看到了,但是播放不了,有新的解决办法吗

你好,请问你解决了吗