YouTube에서 채널 ID를 받으려면 어떻게해야합니까?
YouTube Data API V3를 사용하여 내 채널에서 데이터를 검색하려고합니다 .
이를 위해 채널 ID가 필요합니다.
YouTube 계정에서 채널 ID를 찾으려고했지만 모든면에서 실패했습니다.
누군가 나를 위해 하나의 팁이 있다면 나는 믿을 수 없을만큼 기쁠 것입니다.
다음은 데이터를 검색하는 데 사용하는 URL입니다.
https://www.googleapis.com/youtube/v3/channels ? id = fjTOrCPnAblTngWAzpnlMA & key = {YOUR_API_KEY} & part = snippet, contentDetails, statistics
ID는 채널 ID를 위해, 그리고 키 , 나는 내 Google API 콘솔에서 생성 된 내 API 키를 사용하여 {YOUR_API_KEY}을 대체하고있다.
내 채널 ID가되지 않습니다 :
- klauskkpm
- klausmachado
- klausmachado@gmail.com
- fjTOrCPnAblTngWAzpnlMA
내 채널 : http://www.youtube.com/user/klauskkpm
채널 ID를 얻으려면 채널 페이지의 소스 코드를보고 data-channel-external-id="UCjXfkj5iapKHJrhYfAF9ZGg"
또는을 찾을 수 있습니다 "externalId":"UCjXfkj5iapKHJrhYfAF9ZGg"
.
UCjXfkj5iapKHJrhYfAF9ZGg
찾고있는 채널 ID가됩니다.
쉬운 대답은 YouTube 채널 ID가 UC + {YOUR_ACCOUNT_ID}입니다. YouTube 채널 ID 또는 YouTube 계정 ID를 확인하려면 설정 페이지 에서 고급 설정 에 액세스 하세요 .
모든 채널의 YouTube 채널 ID를 알고 싶다면 @mjlescano가 제공 한 솔루션을 사용할 수 있습니다 .
https://www.googleapis.com/youtube/v3/channels?key={YOUR_API_KEY}&forUsername={USER_NAME}&part=id
이것이 도움이 될 수 있다면 일부 사용자는 바로 여기 다른 주제에서 해결되었다고 표시했습니다 .
http://johnnythetank.github.io/youtube-channel-name-converter(YouTube 사용자 이름을 채널 ID로 변환)
이 API 호출을 기반으로하는 변환기 : https://www.googleapis.com/youtube/v3/channels?key={YOUR_API_KEY}&forUsername={USER_NAME}&part=id
다음과 같이 "forUsername"필터를 사용하여 사용자 이름 (이 경우 "klauskkpm")으로 채널 ID를 가져올 수 있습니다.
https://www.googleapis.com/youtube/v3/channels?key={YOUR_API_KEY}&forUsername=klauskkpm&part=id
자세한 정보 : https://developers.google.com/youtube/v3/docs/channels/list
예를 들어 http://www.youtube.com/user/klauskkpm
API 호출없이 '사용자'URL이있는 채널 페이지 에서 YouTube UI에서 채널의 동영상 ( '동영상'탭)을 클릭하고 동영상에서 채널 이름을 클릭합니다. 그런 다음 예를 들어 "채널"URL이있는 페이지로 이동할 수 있습니다 https://www.youtube.com/channel/UCfjTOrCPnAblTngWAzpnlMA
.
YouYube 웹 사이트에 로그인하여 '내 채널'을 선택하면 현재 유튜브 버전의 채널 ID를 매우 쉽게 얻을 수 있습니다.
YouTube 채널의 채널 ID를 찾는 가장 간단한 방법을 찾았습니다 !!
1 단계 : 해당 채널의 동영상을 재생합니다.
2 단계 : 해당 동영상 아래의 채널 이름을 클릭합니다.
3 단계 : 브라우저 주소 표시 줄을 확인합니다.
이제 https://www.youtube.com/account_advanced에서 채널 및 사용자 ID를 모두 제공합니다. https://developers.google.com/youtube/v3/guides/working_with_channel_ids를 참조 하세요 .
2017 Update: Henry's answer may be a little off the mark here. If you look for data-channel-external-id
in the source code you may find more than one ID, and only the first occurrence is actually correct. Get the channel_id
used in <link rel="alternate" type="application/rss+xml" title="RSS" href="https://www.youtube.com/feeds/videos.xml?channel_id=<VALUE_HERE">
instead.
To obtain the channel id you can do the following request which gives you the channel id and playlist id.
https://www.googleapis.com/youtube/v3/channels?part=contentDetails%2C+statistics%2Csnippet&mine=true&key={YOUR_API_KEY}
mine parameter means the current authorized user
as u said channel id is perfixed with UC+{your account id} which you get while login, you can use this one also without requesting the above url you can directly call the channel api with your google id and just prefix with UC
https://www.googleapis.com/youtube/v3/channels?part=contentDetails%2C+statistics%2Csnippet&id=UC{your account id}&key={YOUR_API_KEY}
An alternative to get youtube channel ID by channel url without API:
function get_youtube_channel_ID($url){
$html = file_get_contents($url);
preg_match("'<meta itemprop=\"channelId\" content=\"(.*?)\"'si", $html, $match);
if($match && $match[1]);
return $match[1];
}
To get Channel id
Ex: Apple channel ID
Select any of the video in that channel
Select iPhone - Share photos (video)
Now click on channel name Apple bottom of the video.
Now you will get channel id in browser url
Here this is Apple channel id : UCE_M8A5yxnLfW0KghEeajjw
참고 URL : https://stackoverflow.com/questions/14366648/how-can-i-get-a-channel-id-from-youtube
'IT박스' 카테고리의 다른 글
IB없이 오른쪽 UINavigationbar에 2 개의 버튼을 추가하는 방법은 무엇입니까? (0) | 2020.09.15 |
---|---|
람다 식과 함께 Entity Framework 4에 포함 사용 (0) | 2020.09.15 |
SQL Server에서 한 달의 일 수를 확인하는 방법은 무엇입니까? (0) | 2020.09.15 |
상태 배열로 푸시하는 올바른 방법 (0) | 2020.09.15 |
CSS 셀 여백 (0) | 2020.09.15 |