Skip to content

Instantly share code, notes, and snippets.

Avatar

Peadar Coyle springcoil

View GitHub Profile
@springcoil
springcoil / audio_download_create_youtube_5.py
Last active May 28, 2021 08:37
audio download create youtube
View audio_download_create_youtube_5.py
def download_create():
text = "<break time='5s'/>This could be your video voice over <break time='1s'/> Write your text here! Add breaks and personalisation parameters. Choose from our list of 180+ speakers. There are voices in Spanish, Enlgish, German and more! Create beautiful video voice overs."
downloadYouTube("https://www.youtube.com/watch?v=exXgMvbiCcU", "downloadedVideo")
tracks = ["speech", "audio"]
for track in tracks:
aflr_create(track, text)
combine_audio("downloadedVideo.mp4", "speech.mp3", "audio.mp3")
download_create()
@springcoil
springcoil / audio_download_create_youtube_3.py
Last active May 28, 2021 08:37
audio_download_create_youtube_3.py
View audio_download_create_youtube_3.py
def combine_audio(video, speech, audio):
os.system(f'ffmpeg -i {video} -i {speech} -filter_complex "[0:a]volume=0.4[a0]; [1:a]volume=0.9[a1]; [a0][a1]amix=duration=longest[a]" -map 0:v -map "[a]" -c:v copy overlayAudio.mp4')
os.system(f'ffmpeg -i {video} -i {audio} -filter_complex "[0:a]volume=0.0[a0]; [1:a]volume=1.0[a1]; [a0][a1]amix=duration=longest[a]" -map 0:v -map "[a]" -c:v copy substituteAudio.mp4')
@springcoil
springcoil / audio_download_youtube_create_2.py
Last active May 28, 2021 08:36
download and create audio
View audio_download_youtube_create_2.py
def downloadYouTube(videourl, filename):
yt = YouTube(videourl)
yt.streams.get_highest_resolution().download(filename = "./" + filename)
@springcoil
springcoil / audio_download_create.py
Created May 28, 2021 08:14
Audio download create
View audio_download_create.py
# pip install -U pytube aflr
from pytube import YouTube
import aflr
import os
def aflr_create(scriptName, message):
aflr.api_key = "APIKEY"
script = aflr.Script().create(scriptText= message, scriptName=scriptName, moduleName="video", projectName="new_video")
print(script)
response = aflr.Speech().create(scriptId=script.get("scriptId"), voice="Joanna", speed = "100", silence_padding = str(1000 * 2))
print(response)
@springcoil
springcoil / audio_youtube.py
Last active May 28, 2021 08:35
audio_youtube
View audio_youtube.py
# pip install -U pytube aflr
from pytube import YouTube
import aflr
import os
def aflr_create(scriptName, message):
aflr.api_key = "APIKEY"
script = aflr.Script().create(scriptText= message, scriptName=scriptName, moduleName="video", projectName="new_video")
print(script)
response = aflr.Speech().create(scriptId=script.get("scriptId"), voice="Joanna", speed = "100", silence_padding = str(1000 * 2))
print(response)
@springcoil
springcoil / commands_to_setup_serverless_framework_on_ec2.sh
Last active May 26, 2020 11:44
Getting serverless framework working on Ubuntu 18.04 ec2 (with docker and a few other packages)
View commands_to_setup_serverless_framework_on_ec2.sh
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt update
sudo apt install -y default-jdk
sudo apt-get install -y xdg-utils #needed for serverless login
npm install
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt install -y docker-ce
sudo groupadd docker
@springcoil
springcoil / rds_remark.md
Created August 6, 2019 16:31
Remark on RDS
View rds_remark.md

RDS

  • Remember that by default the db name is postgres not the DB Identifier. -- 3 hours
View gist:dee8b3242ee1128ad504c9743c3d7589
// @flow
import React from "react";
import {
Dimensions,
Image,
ImageBackground,
SafeAreaView,
Slider,
StyleSheet,
Text,
@springcoil
springcoil / pydata_requirements.txt
Created March 3, 2019 20:01
For padraic requirements.txt
View pydata_requirements.txt
absl-py==0.5.0
alabaster==0.7.12
altair==2.3.0
aniso8601==3.0.2
apispec==0.19.0
appdirs==1.4.3
appnope==0.1.0
argcomplete==1.9.3
arviz==0.3.1
asn1crypto==0.24.0
@springcoil
springcoil / s3_script_for_deleting_objects.py
Created January 12, 2019 13:36
This is a super hacky script for deleting objects one by one on a restricted s3 bucket
View s3_script_for_deleting_objects.py
import boto3
boto3.setup_default_session(profile_name='dev')
client = boto3.client('s3')
def delete_object(key_name):
return client.delete_object(Bucket='s3_bucket', Key=key_name )
delete_object('bad_image.jpg')