Guest User

Untitled

a guest
Feb 6th, 2023
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.80 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. path="${HOME}/Pictures"
  4. gamelist="${path}/gamelist.json"
  5.  
  6. function getList {
  7.   echo "게임리스트 다운받는 중..."
  8.   curl --silent https://api.steampowered.com/ISteamApps/GetAppList/v2/ --output ${gamelist}
  9. }
  10.  
  11. function getName {
  12.   gameName=$(jq -c -r "[ .applist .apps[] | select( .appid==$1) | .name ][0]" ${gamelist})
  13. }
  14.  
  15.  
  16. if [ ! -f "${gamelist}" ]; then
  17.   getList
  18. fi
  19.  
  20. for item in $(find ~/.local/share/Steam/userdata -name screenshots); do
  21.   gameid=$(echo ${item} | cut -d '/' -f11)
  22.   getName ${gameid}
  23.   screenshotPath="${path}/${gameName}"
  24.   echo "${gameName} 복사중..."
  25.  
  26.   if [ ! -d "${screenshotPath}" ]; then
  27.     mkdir "${screenshotPath}"
  28.   fi
  29.  
  30.   $(find ${item} -maxdepth 1 -regex '\(.*jpg\|.*png\)' -exec cp -ap {} "${screenshotPath}" \;)
  31. done
  32.  
  33. echo "완료"
Add Comment
Please, Sign In to add comment