此主题已被锁定
Jakebob-Smegheneghan 2024 年 2 月 11 日 下午 12:13
Getting the actual 600x900 Library assets
I'm wanting to use some of these pictures as wallpapers on my portrait screen and phone, but the ones that appear in librarycache are labelled as 600x900 but are 300x450px big. The 600x900 versions are available via certain websites, labelled as "2x", but I don't know how to get Steam to download these properly. Is there a way to get these downloaded as a batch rather than using certain websites to get these one at a time?
引用自 Pepe:
I think I have something. I've made some changes of the original poster's script from Gaming Stack Exchange:
import urllib.request import urllib.response import os import glob import platform library_cache = '~/.local/share/Steam/appcache/librarycache/' plat = platform.system() print(" Platform: " + plat) if plat == 'Windows': library_cache = 'C:/Program Files (x86)/Steam/appcache/librarycache/' elif plat == 'Darwin': library_cache = '~/Library/Application Support/Steam/appcache/librarycache/' library_cache = os.path.normpath(library_cache) print("Lib Cache: " + library_cache + "\n") paths=glob.glob(os.path.join(os.path.expanduser(library_cache),'*_library_600x900.jpg')) file_names = [os.path.basename(p) for p in paths] game_ids = [name.split("_")[0] for name in file_names] desktop_folder = os.path.normpath(os.path.expanduser('~/Desktop/steam_cover_art/')) if not os.path.exists(desktop_folder): os.makedirs(desktop_folder) for i in game_ids: steam_url = 'https://steamcdn-a.akamaihd.net/steam/apps/' + i + '/library_600x900_2x.jpg' print("""Downloading file from URL "%s"...""" % steam_url) try: url_open = urllib.request.urlopen(steam_url).read() file_path = os.path.join(desktop_folder, i + '_library_600x900_2x.jpg') open(file_path, 'wb+').write(url_open) print(""" Done: "%s"\n""" % file_path) except Exception as e: print(" Error:\n%s\n" % str(e))
Save this into a file like steam_cover_art.py and run it with python steam_cover_art.py.

It works on GNU/Linux. It should work on Windows or macOS as well with no changes to the code.

Let me know if that works in Windows, or if there's anything that I might need to change to make it work (I'm not sure of that Windows lib cache path).
< >
正在显示第 1 - 9 条,共 9 条留言
Pepe 2024 年 2 月 11 日 下午 1:48 
https://gaming.stackexchange.com/questions/359614/is-there-a-way-to-download-the-box-art-for-steam-games
I guess that Python script posted there would work as a batch download script for you, as your profile is public. If you don't have Python on your OS, it's not that complicated to install it. Get it from https://www.python.org/downloads/.

Hmm, it doesn't, the game list URL requires a login for some reason (maybe Valve thought too many bots are targeting people with listed public games). Well, I guess the script must be modified some way. Get the list of game IDs from the browser using a little bit of JS in developer mode, and add that list in the python code. Or, if you just want the cached images you have, make a script to get the list of id-s based on all the files matching *_library_600x900.jpg in your librarycache.

Later edit: I've just made a one-liner in bash for the library cache, that works by default on GNU/Linux, but you could run it on Windows (https://stackoverflow.com/questions/6413377/is-there-a-way-to-run-bash-scripts-on-windows). You would need to change the path for the library cache.
ls -1 ~/.local/share/Steam/appcache/librarycache/*_library_600x900.jpg | xargs -i basename {} | cut -d_ -f1 | xargs -i wget -O steam_game_{}_library_600x900_2x.jpg https://steamcdn-a.akamaihd.net/steam/apps/{}/library_600x900_2x.jpg
This script will make the files in the current directory of the shell. You might want to make a new directory and run the command from that directory (cd <DIR_PATH>).
最后由 Pepe 编辑于; 2024 年 2 月 11 日 下午 2:45
Jakebob-Smegheneghan 2024 年 2 月 11 日 下午 3:55 
I shall have to give this a proper look in a bit! I'm trying to get bash to work with Windows, and have the devtools stuff enabled, but trying to run the "bash.exe" thing is seemingly not doing anything, so it'll have to be a tomorrow thing. That, and I tried to preempt the Linux install and got a reminder of how shoddy the Microsoft Store is.

Glad to know that StackExchange thing wasn't working for you too. I tried running it and got the folder to appear, but nothing appearing in it afterwards. Though I didn't know what the issue was, hence why I made this thread in the first place. Thank you for the help, and I'll let you know how things go once I have the requisite files installed! :plagueknight:
Pepe 2024 年 2 月 12 日 上午 1:34 
I don't know Python much, I can understand the code, but you need to know the packages and functions needed to make the changes to the script to just read the apps from librarycache. I mean, I've tried using glob() func to filter out files in the python console, it didn't work with tilde path, so, with limited time on this, I've made that bash thing in 5 mins. I mean, you can make the same thing in any programming language or script you know, but you need to know it enough to put everything together. If Python works for you, I'll have another look a bit later.
d3str0y3r 2024 年 2 月 12 日 上午 1:38 
引用自 KING
Hi, whoever adds me as a friend I will give you a free gift. Here's the link to my profile:

Scam link, do not click. Just report the post and the account.
该讨论串的作者已表示此帖子解答了原先的主题。
Pepe 2024 年 2 月 12 日 上午 4:38 
I think I have something. I've made some changes of the original poster's script from Gaming Stack Exchange:
import urllib.request import urllib.response import os import glob import platform library_cache = '~/.local/share/Steam/appcache/librarycache/' plat = platform.system() print(" Platform: " + plat) if plat == 'Windows': library_cache = 'C:/Program Files (x86)/Steam/appcache/librarycache/' elif plat == 'Darwin': library_cache = '~/Library/Application Support/Steam/appcache/librarycache/' library_cache = os.path.normpath(library_cache) print("Lib Cache: " + library_cache + "\n") paths=glob.glob(os.path.join(os.path.expanduser(library_cache),'*_library_600x900.jpg')) file_names = [os.path.basename(p) for p in paths] game_ids = [name.split("_")[0] for name in file_names] desktop_folder = os.path.normpath(os.path.expanduser('~/Desktop/steam_cover_art/')) if not os.path.exists(desktop_folder): os.makedirs(desktop_folder) for i in game_ids: steam_url = 'https://steamcdn-a.akamaihd.net/steam/apps/' + i + '/library_600x900_2x.jpg' print("""Downloading file from URL "%s"...""" % steam_url) try: url_open = urllib.request.urlopen(steam_url).read() file_path = os.path.join(desktop_folder, i + '_library_600x900_2x.jpg') open(file_path, 'wb+').write(url_open) print(""" Done: "%s"\n""" % file_path) except Exception as e: print(" Error:\n%s\n" % str(e))
Save this into a file like steam_cover_art.py and run it with python steam_cover_art.py.

It works on GNU/Linux. It should work on Windows or macOS as well with no changes to the code.

Let me know if that works in Windows, or if there's anything that I might need to change to make it work (I'm not sure of that Windows lib cache path).
最后由 Pepe 编辑于; 2024 年 2 月 12 日 上午 7:39
Jakebob-Smegheneghan 2024 年 2 月 12 日 下午 12:06 
That seems to have done the trick! Just got back from work, checked if I needed to add anything, and running it filled the folder with the pics as expected. Thanks for the work, I hope more folks put this to use! :lukasLaugh:
david 10 月 12 日 下午 11:13 
You can use SteamGridDB
That's for custom images to install on the Steam library iirc, and whilst that is a useful resource, I already got the problem sorted well over a year and a half ago. Thanks all the same!
Wren 10 月 14 日 上午 1:12 
This thread was quite old before the recent post, so we're locking it to prevent confusion.
< >
正在显示第 1 - 9 条,共 9 条留言
每页显示数: 1530 50