Latest News
Selasa, 15 Juni 2021

API youtube channel via google drive



contoh penggunaan API youtube

from bs4 import BeautifulSoup

import requests

import json

url="https://www.googleapis.com/youtube/v3/search?key=[key youtube anda]&channelId=UCdkYfAAO66_UjkAITIxbBzQ&part=snippet,id&order=date&maxResults=50"

html = requests.get(url)

dt=json.loads(html.text)

datayt=[]

for x in range(len(dt['items'])):

data={}

data['aksi']='1'

data['yt_url']='https://www.youtube.com/watch?v='+dt['items'][x]['id']['videoId']

data['yt_name']=dt['items'][x]['snippet']['channelTitle']

data['yt_title']=dt['items'][x]['snippet']['title']

data['yt_pub']=dt['items'][x]['snippet']['publishedAt']

data['yt_videoid']=dt['items'][x]['id']['videoId']

data['yt_thumb']=dt['items'][x]['snippet']['thumbnails']['high']['url']

hasil=requests.post('API URL GOOGLE DRIVE',data)


  • Blogger Comments
  • Facebook Comments

0 komentar:

Posting Komentar

Item Reviewed: API youtube channel via google drive Rating: 5 Reviewed By: ariesdev