This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function timeConvert(n: any) { | |
// Store the input number of minutes in a variable num | |
var num = n; | |
// Calculate the total hours by dividing the number of minutes by 60 | |
var hours = num / 60; | |
// Round down the total hours to get the number of full hours | |
var rhours = Math.floor(hours); | |
// Calculate the remaining minutes after subtracting the full hours from the total hours | |
var minutes = (hours - rhours) * 60; | |
// Round the remaining minutes to the nearest whole number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api_key = "YOUR API KEY" | |
from apiclient.discovery import build | |
import csv | |
youtube = build('youtube', 'v3', developerKey=api_key) | |
def get_channel_videos(channel_id): | |
res = youtube.channels().list(id=channel_id, | |
part='contentDetails').execute() | |
playlist_id = res['items'][0]['contentDetails']['relatedPlaylists']['uploads'] | |