-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdlp_yt
executable file
·59 lines (52 loc) · 3.47 KB
/
dlp_yt
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#! /bin/bash
## ETJAKEOC YouTube Downloader Script
export PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:$PATH # Make sure that 'PATH' is proper.
## We set all the variables for 'yt-dlp' in '/etc/yt-dlp', please copy this file.
## We then create our new variable for the script to append a couple more options.
yt="/MEDIA/YOUTUBE" # Where the YouTube main directory is.
yts="/MEDIA/YT-DLS" # Where the YouTube script directory is.
yturl="https://www.youtube.com" # A variable designed to make the script below a little neater.
cleanup='rm -rf ./{*.temp.*,*.json,*.meta,*.webp,*.webm,*.part}' # Delete some junk files that we no longer need.
play="--no-playlist --playlist-end 1" # Sets playlist limits.
ids="$yt/IDs.db" # Where YT video IDs live.
dlp_yt="nice -n 5 yt-dlp $play $spon --download-archive $ids" # 'dlp_yt' variable that imports all of our settings for ease of use below.
## Echo out the flags to the log, to ensure they are being sourced.
## We nuke the old log, and rewrite it from scratch from this point.
echo "YouTube download script started at:" $(date) > $yt/LOG.txt
echo -e "Echoing SOURCE.rc variables into LOG.txt:" >> $yt/LOG.txt
echo -e "yt: $yt" >> $yt/LOG.txt
echo -e "yts: $yts" >> $yt/LOG.txt
echo -e "play: $play" >> $yt/LOG.txt
echo -e "ID's file: $ids" >> $yt/LOG.txt
echo -e "dlp_yt command: $dlp_yt" >> $yt/LOG.txt
echo -e "SOURCE.rc settings imported." >> $yt/LOG.txt
## Change into the YouTube directory, then the channel directory, and begins downloading with our defined flags.
cd $yt/Asianometry/ && $dlp_yt $yturl/@Asianometry/videos && $cleanup &
cd $yt/AW/ && $dlp_yt $yturl/@agingwheels/videos && $cleanup &
cd $yt/Big\ Clive/ && $dlp_yt $yturl/c/Bigclive/videos && $cleanup &
cd $yt/CI/ && $dlp_yt $yturl/c/CertifiablyIngame/videos && $cleanup
cd $yt/EE/ && $dlp_yt $yturl/@EngineeringExplained/videos && $cleanup &
cd $yt/G54/ && $dlp_yt $yturl/@Garage54ENG/videos && $cleanup &
cd $yt/GS/ && $dlp_yt $yturl/@greatscottlab/videos && $cleanup &
cd $yt/MB/ && $dlp_yt $yturl/@MrBallen/videos && $cleanup
cd $yt/MegaBuilds/ && $dlp_yt $yturl/@MegaBuildsYT/videos && $cleanup &
cd $yt/Nexpo/ && $dlp_yt $yturl/@Nexpo/videos && $cleanup &
cd $yt/PBSST/ && $dlp_yt $yturl/@pbsspacetime/videos && $cleanup &
cd $yt/PE/ && $dlp_yt $yturl/c/@PracticalEngineeringChannel/videos && $cleanup
cd $yt/PF/ && $dlp_yt $yturl/c/@ProjectFarm/videos && $cleanup &
cd $yt/Qxir/ && $dlp_yt $yturl/c/QxirYT/videos && $cleanup &
cd $yt/RB/ && $dlp_yt $yturl/@RetroBytesUK/videos && $cleanup &
cd $yt/RCE/ && $dlp_yt $yturl/@RealCivilEngineerGaming/videos && $cleanup
cd $yt/SH/ && $dlp_yt $yturl/c/@SabineHossenfelder/videos && $cleanup &
cd $yt/SW/ && $dlp_yt $yturl/c/@silentwisperer/videos && $cleanup &
cd $yt/SZS/ && $dlp_yt $yturl/c/@SubjectZeroScience/videos && $cleanup
cd $yt/TC/ && $dlp_yt $yturl/c/@TechnologyConnections/videos && $cleanup &
cd $yt/TE/ && $dlp_yt $yturl/@TechnologyConnextras/videos && $cleanup
## Longer videos broken out to the end
cd $yt/Tech\ Ingredients/ && $dlp_yt $yturl/c/TechIngredients/videos && $cleanup
cd $yt/TWF/ && $dlp_yt $yturl/@TheWhyFiles/videos && $cleanup
cd $yt/EF/ && $dlp_yt $yturl/@ExplosionsAndFire/videos && $cleanup
cd $yt/EI/ && $dlp_yt $yturl/@ExtractionsAndIre/videos && $cleanup
cd $yt/CRD/ && $dlp_yt $yturl/c/@CathodeRayDude/videos && $cleanup
## Change back into the main YouTube directory, and echos a timestamp into a log file, telling us how long the script ran for.
echo "YouTube download script completed at:" $(date) >> $yt/LOG.txt