fixed search error
This commit is contained in:
parent
9a480cbe3e
commit
f63b35e2c0
|
@ -16,6 +16,7 @@ import org.w3c.dom.NodeList;
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -69,7 +70,7 @@ public class YoutubeSearchEngine extends SearchEngine {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
String url = "https://www.youtube.com/results"
|
String url = "https://www.youtube.com/results"
|
||||||
+ "?search_query=" + query
|
+ "?search_query=" + URLEncoder.encode(query, "UTF-8")
|
||||||
+ "&page=" + Integer.toString(page)
|
+ "&page=" + Integer.toString(page)
|
||||||
+ "&filters=" + "video";
|
+ "&filters=" + "video";
|
||||||
|
|
||||||
|
@ -148,8 +149,8 @@ public class YoutubeSearchEngine extends SearchEngine {
|
||||||
+ "?client=" + ""
|
+ "?client=" + ""
|
||||||
+ "&output=" + "toolbar"
|
+ "&output=" + "toolbar"
|
||||||
+ "&ds=" + "yt"
|
+ "&ds=" + "yt"
|
||||||
+ "&hl=" + contentCountry
|
+ "&hl=" + URLEncoder.encode(contentCountry, "UTF-8")
|
||||||
+ "&q=" + query;
|
+ "&q=" + URLEncoder.encode(query, "UTF-8");
|
||||||
|
|
||||||
|
|
||||||
String response = dl.download(url);
|
String response = dl.download(url);
|
||||||
|
|
Loading…
Reference in New Issue