I have lost (from my HD) one image that is in one of my gallery... How can I do to download it back ?
TIA for help...
J-P.
Board index ‹ PBase ‹ Questions and Answers ‹ How can I download my OWN images ?
scherrer wrote:Don't rush to respond ! I found a way to do it, although not the most easy: I downloaded PB2SMUG.exe/PB2SMUG.DAT ! It works, but it loads the images in one directory, the titles in another one, etc... then sort this out yourselves !!! A hell of a job to make the titles correcpond to the images ! Fortunately I only needed a few images, hence it was easy !
If someone has a better solution, I'll be all over it !
J-P.
#!/bin/bash
#
# Written by Steve Sirois
# August 25, 2018
#
# Required tools :
# Xidel
# https://github.com/benibela/xidel
#
# exiftool (optional, remove it below if you don't need it):
# https://sno.phy.queensu.ca/~phil/exiftool/
#
# ADJUST THIS!!!!!
USERNAME="your-pbase-username"
# ...and let the script do the rest...
IFS=$'\r\n' GLOBIGNORE='*' command eval 'galleries=($(cat galleries.txt))'
# This transform the text file galleries.txt into an array
for (( i=0; i<${#galleries[@]}; i++ ))
do
# For each gallery, build the main url that show all the photos
url="http://www.pbase.com/"$USERNAME"/"${galleries[$i]}"&page=all"
# Then, use xidel to extract the path of each image
imagepath=( $( xidel $url --xquery '//a/@href[contains(., "'$USERNAME'/image")]' ) )
# Create a sub-dir for each gallery where to save image
mkdir -p ${galleries[$i]}
cd ${galleries[$i]}
for (( j=0; j<${#imagepath[@]}; j++ ))
do
# Now, for each image, get the original file
curl -s -L ${imagepath[$j]}"/original.jpg" > $j.jpg
# Optional from here: Get the title of the photo...
title=$( xidel ${imagepath[$j]} --xquery '//span[@class="title"]' )
# ...and update the metadata description with this title
exiftool -Caption-Abstract="$title" \
-EXIF:ImageDescription="$title" \
-XMP-tiff:ImageDescription="$title" \
-XMP-dc:Description="$title" \
-overwrite_original -q $j.jpg
done
cd ..
done
echo "Extraction completed!"
Board index ‹ PBase ‹ Questions and Answers ‹ How can I download my OWN images ?
Users browsing this forum: ClaudeBot, trendictionbot and 1 guest