Switch from youtube-dl to actively maintained yt-dlp
This commit is contained in:
		
							parent
							
								
									f4cd359142
								
							
						
					
					
						commit
						9ae1fcb852
					
				
							
								
								
									
										30
									
								
								aliases
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								aliases
									
									
									
									
									
								
							| 
						 | 
					@ -332,7 +332,7 @@ make_vid_dir_and_cd_into() {
 | 
				
			||||||
    if [[ $dir_name == "" ]]; then
 | 
					    if [[ $dir_name == "" ]]; then
 | 
				
			||||||
        # @note If the filename contains symbols that are incompatible with
 | 
					        # @note If the filename contains symbols that are incompatible with
 | 
				
			||||||
        # Windows' directory names then add --restrict-filenames to the command.
 | 
					        # Windows' directory names then add --restrict-filenames to the command.
 | 
				
			||||||
        dir_name=$(youtube-dl.exe --get-filename -o "%(upload_date)s - %(title)s" $opts $url)
 | 
					        dir_name=$(yt-dlp.exe --get-filename -o "%(upload_date)s - %(title)s" $opts $url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if [[ $dir_name == "" ]]; then
 | 
					        if [[ $dir_name == "" ]]; then
 | 
				
			||||||
            return 1
 | 
					            return 1
 | 
				
			||||||
| 
						 | 
					@ -386,10 +386,10 @@ dl_youtube_vid() {
 | 
				
			||||||
        local name_format="%(upload_date)s-shortname-youtube-%(id)s"
 | 
					        local name_format="%(upload_date)s-shortname-youtube-%(id)s"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local filename=$(youtube-dl.exe --get-filename -o "$name_format.%(ext)s" $url)
 | 
					    local filename=$(yt-dlp.exe --get-filename -o "$name_format.%(ext)s" $url)
 | 
				
			||||||
    filename="${filename:0:4}-${filename:4:2}-${filename:6}"
 | 
					    filename="${filename:0:4}-${filename:4:2}-${filename:6}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    youtube-dl.exe -f $format -o "$filename" $opts $url
 | 
					    yt-dlp.exe -f $format -o "$filename" $opts $url
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if [[ $make_folder == "1" ]]; then
 | 
					    if [[ $make_folder == "1" ]]; then
 | 
				
			||||||
        cd ..
 | 
					        cd ..
 | 
				
			||||||
| 
						 | 
					@ -418,13 +418,13 @@ dl_youtube_vid_and_hflip() {
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local filename=$(youtube-dl.exe --get-filename -o "%(upload_date)s-%(title)s-youtube-%(id)s.%(ext)s" $url)
 | 
					    local filename=$(yt-dlp.exe --get-filename -o "%(upload_date)s-%(title)s-youtube-%(id)s.%(ext)s" $url)
 | 
				
			||||||
    filename="${filename:0:4}-${filename:4:2}-${filename:6}"
 | 
					    filename="${filename:0:4}-${filename:4:2}-${filename:6}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if [[ $format == "" ]]; then
 | 
					    if [[ $format == "" ]]; then
 | 
				
			||||||
        youtube-dl.exe -o "$filename" $opts $url
 | 
					        yt-dlp.exe -o "$filename" $opts $url
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        youtube-dl.exe -f $format -o "$filename" $opts $url
 | 
					        yt-dlp.exe -f $format -o "$filename" $opts $url
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Flip
 | 
					    # Flip
 | 
				
			||||||
| 
						 | 
					@ -461,9 +461,9 @@ dl_youtube_playlist() {
 | 
				
			||||||
    local name_format="v%(playlist_index)s--%(upload_date)s-%(title)s-youtube-%(id)s.%(ext)s"
 | 
					    local name_format="v%(playlist_index)s--%(upload_date)s-%(title)s-youtube-%(id)s.%(ext)s"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if [[ $format == "" ]]; then
 | 
					    if [[ $format == "" ]]; then
 | 
				
			||||||
        youtube-dl.exe -o "$name_format" $opts $url
 | 
					        yt-dlp.exe -o "$name_format" $opts $url
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        youtube-dl.exe -f $format -o "$name_format" $opts $url
 | 
					        yt-dlp.exe -f $format -o "$name_format" $opts $url
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    cd ..
 | 
					    cd ..
 | 
				
			||||||
| 
						 | 
					@ -499,7 +499,7 @@ dl_twitch_chat() {
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    actually_dl_twitch_chat $url "$(youtube-dl.exe --get-filename -o "%(upload_date)s-%(title)s-twitch-%(id)s" $opts $url)"
 | 
					    actually_dl_twitch_chat $url "$(yt-dlp.exe --get-filename -o "%(upload_date)s-%(title)s-twitch-%(id)s" $opts $url)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    cd ..
 | 
					    cd ..
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -552,13 +552,13 @@ dl_twitch_vid() {
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Download Twitch chat transcript
 | 
					    # Download Twitch chat transcript
 | 
				
			||||||
    actually_dl_twitch_chat $url "$(youtube-dl.exe --get-filename -o "$name_format" $opts $url)"
 | 
					    actually_dl_twitch_chat $url "$(yt-dlp.exe --get-filename -o "$name_format" $opts $url)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Download the video.
 | 
					    # Download the video.
 | 
				
			||||||
    local filename=$(youtube-dl.exe --get-filename -o "$name_format.%(ext)s" $opts $url)
 | 
					    local filename=$(yt-dlp.exe --get-filename -o "$name_format.%(ext)s" $opts $url)
 | 
				
			||||||
    filename="${filename:0:4}-${filename:4:2}-${filename:6}"
 | 
					    filename="${filename:0:4}-${filename:4:2}-${filename:6}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    youtube-dl.exe -f "$format" -o "$filename" $opts $url
 | 
					    yt-dlp.exe -f "$format" -o "$filename" $opts $url
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    error=$?
 | 
					    error=$?
 | 
				
			||||||
    if [[ $error -eq 0 ]]; then
 | 
					    if [[ $error -eq 0 ]]; then
 | 
				
			||||||
| 
						 | 
					@ -615,10 +615,10 @@ dl_vimeo_vid() {
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Download the video.
 | 
					    # Download the video.
 | 
				
			||||||
    local filename=$(youtube-dl.exe --get-filename -o "$name_format.%(ext)s" $opts $url)
 | 
					    local filename=$(yt-dlp.exe --get-filename -o "$name_format.%(ext)s" $opts $url)
 | 
				
			||||||
    filename="${filename:0:4}-${filename:4:2}-${filename:6}"
 | 
					    filename="${filename:0:4}-${filename:4:2}-${filename:6}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    youtube-dl.exe -f "$format" -o "$filename" $opts $url
 | 
					    yt-dlp.exe -f "$format" -o "$filename" $opts $url
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    error=$?
 | 
					    error=$?
 | 
				
			||||||
    if [[ $error -eq 0 ]]; then
 | 
					    if [[ $error -eq 0 ]]; then
 | 
				
			||||||
| 
						 | 
					@ -722,7 +722,7 @@ alias yt-playlist='dl_youtube_playlist ""'
 | 
				
			||||||
alias yt-playlist-1080='dl_youtube_playlist "137+140"'
 | 
					alias yt-playlist-1080='dl_youtube_playlist "137+140"'
 | 
				
			||||||
alias yt-playlist-720='dl_youtube_playlist "136+140"'
 | 
					alias yt-playlist-720='dl_youtube_playlist "136+140"'
 | 
				
			||||||
alias yt-playlist-tiny='dl_youtube_playlist "160+140"'
 | 
					alias yt-playlist-tiny='dl_youtube_playlist "160+140"'
 | 
				
			||||||
alias yt-audio='youtube-dl.exe -f "140"'
 | 
					alias yt-audio='yt-dlp.exe -f "140"'
 | 
				
			||||||
alias yt-and-hflip='dl_youtube_vid_and_hflip "137+140"' # 1080p
 | 
					alias yt-and-hflip='dl_youtube_vid_and_hflip "137+140"' # 1080p
 | 
				
			||||||
alias ig-download-and-hflip='dl_instagram_vid_and_hflip '
 | 
					alias ig-download-and-hflip='dl_instagram_vid_and_hflip '
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user