Register on the forum now to remove ALL ads + popups + get access to tons of hidden content for members only!
vintage erotica forum vintage erotica forum vintage erotica forum
vintage erotica forum
Home
Go Back   Vintage Erotica Forums > Information & Help Forum > Help Section > Image Hosts
Best Porn Sites Live Sex Register FAQ Members List Calendar Mark Forums Read

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old June 17th, 2017, 05:34 AM   #1
sagjob
Senior Member
 
Join Date: Aug 2011
Posts: 333
Thanks: 1,098
Thanked 8,548 Times in 339 Posts
sagjob 25000+sagjob 25000+sagjob 25000+sagjob 25000+sagjob 25000+sagjob 25000+sagjob 25000+sagjob 25000+sagjob 25000+sagjob 25000+sagjob 25000+
Default pixhost.org BASH upload script

If you are familiar with BASH scripts, thought I'd post this in case someone wanted to modify it for their needs.

READ THE WARNING IN THE SCRIPT COMMENTS OR YOU'LL SCREW THIS UP.
- BBCODE won't let me post it as-is.


Code:
#!/bin/bash

#Fix sequence for missing images (404 not found)
#Rename 0001, 0002, 0003...
#Delete this if you want to keep filenames
a=1
for i in *.[Jj][Pp][Gg]; do
  new=$(printf "%04d.jpg" "$a") #04 pad to length of 4
  mv -i -- "$i" "$new"
  let a=a+1
done

#Find all JPG files in current folder
files=($(find -E . -type f -regex "^.*jpg"))
#Clear the Forum URL txt file if it exists.
> post.txt
#Process each JPG Found
for item in ${files[*]}
do
  printf "   %s\n" $item | sed 's/\ \ \ .\///g'
  output=$(curl -X POST --include "https://api.pixhost.to/images"  -H 'Content-Type: multipart/form-data; charset=utf-8' -H 'Accept: application/json' -F "img=@$item" -F 'content_type=0' -F 'max_th_size=180')
  fullImage=$(echo $output | sed 's/^.*show_url//g' | sed 's/\":\"//g' | sed 's/\\//g' | sed 's/\".*//g')
  thumbImage=$(echo $output | sed 's/^.*show_url//g' | sed 's/\":\"//g' | sed 's/\\//g' | sed 's/^.*th_url//g' | sed 's/"}//g')
# WARNING: CHANGE below { to [ and } to ]...bbcode makes this a URL so it won't post right on forum.
  echo -n "{url="$fullImage"][img]"$thumbImage"[/img][/url} " >> post.txt
done

#Put into OSX Clipboard
cat post.txt | sort | pbcopy

#Send OSX Notification
osascript -e 'display notification "Copied to Clipboard" with title "Upload Complete"'

#Delete all JPGs in folder to clear for next batch.
rm *.jpg
I run this on OSX Sierra. It is messy, but functional for my needs. Some command may not be native to OSX. May require HomeBrew https://brew.sh/

Feel free to tweak and repost a better version that is more adaptable to all. Just sharing in case it helps someone get started on their own script.

If you don't know what you're doing—Don't. You've been warned.

Here it is in action.

https://www.youtube.com/watch?v=T4-anPkVvfg
sagjob is offline   Reply With Quote
The Following 7 Users Say Thank You to sagjob For This Useful Post:


 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump




All times are GMT. The time now is 10:59 AM.






vBulletin Optimisation provided by vB Optimise v2.6.1 (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.