1. python-youtube 라이브러리 설치. pip install --upgrade python-youtube 2. 유튜브 api키 발급받기.구글링 권장. ㅡㅡ; 3. 재생목록 역순 List 생성. from pyyoutube import Api api = Api(api_key='내 유튜브 API키 입력') base_video_url = 'https://www.youtube.com/watch?v=' items_in_playlist = api.get_playlist_items(playlist_id='PL-c0h1s2FioBuR7rJffcZHHJTGVArmu9d', count=None) result = [] for i in range(len(items_in_playlist.items)): result.append(base_video_url + items_in_playlist.items[i].snippet.resourceId.videoId) result.reverse()
1. python-youtube 라이브러리 설치.
pip install --upgrade python-youtube
2. 유튜브 api키 발급받기.구글링 권장. ㅡㅡ;
3. 재생목록 역순 List 생성.
from pyyoutube import Api
api = Api(api_key='내 유튜브 API키 입력')
base_video_url = 'https://www.youtube.com/watch?v='
items_in_playlist = api.get_playlist_items(playlist_id='PL-c0h1s2FioBuR7rJffcZHHJTGVArmu9d', count=None)
result = []
for i in range(len(items_in_playlist.items)):
result.append(base_video_url + items_in_playlist.items[i].snippet.resourceId.videoId)
result.reverse()
Innisfree 님 (200319) https://sir.kr/qa/404699
최신댓글