VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 8 of 8
  1. Hi.
    I want to move files to a different dictionary after download.
    My command line looks like this:

    youtube-dl -f "bestvideo+bestaudio" -cio "%%(autonumber)03d-file.%%(ext)s" -a links.txt --exec "move *mp4 d:\files to upload"
    But I get the error:

    The syntax of the command is incorrect.
    ERROR: Command returned error code 1
    What am I doing wrong?
    Quote Quote  
  2. Try creating a helper file "move_to_upload_folder.bat":
    move "%~1" "d:\files to upload\"
    youtube-dl -cio "%%(autonumber)03d-file.%%(ext)s" -a links.txt --exec "move_to_upload_folder.bat"
    (Maybe there is a smarter way with escaping the exec command but I don't know it.)

    Is it crucial to have to move the files after download+merge instead of directly downloading to the target folder? Otherwise you can set the download folder directly:
    Quote Quote  
  3. Member
    Join Date
    Jan 2012
    Victoria, Australia
    Search Comp PM
    Ignore. Didn't fully read sneaker's reply.
    Quote Quote  
  4. Thank you for the reply, sneaker, your solution seems to work.
    But what is this "%~1" in "move_to_upload_folder.bat"?

    If anyone knows another way of moving files after download without creating additional bat file, please reply.
    Quote Quote  
  5. creates a .bat file
    and just change this line

    SET Destination="F:\Download\Video\/%%(title)s.%%(ext)s"

    SET DnBest=--hls-prefer-native --add-metadata -f best
    SET DnBestAudVid=--hls-prefer-native --add-metadata 
    SET DnBestUnmerge=--hls-prefer-native --add-metadata -f "bestvideo,bestaudio"
    SET DnBestMP4_MPA=--hls-prefer-native --add-metadata -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" 
    SET DnBestMP4_AAC=--hls-prefer-native --add-metadata -f "bestvideo[ext=mp4]+bestaudio[ext=aac]/best[ext=mp4]/best"
    SET DnMP3=--write-all-thumbnails --hls-prefer-native --add-metadata --embed-thumbnail -f bestaudio/best -x --audio-quality 1 --audio-format mp3
    SET DnAAC=--write-all-thumbnails --hls-prefer-native --add-metadata --embed-thumbnail -f bestaudio/best -x --audio-quality 1 --audio-format aac
    SET DnM4A=--write-all-thumbnails --hls-prefer-native --add-metadata --embed-thumbnail -f bestaudio/best -x --audio-quality 1 --audio-format m4a
    SET Destination="F:\Download\Video\/%%(title)s.%%(ext)s"
    if not -%1-==-- SET URL=%*	
    if -%1-==-- goto fopNew 
    ECHO URL: %URL% 
    ECHO ----------------------
    ECHO Available operations:
    ECHO ----------------------
    ECHO . 
    ::This prints the list of the operations
    ECHO 1. Best already on site
    ECHO 2. Best Audio and Best Video
    ECHO 3. Best (no merge)
    ECHO 4. Best MP4 and M4A
    ECHO 5. Best MP4 and AAC
    ECHO 6. MP3 (Audio)
    ECHO 7. AAC (Audio)
    ECHO 8. M4A (Audio)
    ECHO -
    ECHO f. List all possible formats
    ECHO u. Auto-update
    ECHO n. Process New File
    ECHO x. Quit
    ECHO - 
    ::Ask the user to choose the operation they want
    SET /P operation=Which operation would you like to do?:
    if "%operation%"=="n" goto fopNew
    if "%operation%"=="N" goto fopNew
    if "%operation%"=="1" goto fop1
    if "%operation%"=="2" goto fop2
    if "%operation%"=="3" goto fop3
    if "%operation%"=="4" goto fop4
    if "%operation%"=="5" goto fop5
    if "%operation%"=="6" goto fop6
    if "%operation%"=="7" goto fop7
    if "%operation%"=="8" goto fop8
    if "%operation%"=="f" goto fopFormat
    if "%operation%"=="F" goto fopFormat
    if "%operation%"=="u" goto fopUpdate
    if "%operation%"=="U" goto fopUpdate
    goto fopQuit
    ECHO Best:
    youtube-dl %DnBest% -o %Destination% %URL%
    goto top
    ECHO Best Audio and Best Video:
    youtube-dl %DnBestAudVid% -o %Destination% %URL%
    goto top
    ECHO Best No Merge:
    youtube-dl %DnBestUnmerge% -o %Destination% %URL%
    goto top
    ECHO Best MP4 and MPa:
    youtube-dl %DnBestMP4_MPA% -o %Destination% %URL%
    goto top
    ECHO Best MP4 and AAC:
    youtube-dl %DnBestMP4_AAC% --no-part -o %Destination% %URL%
    goto top
    ECHO MP3:
    youtube-dl %DnMP3% -o %Destination% %URL%
    goto top
    youtube-dl %DnAAC% -o %Destination% %URL%
    goto top
    ECHO M4A:
    youtube-dl %DnM4A% -o %Destination% %URL%
    goto top
    ECHO List of all possible formats:
    youtube-dl -F %URL%
    goto top
    ECHO Updates:
    youtube-dl -U
    goto top
    SET /P URL=Please enter the video URL:
    goto top
    Quote Quote  
  6. Member
    Join Date
    Mar 2011
    Nova Scotia, Canada
    Search Comp PM
    Why not just use the GUI version?
    Quote Quote  
  7. OK. Thx.
    One more question. Should I download videos with the parameter --hls-prefer-native or not?
    Beacuse I never use it and vids are downloaded without problems but I noticed that almost all youtube-dl .bat scripts around the internet have this parameter.
    Quote Quote  
  8. paste the link you need to download and press 5
    instead to update youtube-dl preemi U uppercase

    if it doesn't fit use a GUI version
    Quote Quote  

Similar Threads