1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[tut] mass download upload from txt file in command line

Discussion in 'YouTube' started by Mutikasa, Jan 29, 2012.

  1. Mutikasa

    Mutikasa Power Member

    Joined:
    May 23, 2011
    Messages:
    575
    Likes Received:
    212
    This is for bash linux but I think there's some program for windows with which u can run bash scripts.
    First u need to get two programs. For downloading there's http://rg3.github.com/youtube-dl/ and for uploading there's http://code.google.com/p/youtube-upload/, both written in python. I don't know about the first one but uploader uses youtube API.
    I have hundred accounts and upload videos always from the same IP and never got terminated all at once. Only one account at the time.

    Now, this is the script that downloads video from youtube and saves it with "title" as filename, then uploads it with the same title with words from title as tags.

    Code:
    
    #!/bin/bash
    
    ## this part is to download from list of urls in file 
    while read line
    do
    youtube-dl -o %\(title\)s.%\(ext\)s "$line"
    done < list.txt
    
    ## when every video is down we have to loop through them, usual exts 
    ## are mp4 and flv
    for file in *.{mp4,flv}
    do
    title="${file%.*}"
    
    ## this eliminate words with less than two chars from title because 
    ##youtube doesn't accept too small tags
    keywords=($(echo ${title}))
    i=0;
    for tag in "${keywords[@]}";
    do
    len=${#tag};
    if (( "$len" < 2 ))
    then
    keywords[$i]="";
    fi;
    let i=i+1;
    done
    keywords=$(echo ${keywords[@]} | sed 's/ /,/g');
    
    # now we upload videos
    youtube-upload --email=email@yahoo.com --password=blabla \
    --title="$title" \
    --description="look at my video and visit my cool website" \
    --keywords="${keywords}, hot, babe, kissing" \
    --category=Film \
    "$file";
    done
    
    You can tweak this to suits your needs of course
     
    • Thanks Thanks x 2