Skip to main content

Posts

Showing posts with the label csv

python program to download video and add all in a csv file

import requests  # or urllib import csv import sys  reload(sys)  sys.setdefaultencoding('utf-8') # get Youtube Data API Key API_KEY = ""  # insert your API key # youtube channel ID channel_id = ""  # insert Youtube channel ID page_token = "" print('how are u') videos = [] next = True while next:     url = ("https://www.googleapis.com/youtube/v3/search?key="             "{}&channelId={}&part=snippet,id"             "&order=date&maxResults=50&pageToken={}"             ).format(                 API_KEY,                 channel_id,                 page_token             )     resp = requests.get(url)     data = resp.json()     for i in data['it...