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 (tiles) for games, and the URLs for these images are based on the game’s internal ID (e.g., tile_4875.jpg). To convert your old uBlock filters to block these images, you need to:
Map each game’s URL slug (e.g., needforspeedheat) to its NexusMods game ID (e.g., 4875).
Open Developer Tools (F12) and go to the Network tab.
Reload the page and look for a request to something like /games/needforspeedheat or for image requests to /images/games/4_3/tile_XXXX.jpg.
Find the tile image request—the number in tile_XXXX.jpg is the game’s ID.
Automated Method (for Many Games)
You can use a script to fetch the game ID. NexusMods has a public API that you can use to get the game ID from the slug.
Example Python Script:
python
import requests
# List of game slugs from your filters
game_slugs = [
"needforspeedheat",
"needforspeedunbound",
"neverwinter2",
"newvegas",
"nioh2"
]
headers = {
"apikey": "YOUR_NEXUSMODS_API_KEY" # You need to register for a free API key at NexusMods
}
for slug in game_slugs:
url = f"https://api.nexusmods.com/v1/games/{slug}.json"
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json()
game_id = data['id']
print(f"||staticdelivery.nexusmods.com/images/games/4_3/tile_{game_id}.jpg")
else:
print(f"Failed to get ID for {slug}")
ReplaceYOUR_NEXUSMODS_API_KEY with your own API key from NexusMods API.
This script will print out the correct uBlock filter for each game.
Step 2: Add the Filters to uBlock Origin
Copy the output lines (e.g., ||staticdelivery.nexusmods.com/images/games/4_3/tile_4875.jpg)
and paste them into your uBlock Origin "My filters" tab.
If You Don’t Want to Use the API
You can also:
Right-click the game tile image on the NexusMods games page and copy the image address. The number in the filename is the game ID.
Use that number to build your filter.
Summary
Find the game ID (manually or via API).
Build the filter: ||staticdelivery.nexusmods.com/images/games/4_3/tile_<ID>.jpg
Add to uBlock Origin.
Let me know if you want a ready-to-use script, or if you need help with a specific game!