kopia lustrzana https://github.com/TeamNewPipe/NewPipe
+ Added interface method in SearchEngine class for fetch search suggestion list.
+ Implemented SearchEngine Interface method in YoutubeSearchEngine class.pull/73/head
rodzic
fc32377ce7
commit
68a0eefa20
|
@ -32,4 +32,6 @@ public interface SearchEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
Result search(String query, int page);
|
Result search(String query, int page);
|
||||||
|
|
||||||
|
Result suggestionList(String query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,4 +115,23 @@ public class YoutubeSearchEngine implements SearchEngine {
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result suggestionList(String query) {
|
||||||
|
|
||||||
|
// http://suggestqueries.google.com/complete/search?client=youtube&ds=yt&q=andro
|
||||||
|
|
||||||
|
Uri.Builder builder = new Uri.Builder();
|
||||||
|
builder.scheme("https")
|
||||||
|
.authority("suggestqueries.google.com")
|
||||||
|
.appendPath("complete")
|
||||||
|
.appendPath("search")
|
||||||
|
.appendQueryParameter("client", "youtube")
|
||||||
|
.appendQueryParameter("ds", "yt")
|
||||||
|
.appendQueryParameter("q", query);
|
||||||
|
String url = builder.build().toString();
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue