PW Akshay

Generation

generate functionMon, 05 Dec 2022

Program to stream m3u8 url to youtube in python

from subprocess import call from datetime import datetime from datetime import timedelta import subprocess import os import time from google.cloud import storage def stream_to_youtube(data, context): stream_name = data['stream_name'] hls_url = data['hls_url'] start_time = data['start_time'] end_time = data['end_time'] def upload_blob(bucket_name, source_file_name, destination_blob_name): storage_client = storage.Client() bucket = storage_client.get_bucket(bucket_name) blob = bucket.blob(destination_blob_name) blob.upload_from_filename(source_file_name) print('File {} uploaded to {}.'.format( source_file_name, destination_blob_name)) def upload_to_bucket(stream_name, hls_url, start_time, end_time): cmd = '

Questions about programming?Chat with your personal AI assistant