Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Downloading video from youtube using VLC with the command line ?  (Read 4892 times)

0 Members and 1 Guest are viewing this topic.

Hackoo

    Topic Starter


    Hopeful
  • Thanked: 42
  • Experience: Expert
  • OS: Windows 10
Hi  ;)
I'm making this batch script to download a video in MP4 from youtube using VLC with the command line. and it works fine for me.
VLC_Youtube_Downloader.bat
Code: [Select]
@echo off
REM Downloading a video from youtube using VLC with the command line by (c) Hackoo 2017
Title Si Lemhaf - Kharrej Legrinta Elli Fik by (c) Hackoo 2017
mode con:cols=65 lines=3 & COLOR 0E
Taskkill /IM "vlc.exe" /F >nul 2>&1
echo.
echo     Please wait a while ... The download is in progress ...
set Title=Si Lemhaf - Kharrej Legrinta Elli Fik by (c) Hackoo 2017
set "VLC_URL=http://www.videolan.org/vlc/download-windows.html"
set "URL=https://www.youtube.com/watch?v=KDI1C27zEC0"
set "File=SiLmehaf.mp4"
IF /I "%PROCESSOR_ARCHITECTURE%"=="x86" (
        Set "vlc=%ProgramFiles%\VideoLAN\VLC\vlc.exe"
    ) else (
        Set "vlc=%ProgramFiles(x86)%\VideoLAN\VLC\vlc.exe"
)

If Not Exist "%vlc%" (
Cls & COLOR 0C
echo.
Echo       "The VLC program is not installed on your system"
TimeOut /T 5 /NoBreak>nul
Start "" %VLC_URL%
Exit
)

"%vlc%" -vvv "%URL%" --qt-start-minimized --qt-notification=0 --sout=#transcode{vcodec="h264",vb="512",fps="23.97",scale="1",acodec="mpga",ab="128","channels=2",samplerate="44100"}:standard{access="file",mux=mp4,dst=%File%} vlc://quit"
REM Starting the video in fullscreen with VLC
Start "" "%vlc%" -f --meta-title="%Title%" %File%
But, my problem is why some URLs from Youtube dosen't work ?
like this one :

https://www.youtube.com/watch?v=TGtWWb9emYI

I got this error from VLC program
 
Can not recognize the format of the input media

Salmon Trout

  • Guest
Re: Downloading video from youtube using VLC with the command line ?
« Reply #1 on: April 18, 2017, 01:23:23 PM »
Lots of this in vlc log for that problem video
Code: [Select]
http error: error: HTTP/1.1 403 Forbidden

Hackoo

    Topic Starter


    Hopeful
  • Thanked: 42
  • Experience: Expert
  • OS: Windows 10
Re: Downloading video from youtube using VLC with the command line ?
« Reply #2 on: April 18, 2017, 02:03:13 PM »
Lots of this in vlc log for that problem video
Code: [Select]
http error: error: HTTP/1.1 403 Forbidden
So, did you think that error is coming with a copyright protected url from youtube ?

Salmon Trout

  • Guest
Re: Downloading video from youtube using VLC with the command line ?
« Reply #3 on: April 18, 2017, 02:09:10 PM »
Could be.

patio

  • Moderator


  • Genius
  • Maud' Dib
  • Thanked: 1769
    • Yes
  • Experience: Beginner
  • OS: Windows 7
Re: Downloading video from youtube using VLC with the command line ?
« Reply #4 on: April 18, 2017, 02:09:35 PM »
Yepper...
" Anyone who goes to a psychiatrist should have his head examined. "