Skip to content

Instantly share code, notes, and snippets.

@crbyxwpzfl
Last active February 21, 2022 11:31
Show Gist options
  • Save crbyxwpzfl/2df3940c87a7e6c06958870e21031990 to your computer and use it in GitHub Desktop.
Save crbyxwpzfl/2df3940c87a7e6c06958870e21031990 to your computer and use it in GitHub Desktop.
youtube dl

dl see

cd /Volumes/transfer/see
out="/Volumes/transfer/see/%(title)s.%(ext)s"
url="https://youtube.com/playlist?list=PLaHzPX64jQ189iqTEvaWmvK0l1-Dt3ssP" #dl see

/Library/Frameworks/Python.framework/Versions/3.9/bin/youtube-dl --restrict-filenames -o $out $url --no-continue --no-check-certificate --download-archive archive.txt
@echo off

:listen https://youtube.com/playlist?list=PLaHzPX64jQ19wU2ckGEefoUlYCNvnjkv7
:see https://youtube.com/playlist?list=PLaHzPX64jQ189iqTEvaWmvK0l1-Dt3ssP

:cd into location of archive.txt since absolut path does not work since python escapes \ as \\ and path c:\\Users does not exsist

cd c:\Users\roess\Desktop\files\shows\see

set out="c:\Users\roess\Desktop\files\shows\see\%%(title)s.%%(ext)s"
set url="https://youtube.com/playlist?list=PLaHzPX64jQ189iqTEvaWmvK0l1-Dt3ssP"

youtube-dl --restrict-filenames -o %out% %url% --download-archive archive.txt"

:timeout /t 120 /nobreak 

dl listen

cd /Volumes/transfer/listen
out="/Volumes/transfer/listen/%(title)s.%(ext)s"
url="https://youtube.com/playlist?list=PLaHzPX64jQ19wU2ckGEefoUlYCNvnjkv7" #dl listen

/Library/Frameworks/Python.framework/Versions/3.9/bin/youtube-dl -x --audio-format mp3 --restrict-filenames -o $out $url --no-continue --no-check-certificate --download-archive archive.txt
@echo off

:listen https://youtube.com/playlist?list=PLaHzPX64jQ19wU2ckGEefoUlYCNvnjkv7
:see https://youtube.com/playlist?list=PLaHzPX64jQ189iqTEvaWmvK0l1-Dt3ssP

:cd into location of archive.txt since absolut path does not work since python escapes \ as \\ and path c:\\Users does not exsist

cd c:\Users\roess\Desktop\files\listen

set out="c:\Users\roess\Desktop\files\listen\%%(title)s.%%(ext)s"
set url="https://youtube.com/playlist?list=PLaHzPX64jQ19wU2ckGEefoUlYCNvnjkv7"

youtube-dl -x --audio-format mp3 --restrict-filenames -o %out% %url% --download-archive archive.txt"

:timeout /t 120 /nobreak 

for global use

add \path\to\python to PATH enviornment variable

YOUTUBE-DL
	youtube-dl.exe <option> <url>
	requires the Python interpreter, version 2.6, 2.7, or 3.2+
	put downloads where it was started!
	pip install --upgrade youtube-dl for updating

OPTIONS
	--get-url -g (outputs just stream url)
	--list-formats -F (outputs avalible formats with <code>)
	--format -f <code> (e.g. for merge -f <video code>+<audio code>)
	--simulate -s (just simulate dont write anything)
	--merge-output-format <format> (<Format> One of mkv, mp4, ogg, webm, flv)
	-o "Path\for\output" (achtung read write permissions)
	-extract-audio -x 
	--audio-format mp3 (needs -x see above)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment