|
@@ -52,7 +52,7 @@ public class Youtube {
|
52
|
52
|
return response.toString();
|
53
|
53
|
}
|
54
|
54
|
|
55
|
|
- public ArrayList<String> audio(String audio) {
|
|
55
|
+ public ArrayList<YoutubeInfo> audio(String audio) {
|
56
|
56
|
|
57
|
57
|
Gson gsonObj = new Gson();
|
58
|
58
|
Map<String, String> inputMap = new HashMap<String, String>();
|
|
@@ -60,7 +60,7 @@ public class Youtube {
|
60
|
60
|
inputMap.put("blog", "https://web-inf.tistory.com");
|
61
|
61
|
|
62
|
62
|
Youtube y = new Youtube();
|
63
|
|
- ArrayList<String> alist = new ArrayList<String>();
|
|
63
|
+ ArrayList<YoutubeInfo> alist = new ArrayList<YoutubeInfo>();
|
64
|
64
|
try {
|
65
|
65
|
String s = y.search(""+ audio +"");
|
66
|
66
|
Map map = gsonObj.fromJson(s, Map.class);
|
|
@@ -81,13 +81,20 @@ public class Youtube {
|
81
|
81
|
//System.out.println(title.get("title"));
|
82
|
82
|
String popo;
|
83
|
83
|
HashMap<String,String> disc = new HashMap<String,String>();
|
84
|
|
- //disc.put("number",String.valueOf(a+1));
|
85
|
|
- //disc.put("title",(String) title.get("title")); //값 추가
|
|
84
|
+ disc.put("number",String.valueOf(a+1));
|
|
85
|
+ disc.put("title",(String) title.get("title")); //값 추가
|
86
|
86
|
disc.put("address","https://www.youtube.com/watch?v="+((String) videoId.get("videoId")));
|
|
87
|
+
|
|
88
|
+ YoutubeInfo you = new YoutubeInfo();
|
|
89
|
+ you.setTitle((String) title.get("title"));
|
|
90
|
+ you.setNumber(String.valueOf(a+1));
|
|
91
|
+ you.setAddress("https://www.youtube.com/watch?v="+((String) videoId.get("videoId")));
|
|
92
|
+
|
|
93
|
+
|
87
|
94
|
System.out.println(disc);
|
88
|
95
|
popo = "https://www.youtube.com/watch?v="+((String) videoId.get("videoId"));
|
89
|
96
|
|
90
|
|
- alist.add(popo);
|
|
97
|
+ alist.add(you);
|
91
|
98
|
if(a > 10)
|
92
|
99
|
{
|
93
|
100
|
break;
|