Hey everyone, I created a Custom selenium python script borrowing bits and pieces from the Maxime OpenSea Auto Uploader script. I had tried using his script as it was, but I ran into many issues, probably mostly user error on my part (who knows)
Anyway, here it is... it only works with Json files currently because that's what i needed. This project was built more around my own needs and is uploaded to this repo in that way as well... It's NOT going to work for everyone, and you'll very highly likely need to modify the code to get it to work with your project. I'm sure that i could do some things to make it more user friendly...
On the other hand, when i wrote it, it wasn't really designed to be the most user friendly or fully featured, its just a wham-bam thank you ma'am sorta "Git'er Done" kinda project.
Changes might come down the road, but for the time being, if you're using multiple json files to upload to opensea, this should work for you (with a little elbow grease).
The way its supposed to work is, after setting up the folders and files, you add your Json files to the Data folder... you don't use the single Master Json file that's generated from say, the hashlips generator for instance... you would instead use the individual numbered json files. Add as many of those as you want to the data folder, and then run the script and once it starts it'll log into your metamask, go to to opensea, create an NFT (add properties, collection, set which blockchain, etc), it will then MINT that NFT and then LIST the NFT for whatever price set in the Json file... it will then go on to the next Json file in the data folder and do the same process for that until it has gone through all Json files.
Let me know what you think, and how i could improve my code. I'm open to hearing feedback and welcome changes.
➜ Feel free to support the dev of this repo if it has helped you out in your NFT journey and you feel like giving back (THANK YOU):
➜ 0x8736ee29f772b9a972547c228a5f43e427e783ae (Ethereum).
➜ Check out one of my collections on OpenSea if you feel like it Kurt At Work.
➜ Check out yet another one of my collections on OpenSea if you feel like it Let's Go Brandon NFT.
➜ Check out another of my collections on OpenSea if you feel like it SeaSlug Called Jamulous.
- What does this bot do?
- Changelog.
- To do list.
- Instructions.
- Data files structure.
- Configuration of the sales part of the NFTs.
- Known issues and important things to know.
This script allows you to upload and sell as many NFTs as you want to Opensea, all automatically and quickly (about 2 NFTs per minute) with metadata integrated, and Ethereum and Polygon Blockchains are supported.
You can decide whether you want to upload or sell your NFTs, or both. Currently this code has a hard coded schedule of a 6 month sales listing (the old code was breaking at this point so i figured an easy fix was to just comment out that line of code and let the default value do its thing, since what I wanted was the default anyway)
- Version 1.0:
- Inital commit.
- ✔
MetaMask automatic login. - ✔
Opensea automatic login with MetaMask. - ✔
Automatic NFT uploader. - ✔
Possibility to set a price for each NFT. - ✔
Support for 1+ supplies and Polygon blockchain. - ✔
Actually Lists the NFT for sale. - ✔
Data file browsing feature. - ✔
JSON structure reader and interpreter.
-
- Download this repository or clone it by typing this command in your command prompt:
git clone https://github.com/kurtatwork/KurtAtWork-OpenSea-Auto-Uploader.git
- It requires Python 3.7 or a newest version - developped with Python 3.9.7.
- Install pip to be able to have needed Python modules.
- Open a command prompt in the repository folder and type:
pip install -r requirements.txt
-
-
Extract the repository folder from the ZIP file, you should have a folder named
KurtAtWork-OpenSea-Auto-Uploader-master
. -
Download and install Google Chrome.
-
Download the ChromeDriver executable that is compatible with the actual version of your Google Chrome browser and your OS (Operating System). To know your Google Chrome browser version, refer to: What version of Google Chrome do I have?
-
Extract the executable file from the ZIP file and copy/paste it in the
assets/
folder of the repository. -
Create your NFTs data files containing all details for each NFT. It currently MUST be JSON files. Examples provided in the 'data' foler in this project repo.
-
Your NFT Json files must be located in the
data/
folder and the name of each one must be a number. -
Make sure that your Json files match the formatting of the example Json sample files... if they do not match, i.e. you end up having to change the number of properties in the Json file, then changes may also need to be made to the main.py file in order to accomodate for those differences.
-
Regardless of whether you changed the the formatting of the Json files, you will want to look into the code of the main.py file and see if you need to change things here or there to accomodate your particular project. there is a certain portion of the code that automatically spits out new Json files after the NFTs are minted and listed, and you may want to change some of the preset data there such as the 'tags' field, and other fields... There's probably a few other things you might want to change throughout for your project.
-
Feel free to reach out in a ticket request if you need assistance or if you have suggestions for ways to improve this script.
-
And again, if you enjoy this script or get some valuable use out of it, feel free to consider donating to my wallet, or purchasing an NFT from one of my collections. ➜ 0x8736ee29f772b9a972547c228a5f43e427e783ae (Ethereum).
➜ One of my collections on OpenSea Kurt At Work.
➜ Another one of my collections on OpenSea Let's Go Brandon NFT.
➜ Yet Another of my collections on OpenSea SeaSlug Called Jamulous.
-
If you do not want to add details to the values not required, leave:
- an empty string for JSON files:
"file_path": "C:/Users/Admin/Desktop/NFT/nft_0001.png",
"nft_name": "NFT #1",
"description": "",
Required values *
(Mandatory value in certain specified cases)
Details | Data Types | Literal examples | JSON examples |
File Path * | String | "file_path": "C:/Users/Admin/Desktop/NFT/nft_0001.png", | |
NFT Name * | String | "nft_name": "NFT #1", | |
External Link | String | "external_link": "https://yournftwebsite.com/yournftcollection/000001",
"external_link": "", |
|
Description | String | "description": "This is my first NFT.",
"description": "", |
|
Collection | String | "collection": "My NFTs",
"collection": "", |
|
Properties | List[[String, String], ...]
List[String, String] |
["type", "name"]
[["type", "name"], ["type", "name"]] |
"properties": [{ "type": "Dog", "name": "Male" }, { "type": "Cat", "name": "Female" }],
"properties": [{ "type": "Dog", "name": "Male" }], "properties": "", |
Levels | List[[String, Integer, Integer], ...]
List[String, Integer, Integer] |
["name", value_from, value_to]
[["name", value_from, value_to], ["name", value_from, value_to]] |
"levels": [{ "name": "Speed", "from": 2, "to": 5 }, { "name": "Width", "from": 1, "to": 10 }],
"levels": [{ "name": "Speed", "from": 2, "to": 5 }], "levels": "", |
Stats | List[[String, Integer, Integer], ...]
List[String, Integer, Integer] |
["name", value_from, value_to]
[["name", value_from, value_to], ["name", value_from, value_to]] |
"stats": [{ "name": "Strenght", "from": 10, "to": 100 }, { "name": "Age", "from": 1, "to": 99 }],
"stats": [{ "name": "Strenght", "from": 10, "to": 100 }], "stats": "", |
Unlockable Content | List[Boolean, String]
List[Boolean] Boolean |
[True, "unlockable_content"]
[False] False |
"unlockable_content": [true, "Thank you for purchasing my NFT!"],
"unlockable_content": [false], "unlockable_content": false, "unlockable_content": "", |
Explicit And Sensitive Content | Boolean | "explicit_and_sensitive_content": true,
"explicit_and_sensitive_content": false, "explicit_and_sensitive_content": "", |
|
Supply | Integer | "supply": 1,
"supply" : "", |
|
Blockchain | String | "blockchain": "Polygon",
"blockchain" : "", |
|
Sale Type (only for Ethereum Blockchain and 1 supply) | String | "sale_type": "Timed Auction",
"sale_type": "", |
|
Price * | Float or Integer | "price": 5,
"price": 0.25, |
|
Method (only for "Timed Auction") | List[String, Float] | ["method", price]
["method, ""] |
"method": ["Sell with declining price", 0.002],
"method": ["Sell to highest bidder", 0.05], "method": ["Sell to highest bidder", ""], "method": "", |
Duration ("DD-MM-YYYY HH:MM") | List[String, String]
List[String] String |
["from_date", "to_date"]
["days/weeks/months"] "days/weeks/months" |
"duration": ["01-01-2022 14:00", "01-04-2022 15:00"],
"duration": ["1 week"], "duration": "1 week", "duration": "", |
Specific Buyer | List[Boolean, String]
[Boolean] Boolean |
[True, "wallet"]
[False] False |
"specific_buyer": [true, "0xDD135d5be0a23f6daAAE7D2d0580828c9e09402E"],
"specific_buyer": [false], "specific_buyer": false, "specific_buyer": "", |
Quantity * (only for 1+ supplies) | Integer | "quantity": 4
"quantity": "" |
And it gives you something like this: JSON.
When you want to sell your NFTs, Opensea requires various details according to their Blockchain or supply number.
Ethereum | Polygon | ||||||||||||||||||||
Supply number equal to 1 | Supply number higher than 1 | Supply number equal to 1 | Supply number higher than 1 | ||||||||||||||||||
Fixed Price | Timed Auction | ||||||||||||||||||||
Sell to highest bidder | Sell with declining price | ||||||||||||||||||||
Price (ETH) | Duration (from a date to an other date or 1 day, 3 days, 1 week, 6 months) | Reserve for a specific buyer | Price (ETH) | Duration (from a date to an other date or 1 day, 3 days, 1 week) | (Optional) Reserved Price (WETH) greater than 1 WETH and greater than Starting Price. | Reserve for a specific buyer | Starting Price (ETH) | Duration (from a date to an other date or 1 day, 3 days, 1 week) | Ending Price (ETH) less than theStarting Price. | Reserve for a specific buyer | Quantity | Price (ETH) | Duration (from a date to an other date or 1 day, 3 days, 1 week, 6 months) | Reserve for a specific buyer | Price (ETH) | Duration (from a date to an other date or 1 day, 3 days, 1 week, 6 months) | Reserve for a specific buyer | Quantity | Price (ETH) | Duration (from a date to an other date or 1 day, 3 days, 1 week, 6 months) | Reserve for a specific buyer |
- Make sure to deposit Ethereum (ETH/WETH) or Polygon (MATIC) on your wallet before proceeding to the sale. Otherwise the bot will cancel the sale.
Opensea needs an Ethereum wallet with more than 0.05 ETH or a Polygon wallet with a deposit of any amount. - The file path should not contain a unique "\". It can be a "/" or a "\\", as you can see for the JSON file (it applies to all file formats):
// You can use this format for your path:
"file_path": "C:/Users/Admin/Desktop/MyNFTs/nft_0001.png",
// or this one:
"file_path": "C:\\Users\\Admin\\Desktop\\MyNFTs\\nft_0001.png",
// but not this one (you can see that "\" is highlighted in red):
"file_path": "C:\Users\Admin\Desktop\MyNFTs\nft_0001.png",
- The bot may crash at the beginning when loading the MetaMask extension (a Selenium module issue), An error like the one below should appear:
selenium.common.exceptions.WebDriverException:
Message: unknown error: failed to wait for extension background page to load:
chrome-extension://nkbihfbeogaeaoehlefnkodbefpgknn/background.html from timeout:
Timed out receiving message from renderer: 10.000
- When lauching the webdriver, Selenium can raise an exception:
driver = webdriver.Chrome(service=Service( # DeprecationWarning using
TypeError: WebDriver.init() got an unexpected keyword argument 'service'
You must update your Selenium version to 4.1.0 or higher by typing in the command prompt:
pip install selenium --upgrade
You can now verify that a more recent version of Selenium is installed by typing:
pip show selenium