Skip to content

Instantly share code, notes, and snippets.

View MateoWartelle's full-sized avatar
📹
Working on Sixty Frames Studio 🎥

Mateo Wartelle MateoWartelle

📹
Working on Sixty Frames Studio 🎥
View GitHub Profile
@MateoWartelle
MateoWartelle / time.ts
Created June 2, 2024 22:32
Time convert number in X hours and X minutes
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
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']