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)
Selasa, 15 Juni 2021
- Blogger Comments
- Facebook Comments
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar