Coder Social home page Coder Social logo

opensea-nft-stealer's Issues

[BUG]

Traceback (most recent call last):
File "C:/Users/Kemal/Desktop/OpenSea-NFT-Stealer-master/OpenSea-NFT-Stealer-master/opensea.py", line 135, in
image_url = ipfs_resolve(image_url).url
File "C:/Users/Kemal/Desktop/OpenSea-NFT-Stealer-master/OpenSea-NFT-Stealer-master/opensea.py", line 92, in ipfs_resolve
cid = image_url.removeprefix("ipfs://")
AttributeError: 'str' object has no attribute 'removeprefix'

this error, some collections work, some give this exact error . thanks for your great code

Script Worked last night with @NtekShadow 's fix now im getting same error again. "Traceback (most recent call last):" lines 62 346 337 355

worked last night now im back to getting same errors again did i do everything right?

# Define variables for statistics
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36'
}
stats = {
"DownloadedData": 0,
"AlreadyDownloadedData": 0,
"DownloadedImages": 0,
"AlreadyDownloadedImages": 0,
"FailedImages": 0
}

# Iterate through every unit
for i in range(iter):
offset = i * 50
data = json.loads(requests.get(
f"https://api.opensea.io/api/v1/assets?order_direction=asc&offset={offset}"
f"&limit=50&collection={CollectionName}&format=json", headers=headers).content.decode())

if "assets" in data:
for asset in data["assets"]:
formatted_number = f"{int(asset['token_id']):04d}"

Error while running opensea.py

I installed the requirements.txt but when I run the file opensea.py I keep getting this error

Traceback (most recent call last):
File "C:\Users\S\Desktop\OpenSea-NFT-Stealer-master\opensea.py", line 1, in
import requests
ModuleNotFoundError: No module named 'requests'

Null

Used Notepad++ to change the collection, double clicked to see a brief black terminal appear for a split second then nothing occurs.

Don't working

Traceback (most recent call last):
File "d:\Users****\Desktop*\OpenSea-NFT-Stealer\opensea.py", line 71, in
data = json.loads(requests.get(f"https://api.opensea.io/api/v1/assets?order_direction=asc&offset={offset}&limit=50&collection={CollectionName}&format=json", headers=headers).content.decode())
File "C:\Program Files\Python310\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Program Files\Python310\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Program Files\Python310\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

????

i have add "Accept": "application/json"

[BUG] 'str' object has no attribute 'removeprefix'

The script downloads 15 images from lazy-lions and then errors at #16. However, it downloaded over 1,000 images from a separate collection just fine. I'm on mac, if that matters.

Terminal output

#0011:
  Data  -> [✓] (Successfully downloaded)
  Image -> [✓] (Successfully downloaded)

#0012:
  Data  -> [✓] (Successfully downloaded)
  Image -> [✓] (Successfully downloaded)

#0013:
  Data  -> [✓] (Successfully downloaded)
  Image -> [✓] (Successfully downloaded)

#0014:
  Data  -> [✓] (Successfully downloaded)
  Image -> [✓] (Successfully downloaded)

#0015:
  Data  -> [✓] (Successfully downloaded)
  Image -> [✓] (Successfully downloaded)

#0016:
  Data  -> [✓] (Successfully downloaded)
Traceback (most recent call last):
  File "main.py", line 134, in <module>
    image_url = ipfs_resolve(image_url).url
  File "main.py", line 91, in ipfs_resolve
    cid = image_url.removeprefix("ipfs://")
AttributeError: 'str' object has no attribute 'removeprefix'

I tried other fixes on this repo, but nothing seems to work.

Image Size - High / Low

When I use a previous version of this script it pumps out 4000x4000px images.
When I use the latest version of this script the images come out at 512x512px.
This is running the scripts on the same collection.

I wonder if this was a decision that was made?
The new script runs a lot faster and hangs up less, however because I am creating a massive poster graphic collage of all the images, for this I prefer the larger images and will wait longer for the script to run as necessary.

If there was a change made in how the images are downloaded, I wonder if both options could be made available when running the script? eg. download High OR Low Res images...

"python3 opensea.py collection-name HIGH" something like that?!?!?

Cheers.

SSLCertVerificationError

Describe the bug
Not able to run the script

The collection you were trying to download
Any Random collection for test

Expected behavior
It should download

Terminal output (please show the error that the console showed)

(Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

Error when running on windows

Ive updated to the newest python with requests installed and when I run it from the IDLE or on its own it gives me an error:

Traceback (most recent call last):
File "D:\Downloads\OpenSea-NFT-Stealer-master\opensea.py", line 1, in
import requests
ModuleNotFoundError: No module named 'requests'

Ive restarted after updating and running it again but doesn't run. I get an error and it just closes out on its own.

Script stops on ~400th item, unexpectedly...

Describe the bug

everything seemed to chug along fine for about 400 images... then what might be an inconsistency in an item record?! stops the process... altogether

if this cant be fixed quickly, perhaps there a simple way to adjust the script to start on item eg 404, so as to collect all other items... me no gud coder :P cheers

The collection you were trying to download

https://opensea.io/collection/council-of-kingz-official

Expected behavior

download the image/json of the NFT

Terminal output (please show the error that the console showed)

#0403:
Data -> [✓] (Already Downloaded)
Traceback (most recent call last):
File "D:\xxxxxxxxxx\OpenSea-NFT-Stealer-master\opensea.py", line 142, in
image = requests.get(image_url)
File "C:\Users\xxxxxxxxxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\xxxxxxxxxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\xxxxxxxxxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\sessions.py", line 515, in request
prep = self.prepare_request(req)
File "C:\Users\xxxxxxxxxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\sessions.py", line 443, in prepare_request
p.prepare(
File "C:\Users\xxxxxxxxxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\models.py", line 318, in prepare
self.prepare_url(url, params)
File "C:\Users\xxxxxxxxxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\models.py", line 392, in prepare_url
raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '': No scheme supplied. Perhaps you meant http://?

Downloading not all items from collection

Hi!
Collection name is CLONE X, there are 18716 items. OS Stealer downloads max 10050 and stops. Tried about 3 times with same result.

I also tried to add starting point in range function, which not helped:

Iterate through every unit
for i in range(201, iter):
offset = i * 50
data = json.loads(requests.get(f"https://api.opensea.io/api/v1/assets?order_direction=asc&offset={offset}&limit=50&collection={CollectionName}&format=json", headers=headers).content.decode())

[BUG] - JSONDecodeError

Describe the bug
A clear and concise description of what the bug is.
this used to work, but today, trying to run python3 opensea.py and getting the following error.

Am i getting throttled from the api?

The collection you were trying to download
alienfrensnft

Expected behavior
A clear and concise description of what you expected to happen.
I expected to see the command run and pull in all of the collection images and data.

Terminal output (please show the error that the console showed)

Beginning download of "alienfrensnft" collection.

Traceback (most recent call last):
  File "/Users/tech/Code/steal/OpenSea-NFT-Stealer/opensea.py", line 106, in <module>
    data = json.loads(requests.get(f"https://api.opensea.io/api/v1/assets?order_direction=asc{token_ids}&limit=50&collection={CollectionName}&format=json", headers=headers).content.decode())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Doesn't download anything

Finished downloading collection.

Statistics
-=-=-=-=-=-

Total of 9979 units in collection "******".

Downloads:

JSON Files ->
0 successfully downloaded
0 already downloaded

Images ->
0 successfully downloaded
0 already downloaded
0 failed

You can find the images in the images/****** folder.
The JSON for each NFT can be found in the images/******/image_data folder.
Press enter to exit...

Just this and it's for every collection

Exception has occurred: InvalidSchema

No connection adapters were found for 'ipfs://QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ'
File "C:\Users\Gaming\Desktop\OpenSea-NFT-Stealer-master\opensea.py", line 98, in
image = requests.get(asset["image_original_url"])

AttributeError: 'str' object has no attribute 'removeprefix'

Beginning download of "boredapeyachtclub" collection.

#0000:
Data -> [✓] (Already Downloaded)
Traceback (most recent call last):
File "opensea.py", line 135, in
image_url = ipfs_resolve(image_url).url
File "opensea.py", line 92, in ipfs_resolve
cid = image_url.removeprefix("ipfs://")
AttributeError: 'str' object has no attribute 'removeprefix'

big problem

Traceback (most recent call last):
File "E:\OpenSea-NFT-Stealer-master\opensea.py", line 97, in
image = requests.get(asset["image_original_url"])
File "C:\Users\lol\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\lol\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\lol\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\lol\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 639, in send

#0000:
Data -> [✓] (Already Downloaded)
adapter = self.get_adapter(url=request.url)
File "C:\Users\lol\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 732, in get_adapter
raise InvalidSchema("No connection adapters were found for {!r}".format(url))
requests.exceptions.InvalidSchema: No connection adapters were found for 'ipfs://QmRRPWG96cmgTn2qSzjwr2qvfNEuhunv6FNeMFGa9bx6mQ'

Process finished with exit code 1

Cannot download "matic" assets

Beginning download of "the-infinite-machine-collections" collection.

Finished downloading collection.

Statistics
-=-=-=-=-=-

Total of 196 units in collection "xxx-xxx-xxx".

Downloads:

JSON Files ->
0 successfully downloaded
0 already downloaded

Images ->
0 successfully downloaded
0 already downloaded
0 failed

It cant take nft form opensea

[BUG] Opensea Shared contract does not find token id

Describe the bug
Token ID of a NFT collection created using OpenSea's shared storefront contract does not have a normal token id (1,2,3...).

Token id is large id (15870050116252419024525470175072539588947014030762753463389720307334746472449, 15870050116252419024525470175072539588947014030762753463389720230368932528129)

The collection you were trying to download
featheredunderdogclub

Expected behavior
We would need check the collection's list of token IDs first, then increment through that array

Terminal output (please show the error that the console showed)

Beginning download of "featheredunderdogclub" collection.



Finished downloading collection.


Statistics
-=-=-=-=-=-

Total of 933 units in collection "featheredunderdogclub".

Downloads:

  JSON Files ->
    0 successfully downloaded
    0 already downloaded

  Images ->
    0 successfully downloaded
    0 already downloaded
    0 failed


You can find the images in the images/featheredunderdogclub folder.
The JSON for each NFT can be found in the images/featheredunderdogclub/image_data folder.

Getting HTTP Status 429 ERROR

I am getting HTTP STATUS 429 ERROR...

Json files are fully downloaded but not all the images are downloaded, only 60 - 80 images.

help pls?

Error when running on windows

Getting an error on line 123.

D:\Downloads\OpenSea-NFT-Stealer-master>python opensea.py invisiblefriends

Beginning download of "invisiblefriends" collection.

Traceback (most recent call last):
File "D:\Downloads\OpenSea-NFT-Stealer-master\opensea.py", line 123, in
data = json.loads(scraper.get(f"https://api.opensea.io/api/v1/assets?order_direction=asc{token_ids}&limit=50"
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Error running script

I get this error when trying to run this script
Traceback (most recent call last): File "C:\Users\17379\Desktop\OpenSea-NFT-Stealer-master\opensea.py", line 60, in <module> data = json.loads(requests.get(f"https://api.opensea.io/api/v1/assets?order_direction=asc&offset={offset}&limit=50&collection={CollectionName}&format=json").content.decode()) File "C:\Users\17379\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Users\17379\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\17379\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

again trackback

Beginning download of "xxxxxxx" collection.

Traceback (most recent call last):
File "/Users/user/Desktop/OpenSea-NFT-Stealer-master/opensea.py", line 101, in
data = json.loads(requests.get(f"https://api.opensea.io/api/v1/assets?order_direction=asc&offset={offset}&limit=50&collection={CollectionName}&format=json", headers=headers).content.decode())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0

When i start the script it instantly close himself

When i start the script it instantly close himself and create the images folder but there is no image in it.

In the image folder created i have the name of the collection folder>image_data but nothing in it like no image are in. How to fix it ?

I double checked, I have all the Prerequisites.

Unable to Download colletction (just creating 0029.json)

Unable to download the boredapeyachtclub, mutant-ape-yacht-club, bored-ape-kennel-club and bored-ape-chemistry-club collection (just creating insert number.json) then stopping with the following output:

:\Users\chris\Desktop\OpenSea-NFT-Stealer-master>py opensea.py boredapeyachtclub

Beginning download of "boredapeyachtclub" collection.

#29:
Data -> [✓] (Successfully downloaded)
Traceback (most recent call last):
File "C:\Users\chris\Desktop\OpenSea-NFT-Stealer-master\opensea.py", line 161, in
image = requests.get(image_url)
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 639, in send
adapter = self.get_adapter(url=request.url)
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 732, in get_adapter
raise InvalidSchema("No connection adapters were found for {!r}".format(url))
requests.exceptions.InvalidSchema: No connection adapters were found for 'ipfs://QmQnps7UF7zCBk2bsANKTuXeeuhVRhxcgWfc3AHq2B6gcc'

Successfully downloaded proof-moonbirds collection (haven't tried more)!

[BUG] Erros, can't even start

Describe the bug
I followed the process for installation, installed requirements, run script and it can't even start
showing errors
https://prnt.sc/6SF4830dRA54

**Terminal output
C:\Users\logde\OneDrive\Desktop\OpenSea-NFT-Stealer-master>py opensea.py lazy-lions

Beginning download of "lazy-lions" collection.

Traceback (most recent call last):
File "C:\Users\logde\OneDrive\Desktop\OpenSea-NFT-Stealer-master\opensea.py", line 124, in
data = json.loads(scraper.get(f"https://api.opensea.io/api/v1/assets?order_direction=asc{token_ids}&limit=50"
File "C:\Users\logde\AppData\Local\Programs\Python\Python310\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\logde\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\logde\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

C:\Users\logde\OneDrive\Desktop\OpenSea-NFT-Stealer-master>**

paste here

Same script for Magic Eden?

Hello! Great script, working like a charm!
Can you modify your script so it can download images from Magic Eden? No API though...

[BUG] Fails on IPFS

Describe the bug
Requests get call fails on getting an IPFS url.

The collection you were trying to download
evmavericks

Expected behavior
Should download images.

Terminal output (please show the error that the console showed)

Traceback (most recent call last):
  File "/Users/xyz/Documents/Draw/OpenSea-NFT-Stealer/opensea.py", line 163, in <module>
    image = requests.get(image_url)
  File "/Users/xyz/.pyenv/versions/3.10.2/lib/python3.10/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/Users/xyz/.pyenv/versions/3.10.2/lib/python3.10/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/xyz/.pyenv/versions/3.10.2/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/xyz/.pyenv/versions/3.10.2/lib/python3.10/site-packages/requests/sessions.py", line 695, in send
    adapter = self.get_adapter(url=request.url)
  File "/Users/xyz/.pyenv/versions/3.10.2/lib/python3.10/site-packages/requests/sessions.py", line 792, in get_adapter
    raise InvalidSchema(f"No connection adapters were found for {url!r}")
requests.exceptions.InvalidSchema: No connection adapters were found for 'ipfs://QmecvpNSiaSSKqvLRVCG3g3r9ifaRh1LgVjzDvDfztVmue'

The fix is simple, the problem is at line 163 of opensea.py, there is a requests get command that precedes the url check for ipfs links. It needs to be moved after the ipfs or fail gracefully.

if not len(image_url) == 0:
       image = requests.get(image_url)

Syntax error for random_user_agents

Describe the bug
I know this might sound very straightforward to many, but for a noob like me it gave me quite a nightmare for a while.
import random_user_agents gives me a syntax error.
I finally realised I had to use import random_user_agent

The collection you were trying to download
Its downloading really great now!

Expected behavior
A clear and concise description of what you expected to happen.

Terminal output (please show the error that the console showed)

paste here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.