Last active
February 5, 2024 00:20
-
-
Save brandonprry/3c846b9b9ebd625cc3c432be01859f93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COOKIE='your_web_session_cookie_use_document.cookie_in_js_console' | |
SHOP='your_shop_id' | |
for i in `seq 0 39 500`; do curl --retry 5 \ | |
-H $'Host: www.etsy.com' -H $'Authority: www.etsy.com' -H $'Accept: application/json, text/javascript, */*; q=0.01' -H $'Accept-Language: en-US,en;q=0.9' -H $'Content-Type: application/json' -H $'Referer: https://www.etsy.com/your/shops/WanderingRobotStudio/tools/listings/view:table/1492031241' -H $'Sec-Ch-Ua: \"Google Chrome\";v=\"113\", \"Chromium\";v=\"113\", \"Not-A.Brand\";v=\"24\"' -H $'Sec-Ch-Ua-Mobile: ?0' -H $'Sec-Ch-Ua-Platform: \"macOS\"' -H $'Sec-Fetch-Dest: empty' -H $'Sec-Fetch-Mode: cors' -H $'Sec-Fetch-Site: same-origin' -H $'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36' -H $'X-Detected-Locale: USD|en-US|US' -H $'X-Requested-With: XMLHttpRequest' \ | |
-b "$COOKIE" \ | |
$'https://www.etsy.com/api/v3/ajax/shop/'$SHOP'/listings/search?limit=200&offset='$i'&sort_field=ending_date&sort_order=descending&state=active&language_id=0&query=&shop_section_id=&listing_tag=&is_featured=&shipping_profile_id=&return_policy_id=&production_partner_id=&is_retail=true&is_retail_only=&is_pattern=&is_pattern_only=&is_digital=&channels=&is_waitlisted=&has_video=' > $i.json; done | |
for i in `grep -oh '"listing_id":..........' *.json |cut -d ":" -f2 | sort | uniq`; do mkdir $i; cd $i; curl --retry 5 \ | |
-H $'Host: www.etsy.com' -H $'Authority: www.etsy.com' -H $'Accept: application/json, text/javascript, */*; q=0.01' -H $'Accept-Language: en-US,en;q=0.9' -H $'Content-Type: application/json' -H $'Referer: https://www.etsy.com/your/shops/WanderingRobotStudio/tools/listings/view:table' -H $'Sec-Ch-Ua: \"Google Chrome\";v=\"113\", \"Chromium\";v=\"113\", \"Not-A.Brand\";v=\"24\"' -H $'Sec-Ch-Ua-Mobile: ?0' -H $'Sec-Ch-Ua-Platform: \"macOS\"' -H $'Sec-Fetch-Dest: empty' -H $'Sec-Fetch-Mode: cors' -H $'Sec-Fetch-Site: same-origin' -H $'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36' -H $'X-Detected-Locale: USD|en-US|US' -H $'X-Requested-With: XMLHttpRequest' \ | |
-b "$COOKIE" \ | |
$'https://www.etsy.com/api/v3/ajax/bespoke/shop/'$SHOP'/listings/'$i'/form'>$i.json;cd ..; done | |
#for i in `ls -d */`; do cd $i; for u in `cat * |ggrep -ohP 'MB","url":"(.*?)preview...............' |cut -d'"' -f5|sed -e s/\\\\\\\\//g`; do curl --retry 5 \ | |
# -H $'Host: www.etsy.com' -H $'Authority: www.etsy.com' -H $'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' -H $'Accept-Language: en-US,en;q=0.9' -H $'Referer: https://www.etsy.com/your/shops/WanderingRobotStudio/tools/listings/view:table/1477827864' -H $'Sec-Ch-Ua: \"Google Chrome\";v=\"113\", \"Chromium\";v=\"113\", \"Not-A.Brand\";v=\"24\"' -H $'Sec-Ch-Ua-Mobile: ?0' -H $'Sec-Ch-Ua-Platform: \"macOS\"' -H $'Sec-Fetch-Dest: document' -H $'Sec-Fetch-Mode: navigate' -H $'Sec-Fetch-Site: same-origin' -H $'Sec-Fetch-User: ?1' -H $'Upgrade-Insecure-Requests: 1' -H $'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36' \ | |
# -b "$COOKIE" -L \ | |
# $'https://www.etsy.com'$u > `uuidgen`.pdf; done; cd ..; done | |
#for i in `ls -d */`; do cd $i; name=`cat *.json | jq -r '.listing.title' | sed -e 's/'//g'`; pdfjam --outfile "`echo $name | cut -d '|' -f1`.pdf" --papersize '{5.8in,8.8in}' *.pdf; cd ..; done | |
#for i in `ls -d */`; do cd $i; pdftk "`ls *pdf|grep -v -- -`" cat 1 2 3 4 5 output sample.pdf; cd ..; done | |
#for i in `ls -d */`; do cd $i; convert sample.pdf -background white -alpha remove sample.jpg; cd ..; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment