PornHub Bash Scripts 55 minutes ago
#1
A while back I wrote some bash scripts to help create some porn sites for people, here they are.
Code:
# retrieve information about a pornhub video URL
if [ -z $1 ]
then
echo "Please supply a PH URL (ie; $0 https://www.pornhub.com/view_video.php?viewkey=64eea7c904e51"
exit 1
fi
# get the url (of a video) from user input
# ie; https://www.pornhub.com/view_video.php?viewkey=64eea7c904e51
# download to file
#curl -sL -o videoinfo $1
# parse video info
title=$(cat videoinfo |grep -Eo '<title>(.+)<\/title>'|cut -d'>' -f2|cut -d'<' -f1)
tags=$(cat videoinfo |grep -Po "\/video\/search\?search\=\w+\">(\w+)<\/a>"|cut -d'>' -f2|cut -d'<' -f1|tr '\n' ','|sed 's/.$//')
cats=$(cat videoinfo |grep -Po "\'Category\'\)\;\">(\w+)<\/a>"|cut -d'>' -f2|cut -d'<' -f1|tr '\n' ','|sed 's/.$//')
thumb=$(cat videoinfo |grep -Po '(https\:\/\/\w+\.phncdn\.com\/videos\/\d+\/\d+\/\d+\/original\/.+$)'|cut -d'"' -f1|head -n1)
links=$(cat keys |sed -e 's/^/https\:\/\/www.pornhub.com\/view_video.php\?/'|uniq -u)
echo "title: $title"
echo "tags: $tags"
echo "cats: $cats"
echo "thumb: $thumb"
echo "links: $links"Code:
# download the main category list for pornhub
#download the categories page
echo "Downloading categories"
curl -sL -o categories https://www.pornhub.com/categories
echo "Parsing categories"
#return the categories
cat categories |sed -rn 's/<strong>(.+)<\/strong>/\1/p' |sed 's/^[ \t]*//' >cats
echo "Cleaning up"
mv cats categoriesCode:
# Download the latest pornhub feed and convert to JSON using toptal.com
# convert the feed and download
echo "Downloading latest feed"
curl -s -o pornhub.json https://www.toptal.com/developers/feed2json/convert?url=https://www.pornhub.com/video/webmasterss
# piped output, line-by-line
echo "Extracting information from feed"
cat pornhub.json |jq '.items[] | "\(.url)|\(.title)"'|tr -d "\"" >pornhub.tmp



![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)