Guest User

Downloading from YouTube

a guest
Jun 30th, 2017
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. Downloading from YouTube
  2.  
  3. Installation
  4.  
  5. 1. Download youtube-dl from https://rg3.github.io/youtube-dl/download.html
  6. 2. Download ffmpeg from https://ffmpeg.zeranoe.com/builds/
  7. * ffmpeg.exe is located in the bin folder of the archive
  8. 3. Place youtube-dl.exe & ffmpeg.exe in your C:\Users\[Username]\ directory (windows key + R, "C:\Users\[your username here]", enter)
  9.  
  10. Use
  11.  
  12. 1. Run Command Prompt (windows key + R "cmd", enter)
  13. 2. Type "youtube-dl -f bestvideo+bestaudio [URL]"
  14. * this will download video and audio files seperately and then merge them into an mkv container with ffmpeg
  15.  
  16. [Optional]
  17.  
  18. Configuration file
  19. * https://github.com/rg3/youtube-dl/blob/master/README.md#configuration
  20.  
  21. 1. Navigate to your roaming folder (windows key + R, "C:\Users\[your username here]\AppData\Roaming", enter)
  22. 2. Create a new folder called youtube-dl
  23. 3. Inside of that folder create a txt file called config.txt
  24. 4. Input one option per line and save
  25.  
  26. Recommended options
  27.  
  28. -o 'C:/path/to/downloads/%(uploader)s - %(title)s.%(ext)s'
  29. * https://github.com/rg3/youtube-dl/blob/master/README.md#output-template
  30. --add-metadata
  31. --ignore-errors
  32. --download-archive C:\Users\[your username]\AppData\Roaming\youtube-dl\downloaded.txt
  33. * this will keep a list of urls you downloaded and skip them
  34. -f bestvideo+bestaudio
  35.  
  36. Examples
  37.  
  38. 30FPS MAX IN MP4 CONTAINER
  39. -f bestvideo[ext=mp4]+bestaudio[ext=m4a]
  40.  
  41. 60FPS IN WEBM CONTAINTER
  42. -f 315+bestaudio --merge-output-format webm
  43.  
  44. [Advanced]
  45.  
  46. Create an alias for youtube-dl
  47.  
  48. 1. Navigate to C:\Users\[your username]\
  49. 2. Create a text file and name it aliases.cmd
  50. 3. Add the following lines and save
  51. @echo off
  52. DOSKEY ydl=youtube-dl $*
  53. 4. Run Command Prompt (windows key + R "cmd", enter)
  54. 5. Input the following string
  55. reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun ^ /t REG_EXPAND_SZ /d "%"USERPROFILE"%\aliases.cmd" /f
  56. * this will make your aliases load when you launch cmd
  57. * to delete it: reg delete "HKCU\Software\Microsoft\Command Processor" /v AutoRun
  58.  
  59. Now you can simply type "ydl [URL]" to download videos with whatever options you have set in your config.
  60. * Sometimes you may not want whatever options are set in your config so it is useful to set more than one alias as seen below
  61.  
  62. Examples
  63.  
  64. Download audio as mp3
  65. DOSKEY ydla=youtube-dl -f bestaudio -x --audio-format mp3 --embed-thumbnail $* -o "C:\path\to\folder\%%(uploader)s - %%(title)s.%%(ext)s"
  66.  
  67. Download only video
  68. DOSKEY ydlv=youtube-dl -f bestvideo $* -o "C:\path\to\folder\%%(uploader)s - %%(title)s.%%(ext)s"
  69.  
  70.  
  71. Convert to mp4 (for programs that don't support mkv/webm formats)
  72.  
  73. MKV to MP4 without reencoding (assuming the mkv contains mp4 compatible codecs)
  74.  
  75. ffmpeg -i "C:/path/to/input.mkv" -codec copy "C:/path/to/output.mp4"
  76. * just drag+drop the file onto command prompt to print the file path
  77.  
  78. Any format to mp4
  79.  
  80. ffmpeg -i "C:/path/to/input.ts" -vcodec libx264 -acodec aac -preset slow "C:/path/to/output.mp4"
  81.  
  82. Notes
  83.  
  84. Youtube-dl wiki
  85. https://github.com/rg3/youtube-dl/blob/master/README.md#readme
  86. * list of supported sites located here
  87.  
  88. Helpful ffmpeg+youtube-dl commands
  89. https://pastebin.com/z8npUD1X
  90.  
  91. ffmpeg VP8 encoding
  92. https://trac.ffmpeg.org/wiki/Encode/VP8
Add Comment
Please, Sign In to add comment