However the site has been redesigned and now those filters are useless. I want to convert them into the relevant images like this (these are not the equivalent to the above games, using them simply as an example):
As you can see, this can only be done automatically if 'something' accesses the links of the original filters (I don't know much computer science). How would we be able to do this?
If it's of any help, I have sleuthed with my minimal computer science knowledge and found that in the developer tools the relevant url would look like this:
Great detective work! You’re correct: the new NexusMods layout uses images for game tiles, and the URLs for these images are based on the game’s internal ID (e.g., tile_4875.jpg). To automatically convert your old uBlock filters to the new image-based ones, you need to:
Extract the game slug from your old filters (e.g., needforspeedheat from https://www.nexusmods.com/games/needforspeedheat).
Find the corresponding game ID for each slug.
Generate the new filter using the image URL pattern.
NexusMods does not provide a public API to map slugs to IDs directly, but you can do it programmatically by scraping or using their unofficial API. However, you need an API key (free with a NexusMods account).
Option A: Manual (for a few games)
Go to https://www.nexusmods.com/games/needforspeedheat
Open DevTools → Network tab, reload, and look for requests to tile_XXXX.jpg or check the page source for the image URL.
requests and beautifulsoup4 libraries (pip install requests beautifulsoup4)
python
import requests
from bs4 import BeautifulSoup
# List of game slugs
game_slugs = [
"needforspeedheat",
"needforspeedunbound",
"neverwinter2",
"newvegas",
"nioh2"
]
base_url = "https://www.nexusmods.com/games/"
for slug in game_slugs:
url = base_url + slug
try:
r = requests.get(url)
soup = BeautifulSoup(r.text, "html.parser")
# Find the image with 'tile_' in the src
img = soup.find("img", src=lambda x: x and "tile_" in x)
if img:
src = img['src']
# Extract the tile number
import re
m = re.search(r'tile_(\d+)\.jpg', src)
if m:
game_id = m.group(1)
filter_line = f"||staticdelivery.nexusmods.com/images/games/4_3/tile_{game_id}.jpg"
print(filter_line)
else:
print(f"Game ID not found for {slug}")
else:
print(f"Image not found for {slug}")
except Exception as e:
print(f"Error processing {slug}: {e}")
How to Use
Replace game_slugs with your list of slugs.
Run the script.
Copy the output lines into your uBlock Origin filter list.
Summary
Manual: For a few games, just check the image URL in DevTools.
Automated: Use the script above to process many games at once.
If you need a ready-to-use script for Windows or want to do this in another language (like JavaScript), let me know!