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
# pip install pytube3 | |
import pytube | |
import urllib.request | |
import subprocess | |
content = pytube.YouTube("https://www.youtube.com/watch?v=YQHsXMglC9A") | |
streams = content.streams.filter(only_audio=True).order_by("abr").desc() | |
response = urllib.request.urlopen(streams[0].url) |
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
from pydub import AudioSegment | |
from pydub.utils import db_to_float | |
# note: see usage example at the bottom of the gist :) | |
class Mixer(object): | |
def __init__(self): | |
self.parts = [] | |
def overlay(self, sound, position=0): |