I have a number of nexusmods ublock origin filters that look like this:…
- User
I have a number of nexusmods ublock origin filters that look like this:
www.nexusmods.com##[href="https://www.nexusmods.com/games/needforspeedheat "] www.nexusmods.com##[href="https://www.nexusmods.com/games/needforspeedunbound "] www.nexusmods.com##[href="https://www.nexusmods.com/games/neverwinter2 "] www.nexusmods.com##[href="https://www.nexusmods.com/games/newvegas "] www.nexusmods.com##[href="https://www.nexusmods.com/games/nioh2 "]
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):
||staticdelivery.nexusmods.com/images/games/4_3/tile_1190.jpg ||staticdelivery.nexusmods.com/images/games/4_3/tile_120.jpg ||staticdelivery.nexusmods.com/images/games/4_3/tile_1216.jpg ||staticdelivery.nexusmods.com/images/games/4_3/tile_1231.jpg ||staticdelivery.nexusmods.com/images/games/4_3/tile_1234.jpg ||staticdelivery.nexusmods.com/images/games/4_3/tile_1238.jpg ||staticdelivery.nexusmods.com/images/games/4_3/tile_1249.jpg ||staticdelivery.nexusmods.com/images/games/4_3/tile_1271.jpg ||staticdelivery.nexusmods.com/images/games/4_3/tile_1277.jpg
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:
Assistant
To convert your old NexusMods uBlock Origin filters to the new format that blocks game images, you'll need to:
- First find the game IDs from the old URLs
- Then construct the new image URLs using those IDs
Here's how you can approach this:
Step 1: Extract Game IDs from Old URLs
The old URLs follow this pattern:
https://www.nexusmods.com/games/[gameName]The new image URLs follow this pattern:
https://staticdelivery.nexusmods.com/images/games/4_3/tile_[gameId].jpgYou'll need to find the numeric game ID that corresponds to each game name in your old filters.
Step 2: Find the Game IDs
There are a few ways to find the game IDs:
-
Manual Lookup:
- Visit the game page on NexusMods
- Look at the page source or network requests to find the game ID
- The ID is often visible in API calls or image URLs
-
Automated Approach:
- You could write a script that: a. Visits each game URL b. Extracts the game ID from the page (either from the HTML or from network requests) c. Constructs the new filter URL
Example Conversion
For your example filters, here's how the conversion would work:
Old filter:
www.nexusmods.com##[href="https://www.nexusmods.com/games/needforspeedheat"]- Visit https://www.nexusmods.com/games/needforspeedheat
- Find the game ID (let's say it's 4875 for this example)
- New filter would be:
||staticdelivery.nexusmods.com/images/games/4_3/tile_4875.jpg
Implementation Options
-
Browser Extension: You could create a simple browser extension that:
- Takes your list of old URLs
- Visits each one
- Extracts the game ID
- Generates the new filters
-
Python Script: Here's a basic Python script outline using requests and BeautifulSoup:
import requests from bs4 import BeautifulSoup def get_game_id(game_url): response = requests.get(game_url) soup = BeautifulSoup(response.text, 'html.parser') # You'll need to inspect the page to find where the game ID is stored # This is just an example - the actual implementation will vary game_id = soup.find('meta', {'property': 'og:image'})['content'].split('_')[-1].split('.')[0] return game_id old_filters = [ "https://www.nexusmods.com/games/needforspeedheat", "https://www.nexusmods.com/games/needforspeedunbound", # ... add all your old URLs ] new_filters = [] for url in old_filters: try: game_id = get_game_id(url) new_filter = f"||staticdelivery.nexusmods.com/images/games/4_3/tile_{game_id}.jpg" new_filters.append(new_filter) except Exception as e: print(f"Failed to process {url}: {e}") print("\n".join(new_filters))Important Notes:
- Rate Limiting: Be respectful and don't hammer the NexusMods servers with too many requests too quickly.
- Legal Considerations: Make sure automated scraping complies with NexusMods' terms of service.
- Alternative Approach: If you can't find the game IDs in the HTML, you might need to look at the network requests in your browser's developer tools to find where the ID is exposed.
Would you like me to provide more specific guidance on any of these approaches?
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.