Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- username="YourUserNameGoesHere"
- password="YourPassWordGoesHere"
- youtube="https://www.youtube.com/results?search_query=hollywood+pedophile"
- # create new api key
- echo "Creating API Key"
- curl -X POST -H "Authorization: Basic Zm9vOmJhcg==" -d "username=${username}&password=${password}" https://api.vid.me/auth/create > key.txt
- # searching for the api key and store in variable
- accesstoken=$(grep -oP 'token":"\K[^"]+' key.txt)
- # finding new videos on youtube
- echo "Downloading youtube page"
- wget -O videos.html "${youtube}"
- # search for youtube titles
- echo "searching for youtube titles"
- grep -oP '(?<=dir="ltr">).*?(?=</a><span class="accessible-description")' videos.html > video-titles.txt
- # search for youtube urls
- echo "searching for youtube URLS"
- grep -Po '(?<=href="/watch)[^"]*' videos.html | uniq > video-urls.txt
- # add a prefix to every youtube url to make it complete
- echo "adding prefix to urls to make them complete"
- sed -i -e 's,^,https://www.youtube.com/watch,' video-urls.txt
- # loop through urls and titles for upload
- while IFS= read -r lineA && IFS= read -r lineB <&3; do
- # upload file to vid.me
- curl -X POST -H "AccessToken: ${accesstoken}" -d "url=${lineB}" -d "title=${lineA}" -d "description=${lineA}" https://api.vid.me/grab
- # go to sleep to avoid rate limit
- sleep 30
- done <video-titles.txt 3<video-urls.txt
- # clean up files
- rm key.txt videos.html video-urls.txt video-titles.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement