Skip to content

Instantly share code, notes, and snippets.

@ThioJoe
ThioJoe / WhisperCPP-Transcribe.bat
Last active May 13, 2024 07:48
WhisperCPP Batch File Script
:: ---- Lines beginning with :: are comments ----
:: This script is meant to make it easy to transcribe a video file using WhisperCPP.
:: You can simply drag a video file into the cmd window, then it will use ffmpeg to extract the audio, then transcribe using WhisperCPP and output to a text file.
::
@echo off
set /p videopath="Enter the full path to the video file to transcribe: "
:: Remove quotes from the input path
set videopath=%videopath:"=%
@Tblue
Tblue / dump-firefox-cookies.py
Last active May 13, 2024 12:54
Firefox Cookie Dumper
#!/usr/bin/env python3
# vim: tw=120
#
########################################################################################################################
#
# Dump cookies from Firefox, as a Netscape Cookie File.
# Version: 1.0.1
#
# Required third-party Python packages:
#
@ignasbol
ignasbol / trim.md
Created September 27, 2021 21:21
Video fast trim

Quickly trim a video file without losing original settings

Option #1

ffmpeg -i <input_file> -ss <start_time> -to <end_time> -c:v copy -c:a copy <output_file>

Option #2

ffmpeg -i <input_file> -ss <start_time> -t <duration> -c:v copy -c:a copy <output_file>

# ------------------------------------------------------------------------------
# Adapted from https://github.com/activitynet/ActivityNet/
# Original licence: Copyright (c) Microsoft, under the MIT License.
# ------------------------------------------------------------------------------
import argparse
import glob
import json
import os
import shutil
import ssl
import unittest
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time
from selenium.webdriver.common.keys import Keys
class SwitchTab(unittest.TestCase):
def setUp(self):
# self.driver = webdriver.Firefox()
self.driver = webdriver.Chrome(chrome webdriver executable location)
def test_switch_tab(self):
@davidcortesortuno
davidcortesortuno / clean_youtube_dl_auto_subs.py
Created August 30, 2020 12:04
Remove duplicated lines from a .vtt file generated by youtube-dl when downaloading auto generated Youtube subtitles
# Remove duplicated lines from a .vtt file generated by youtube-dl when
# downloading auto-subs from a Youtube video using the --write-auto-sub option
# This script only prints the lines so save the edited subs as:
#
# python this_script.py original_sub.vtt > new_sub.vtt
import re
import sys
f = open(sys.argv[1])
@hanseljulio
hanseljulio / main.py
Created August 1, 2020 20:12
Python Video Editor + Youtube downloader
import moviepy.editor
from pytube import *
from datetime import *
from moviepy.editor import *
import moviepy.video.fx.all as vfx
def audioSplit(dirVideo, dirAudio):
video = moviepy.editor.VideoFileClip(dirVideo)
audio = video.audio
@majora2007
majora2007 / mux-ass.py
Created June 29, 2020 16:30
Mux ass and mkv files together. Useful for DemonHiro anime releases.
import os
import subprocess
import os
import sys
import argparse
from pathlib import Path # Move to Parse
in_dir = os.path.abspath('.')
@peterjpxie
peterjpxie / asyncio_demo.py
Created June 8, 2020 11:38
asyncio_demo.py
import asyncio
import time
async def say_after(delay, what):
print(time.time(),'Start say_after(%s, %s)' % (delay,what))
await asyncio.sleep(delay)
print(time.time(),what)
return
async def main():
@claraj
claraj / git_submodule_fix.md
Last active July 13, 2024 14:09
Fixing git submodule AKA git repo inside another git repo

Problem, and symptoms:

You experience one or more of these symptoms

  • you have code in a directory but it's not being pushed to GitHub. You just see an empty directory icon
  • you see this message when you add code to your git repository from the command prompt
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.