-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTikTokRipper.sh
More file actions
44 lines (36 loc) · 1.22 KB
/
TikTokRipper.sh
File metadata and controls
44 lines (36 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# I know this is probably the sloppiest way of doing this, but it works so ¯\_(ツ)_/¯
# Create required folders
mkdir blur
# tiktok-scraper download the videos (user id is needed)
tiktok-scraper trend -d -n 4 jasonderulo
# User IDs
# marblemannequin elfederal007 jasonderulo
# Move the downloaded files to the main directory
for f in trend/*.mp4;
do mv trend/*.mp4 ./ ;
done
# Remove the unused folder
rm -rf trend
# Take the videos that are in the ./ directory and edit them to be 16/9 with a blurred background and put the blurred version in the /blur folder
for f in *.mp4;
do
ffmpeg -i $f -lavfi '[0:v]scale=ih*16/9:-1,boxblur=luma_radius=min(h\,w)/20:luma_power=1:chroma_radius=min(cw\,ch)/20:chroma_power=1[bg];[bg][0:v]overlay=(W-w)/2:(H-h)/2,crop=h=iw*9/16' -vb 800K blur/$f ;
done
# Echo the name of each one of the .mp4 files in the /blur folder
for f in blur/*.mp4;
do echo "file $f" >> file_list.txt ;
done
# Log the file names
for f in blur/*.mp4;
do echo "file $f" >> log.txt ;
done
# Concat the blurred videos together
ffmpeg -f concat -i file_list.txt final.mp4
# Move the finshed file into a different directory
mkdir final
mv final.mp4 final/
# Clean up
rm -rf *.mp4
rm -rf blur
rm file_list.txt