Skip to content

Instantly share code, notes, and snippets.

@Eforen
Last active January 8, 2024 16:49
Show Gist options
  • Save Eforen/5fbcc2296972642bb2834e9594f32363 to your computer and use it in GitHub Desktop.
Save Eforen/5fbcc2296972642bb2834e9594f32363 to your computer and use it in GitHub Desktop.
Ravinclaw Zoom BG
#!/bin/bash
# Replace this with the actual URL
URL="https://rr5---sn-vgqsrnzr.googlevideo.com/videoplayback?expire=1704749613&ei=zRWcZby8CfyS_9EPr9eimAM&ip=3.86.70.48&id=o-AI4fg2Rke9S_jWcsf1ZjU9SOI7AufauM0MLhh2ePht0y&itag=22&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&spc=UWF9f94hNvy0BvINnzPeQGaa9NCd8LY&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=238.097&lmt=1671500205064650&fexp=24007246&c=ANDROID&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRgIhAKxJ22jSUYAbaX1fNBVgE3pVT3DCXYwdhyT2BVR2bEebAiEA1zgsyfAr89SjrNNhPE4yPNJgiKazIBMb03VZZn0zK4g%3D&title=Hogwarts%20Legacy%20-%20Ravenclaw%20Fireplace%20%5B4K%5D&redirect_counter=1&cm2rm=sn-p5qeek7z&req_id=246f4421adb2a3ee&cms_redirect=yes&cmsv=e&mh=2v&mip=24.14.92.205&mm=34&mn=sn-vgqsrnzr&ms=ltu&mt=1704727717&mv=m&mvi=5&pl=21&lsparams=mh,mip,mm,mn,ms,mv,mvi,pl&lsig=AAO5W4owRQIhALv7By9-ZiAXyQUfu2rL_UyRulW0y0tN67vTsSfb-NrRAiBduqitsB0S2RrsAaNdhJJyXAfZjum1NHNClzoxdqAQ_g%3D%3D"
FILENAME="ZoomBG.mp4"
# Download the file
wget -O $FILENAME $URL
# Get the total duration of the video in seconds
DURATION=$(ffmpeg -i $FILENAME 2>&1 | grep Duration | awk '{print $2}' | tr -d , | awk -F ':' '{print ($1 * 3600) + ($2 * 60) + $3}')
# Calculate the end time (duration - 2 seconds)
END_TIME=$(echo "$DURATION - 2" | bc)
# Trim the video (Skip first 8 seconds and trim last 2 seconds)
ffmpeg -i $FILENAME -ss 8 -to $END_TIME -an -vcodec libx264 -crf 23 "trimmed_$FILENAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment