구글은 OAuth 2.0 을 사용하여 인증작업을 하더군욤.... <div>아직도 뭐가 뭔지 제대로 모르지만</div> <div>일단 사용자 인증 작업 해서 엑세스 토큰을 String 변수로 가져왔습니당.</div> <div><br></div> <div>인증이 필요하지 않는 Http GET 요청을 보내는 방법도 알겠슴당.</div> <div>(검색이라던가, 공개된 채널의 비디오 목록이라던가)</div> <div><br></div> <div>그 담에....</div> <div>Http Get 요청을 보내서 제 유투브 계정에 있는 즐겨찾기 목록을 가져와야 하는데욤</div> <div>엑세스 토큰이랑 Http GET 요청이랑 어떻게 묶어야 할지를 모르겠어요 ㅜㅜ</div> <div>자꾸만 400/403 오류들만 나오고....킁....</div> <div><br></div> <div><br></div> <div>플레이리스트 아이디를 알고있는 경우 그 플레이리스트 안에 있는 비디오들을 가져오는건</div> <div><a target="_blank" href="https://developers.google.com/youtube/v3/docs/playlistItems/list#try-it">https://developers.google.com/youtube/v3/docs/playlistItems/list#try-it</a></div> <div>위 사이트에서 </div> <div>part 에 snippet 넣고, </div> <div>playlistId 에 PL6ztNLnFG2Su6M8rstwPjFsgtDWsvXsER 넣고 </div> <div>Execute 해보니</div> <div><br></div> <div><div style="text-align:left;"><img src="http://thimg.todayhumor.co.kr/upfile/201409/1411535081FQHnrV49pKxFstvEbAezm.png" width="800" height="630" alt="1.png" class="chimg_photo" style="border:none;"></div><br></div> <div>이렇게 나오길래 '아 GET 요청을 저렇게 보내면 되는구낭~' 하고서는</div> <div><pre style="line-height:normal;">String samplePlaylistId = <span style="color:#800000;">"PL6ztNLnFG2Su6M8rstwPjFsgtDWsvXsER"</span>;<span style="font-family:'굴림';font-size:9pt;"> </span></pre><pre style="line-height:normal;">String importUrl = <span style="color:#800000;">"<a target="_blank" href="https://www.googleapis.com/youtube/v3/playlistItems">https://www.googleapis.com/youtube/v3/playlistItems</a>"</span> + <span style="color:#800000;">"?part=snippet"</span> + <span style="color:#800000;">"&playlistId="</span> + samplePlaylistId <span style="color:#008000;">// 일단 연습용으로 플레이리스트 아이디는 지정해놨음. </span> + <span style="color:#800000;">"&key="</span> + <span style="color:#0000FF;">this</span>.getString(R.string.dev_key_for_browser); <span style="color:#008000;">// 구글 API키 (developer key)</span>HttpURLConnection urlConnection = (HttpURLConnection) <span style="color:#0000FF;">new</span> URL(importUrl).openConnection(); urlConnection.setRequestMethod(<span style="color:#800000;">"GET"</span>); <span style="color:#0000FF;">int</span> responseCode = urlConnection.getResponseCode();</pre><pre style="line-height:normal;">이렇게 해서 잘 됐거든요...</pre><pre style="line-height:normal;"><br></pre><pre style="line-height:normal;">그런데, 이제는</pre><pre style="line-height:normal;">스마트폰에 저장된 제 구글 계정에 있는 유투브 즐겨찾기 목록을 가져와야 하니까...</pre><pre><span style="line-height:normal;"><a target="_blank" href="https://developers.google.com/youtube/v3/docs/playlists/list">https://developers.google.com/youtube/v3/docs/playlists/list</a></span></pre><pre><span style="line-height:normal;">위 사이트에서</span></pre><pre><span style="line-height:normal;">part 는 snippet 넣어주고</span></pre><pre><span style="line-height:normal;">miine 에 true 넣어주고</span></pre><pre><span style="color:#222222;font-family:Arial, sans-serif;font-size:13px;line-height:20.7999992370605px;white-space:normal;background-color:#f1f1f1;">Authorize requests using OAuth 2.0 이거 ON 으로 체크해주고</span></pre><pre><span style="color:#222222;font-family:Arial, sans-serif;font-size:13px;line-height:20.7999992370605px;white-space:normal;background-color:#f1f1f1;">Execute 눌러봤더니</span></pre><pre><span style="color:#222222;font-family:Arial, sans-serif;font-size:13px;line-height:20.7999992370605px;white-space:normal;background-color:#f1f1f1;"></span></pre><div style="text-align:left;"><img src="http://thimg.todayhumor.co.kr/upfile/201409/1411535568MjMxY77Y8eSztoDxpVyuQHKKMSqsF.png" width="800" height="606" alt="2.png" class="chimg_photo" style="border:none;"></div>이렇게 나옵니당.....<pre></pre><pre><span style="color:#222222;font-family:Arial, sans-serif;font-size:13px;line-height:20.7999992370605px;white-space:normal;background-color:#f1f1f1;">그러니까.... Http GET 요청에 제가 받은 토큰(String 변수에 저장된)을 살짝 얹혀줄 방법을 모르겠어요 ㅜㅜ</span></pre><pre><span style="color:#222222;font-family:Arial, sans-serif;font-size:13px;line-height:20.7999992370605px;white-space:normal;background-color:#f1f1f1;">어케 해야 할까요 ㅜㅜ?</span></pre></div> <div><br></div> <div><div></div></div>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.