IMPORTANT: Use Game Folder Cleaner to make a clean Vanilla files list (you'll see what I mean when you use it), and use the software to remove ALL the non-vanilla files installed by Vortex prior to installing mods with MO2.
Install both Vortex and MO2, let Vortex handle downloads.
Set a custom path and folder to store Vortex downloads. Settings -> Downloads -> Downloads Folder.
Set the MO2 downloads folder to the folder you set for Vortex, so they share the same downloads folder.
Tools -> Settings -> Paths -> Downloads
In the MO2 downloads tab where you click to install, click Query Metadata after downloading the mods you want.
For anyone confused by lishmael's post below here's a simplified explanation.
Open with Notepad++ and go to line 70 and change it from: request = urllib.request.Request("https://next.nexusmods.com/api/graphql", data=json_data, headers=headers)
It looks like Nexus changed the URLs for collections, still works but you have to copy-paste the example URL on the mod page, then replace the "Blahblahblah" part with the string of letters for the collection you are looking to download.
Cheers for this. I was trying all sorts and getting frustrated, but this works.
If anyone is in the same boat as I was, the two changes are that the URL needs to start "https://next.nexus...", and that the ".com/games/collections..." bit needs to be stripped out.
To this date Nauticalius comment helped me personally the most when looking through a solution. Thank you @ Nauticalius.
"If anyone is in the same boat as I was, the two changes are that the URL needs to start "https://next.nexus...", and that the".com/games/collections..." bit needs to be stripped out." (replace "www" with "next") No need to edit the NexusCollections.py file in notepad++ unless there's something I'm missing.
Do you know how to paste that code correctly? I found it on line 67, but I don't know exactly what to replace
Edit: I figured out how to enter the code. But when I download the collection, it goes into a pending mode and I get the message "Download cancellation: Either you clicked a premium-only link and your account isn't premium, or the download link was generated by a different account than the one stored in Mod Organizer."
First off, many kudos to Kojillama for authoring this fantastic gem for MO2!
For those having trouble getting this collections download tool (MO2 plugin) to work, it seems Nexus has modified the relevant URL patterns.
The current Nexus URL pattern for Collections: https://www.nexusmods.com/games/{GAME_NAME}/collections/{COLLECTION_ID}
and the API to download: https://www.nexusmods.com/games/api/graphql
Editing two lines of python code in the MO2 plugin to match the new Nexus URL patterns gets this unique plugin back into full working state.
Kojillama, might you make these updates? I can post the code changes I have made but your official update would be great.
Also, asking the author if there is a means within this plugin code to limit the number of simultaneously active downloads? For me at least, there seems there may be intermittent download errors that seem to be exacerbated (or caused) by having a large number of downloads active at the same time. An appropriate hardcoded limit, or the means for the user to enter a "max number of active downloads" might be a worthy addition to this very useful plugin (if possible).
If all of the above lines are rewritten as instructed, you can then save the .py file and reboot Mod Organizer 2. Enter the Collection link, press Next, and the plugin should now work as intended. Enjoy!
I did this and I can get past the first screen where you put in the URL. But the next screen where you choose the revision is blank and there is nothing in the drop down. Is there another line that needs to be edited?
BioX853, thanks for posting your exact code changes. I had made the same/equivalent code changes and they were working... until just a few minutes ago! Has something new changed at Nexus? Now also your changes don't seem to be work (for me at least). Will update this post if I find out more. THANKS everyone!
The API endpoints is "https://api.nexusmods.com/v2/graphql". Check API reference at NexusMods GraphQL API Reference Replace API endpoints in line 70 from "https://next.nexusmods.com/api/graphql" to "https://api.nexusmods.com/v2/graphql".
Line 224 should be changed as described by Biox853 if you are pasting a WWW.NexusMods URL and not a Next.NexusMods path.
I've done all the fixes recommended in this thread and they all fail once i reach the "collection revision" selection. a pop up box shows up with the option to select the collection revision but the drop down selection doesn't open and pressing next just gives me this error.
[2025-03-26 17:45:33.888 W] {'errors': [{'message': 'Game not found', 'locations': [{'line': 1, 'column': 67}], 'path': ['collection'], 'extensions': {'code': 'NOT_FOUND', 'detail': 'Game not found'}}], 'data': None} [2025-03-26 17:46:49.834 E] Traceback (most recent call last): [2025-03-26 17:46:49.834 E] File "D:/MO2/plugins/NexusCollections.py", line 189, in next [2025-03-26 17:46:49.834 E] self.collectionRevision = int(self.revisionList.currentText().replace('Revision ', '').split(' (')[0]) [2025-03-26 17:46:49.835 E] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2025-03-26 17:46:49.835 E] ValueError: invalid literal for int() with base 10: ''
The API endpoints is "https://api.nexusmods.com/v2/graphql". Check API reference at NexusMods GraphQL API Reference Replace API endpoints in line 70 from "https://next.nexusmods.com/api/graphql" to "https://api.nexusmods.com/v2/graphql".
Line 224 should be changed as described by Biox853 if you are pasting a WWW.NexusMods URL and not a Next.NexusMods path.
This is the solution for error code: "ValueError: invalid literal for int() with base 10: ''" on line 189
After also changing line 224 to: "nexusmods\.com\/games\/(.*?)\/collections\/(.*?)(?:\?.*)?$"
Having a problem now where it's not letting me select the revision. The drop down is totally blank, and I get the error "ValueError : invalid literal for int() with base 10:"
Edit; sorry there was more to that error in the log, here's the full thing [2025-05-03 06:16:41.692 E] Traceback (most recent call last): [2025-05-03 06:16:41.692 E] File "C:/Modding/MO2/plugins/NexusCollections.py", line 190, in next [2025-05-03 06:16:41.692 E] self.collectionRevision = int(self.revisionList.currentText().replace('Revision ', '').split(' (')[0]) [2025-05-03 06:16:41.693 E] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [2025-05-03 06:16:41.693 E] ValueError: invalid literal for int() with base 10: ''
215 comments
IMPORTANT: Use Game Folder Cleaner to make a clean Vanilla files list (you'll see what I mean when you use it), and use the software to remove ALL the non-vanilla files installed by Vortex prior to installing mods with MO2.
Open with Notepad++ and go to line 70 and change it from:
request = urllib.request.Request("https://next.nexusmods.com/api/graphql", data=json_data, headers=headers)
to:
request = urllib.request.Request("https://api.nexusmods.com/v2/graphql", data=json_data, headers=headers)
Then go to line 224 and change it from:
pattern = r"next\.nexusmods\.com\/(.*?)\/collections\/(.*?)(?:\?.*)?$"
to:
pattern = r"nexusmods\.com\/games\/(.*?)\/collections\/(.*?)(?:\?.*)?$"
and save.
If anyone is in the same boat as I was, the two changes are that the URL needs to start "https://next.nexus...", and that the ".com/games/collections..." bit needs to be stripped out.
"If anyone is in the same boat as I was, the two changes are that the URL needs to start "https://next.nexus...", and that the".com/games/collections..." bit needs to be stripped out."
(replace "www" with "next")
No need to edit the NexusCollections.py file in notepad++ unless there's something I'm missing.
--- NexusCollections.py2024-04-13 02:35:38.846987500 +0300
+++ NexusCollections.py2025-05-14 13:14:35.078178600 +0300
@@ -67,7 +67,7 @@
"Accept": "application/json",
}
json_data = json.dumps(payload).encode("utf-8")
- request = urllib.request.Request("https://next.nexusmods.com/api/graphql", data=json_data, headers=headers)
+ request = urllib.request.Request("https://api.nexusmods.com/v2/graphql", data=json_data, headers=headers)
try:
with urllib.request.urlopen(request) as response:
content = response.read()
@@ -221,7 +221,7 @@
def dialogInitial(self, main_window : "QMainWindow") -> "QDialog":
def next():
nexusUrl = self.nexusUrl.text()
- pattern = r"next\.nexusmods\.com\/(.*?)\/collections\/(.*?)(?:\?.*)?$"
+ pattern = r"nexusmods\.com\/games\/(.*?)\/collections\/(.*?)(?:\?.*)?$"
match = re.search(pattern, nexusUrl)
if match:
self.gameId = match.group(1)
Edit: I figured out how to enter the code. But when I download the collection, it goes into a pending mode and I get the message "Download cancellation: Either you clicked a premium-only link and your account isn't premium, or the download link was generated by a different account than the one stored in Mod Organizer."
For those having trouble getting this collections download tool (MO2 plugin) to work, it seems Nexus has modified the relevant URL patterns.
The current Nexus URL pattern for Collections:
https://www.nexusmods.com/games/{GAME_NAME}/collections/{COLLECTION_ID}
and the API to download:
https://www.nexusmods.com/games/api/graphql
Editing two lines of python code in the MO2 plugin to match the new Nexus URL patterns gets this unique plugin back into full working state.
Kojillama, might you make these updates? I can post the code changes I have made but your official update would be great.
Also, asking the author if there is a means within this plugin code to limit the number of simultaneously active downloads? For me at least, there seems there may be intermittent download errors that seem to be exacerbated (or caused) by having a large number of downloads active at the same time. An appropriate hardcoded limit, or the means for the user to enter a "max number of active downloads" might be a worthy addition to this very useful plugin (if possible).
69. request = urllib.request.Request("https://www.nexusmods.com/games/api/graphql", data=json_data, headers=headers)
223. pattern = r"https://www.nexusmods.com/games/{GAME_NAME}/collections/{COLLECTION_ID}"
The tool still hangs at the window where you enter the collection URL. Did I not do this right?
In line 69/70, replace the quote "https://next.nexusmods.com/api/graphql"
TO:
"https://www.nexusmods.com/games/api/graphql"
Now, in line 223/224, replace the quote "next\.nexusmods\.com\/(.*?)\/collections\/(.*?)(?:\?.*)?$"
TO:
"nexusmods\.com\/games\/(.*?)\/collections\/(.*?)(?:\?.*)?$"
If all of the above lines are rewritten as instructed, you can then save the .py file and reboot Mod Organizer 2. Enter the Collection link, press Next, and the plugin should now work as intended. Enjoy!
https://www.nexusmods.com/games/fallout4/collections/ldf8lp
But it looks like they've changed the API again
Check API reference at NexusMods GraphQL API Reference
Replace API endpoints in line 70 from "https://next.nexusmods.com/api/graphql" to "https://api.nexusmods.com/v2/graphql".
Line 224 should be changed as described by Biox853 if you are pasting a WWW.NexusMods URL and not a Next.NexusMods path.
[2025-03-26 17:45:33.888 W] {'errors': [{'message': 'Game not found', 'locations': [{'line': 1, 'column': 67}], 'path': ['collection'], 'extensions': {'code': 'NOT_FOUND', 'detail': 'Game not found'}}], 'data': None}
[2025-03-26 17:46:49.834 E] Traceback (most recent call last):
[2025-03-26 17:46:49.834 E] File "D:/MO2/plugins/NexusCollections.py", line 189, in next
[2025-03-26 17:46:49.834 E] self.collectionRevision = int(self.revisionList.currentText().replace('Revision ', '').split(' (')[0])
[2025-03-26 17:46:49.835 E] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-03-26 17:46:49.835 E] ValueError: invalid literal for int() with base 10: ''
This is the solution for error code:
"ValueError: invalid literal for int() with base 10: ''" on line 189
After also changing line 224 to:
"nexusmods\.com\/games\/(.*?)\/collections\/(.*?)(?:\?.*)?$"
Thanks, @CommonDenominator!
https://api.nexusmods.com/v2/graphql
and line 224 to
nexusmods\.com\/games\/(.*?)\/collections\/(.*?)(?:\?.*)?$
solved the issue
Edit; sorry there was more to that error in the log, here's the full thing
[2025-05-03 06:16:41.692 E] Traceback (most recent call last):
[2025-05-03 06:16:41.692 E] File "C:/Modding/MO2/plugins/NexusCollections.py", line 190, in next
[2025-05-03 06:16:41.692 E] self.collectionRevision = int(self.revisionList.currentText().replace('Revision ', '').split(' (')[0])
[2025-05-03 06:16:41.693 E] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2025-05-03 06:16:41.693 E] ValueError: invalid literal for int() with base 10: ''