diff options
-rw-r--r-- | src/github/daneren2005/dsub/service/RESTMusicService.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/github/daneren2005/dsub/service/RESTMusicService.java b/src/github/daneren2005/dsub/service/RESTMusicService.java index 879339cc..354cd145 100644 --- a/src/github/daneren2005/dsub/service/RESTMusicService.java +++ b/src/github/daneren2005/dsub/service/RESTMusicService.java @@ -715,7 +715,7 @@ public class RESTMusicService implements MusicService { builder.append("&maxBitRate=").append(maxBitrate); String url = rewriteUrlWithRedirect(context, builder.toString()); - Log.i(TAG, "Using music URL: " + url); + Log.i(TAG, "Using music URL: " + stripUrlInfo(url)); return url; } @@ -727,7 +727,7 @@ public class RESTMusicService implements MusicService { builder.append("&autoplay=true"); String url = rewriteUrlWithRedirect(context, builder.toString()); - Log.i(TAG, "Using video URL: " + url); + Log.i(TAG, "Using video URL: " + stripUrlInfo(url)); return url; } @@ -742,7 +742,7 @@ public class RESTMusicService implements MusicService { builder.append("&format=").append(format); String url = rewriteUrlWithRedirect(context, builder.toString()); - Log.i(TAG, "Using video URL: " + url); + Log.i(TAG, "Using video URL: " + stripUrlInfo(url)); return url; } @@ -757,7 +757,7 @@ public class RESTMusicService implements MusicService { } String url = rewriteUrlWithRedirect(context, builder.toString()); - Log.i(TAG, "Using hls URL: " + url); + Log.i(TAG, "Using hls URL: " + stripUrlInfo(url)); return url; } @@ -1341,8 +1341,8 @@ public class RESTMusicService implements MusicService { List<String> parameterNames, List<Object> parameterValues, List<Header> headers, ProgressListener progressListener, CancellableTask task) throws IOException { // Strip out sensitive information from log - Log.i(TAG, "Using URL " + url.substring(0, url.indexOf("?u=") + 1) + url.substring(url.indexOf("&v=") + 1)); - + Log.i(TAG, stripUrlInfo(url)); + SharedPreferences prefs = Util.getPreferences(context); int networkTimeout = Integer.parseInt(prefs.getString(Constants.PREFERENCES_KEY_NETWORK_TIMEOUT, "15000")); HttpParams newParams = httpClient.getParams(); @@ -1476,6 +1476,10 @@ public class RESTMusicService implements MusicService { return url.replace(redirectFrom, redirectTo); } + private String stripUrlInfo(String url) { + return url.substring(0, url.indexOf("?u=") + 1) + url.substring(url.indexOf("&v=") + 1); + } + private int getCurrentNetworkType(Context context) { ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = manager.getActiveNetworkInfo(); |