Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requires a mechanism for resuming or retrying #11

Open
Desgard opened this issue Apr 19, 2022 · 1 comment
Open

Requires a mechanism for resuming or retrying #11

Desgard opened this issue Apr 19, 2022 · 1 comment

Comments

@Desgard
Copy link

Desgard commented Apr 19, 2022

Because Opensea's service is unstable, I always encounter failures when downloading. An endpoint resume or retry mechanism may be required to guarantee a complete download.

$ rake COLLECTION_NAME="crypto-phunks" OPENSEA_API_KEY="SNIP"
bundle exec ruby downloader.rb
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=0
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=50
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=100
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=150
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=200
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=250
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=300
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=350
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=400
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=450
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=500
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=550
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=600
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=650
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=700
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=750
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=800
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=850
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=900
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=950
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=1000
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=1050
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=1100
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=1150
https://api.opensea.io/api/v1/assets?order_direction=desc&limit=50&collection=crypto-phunks&offset=1200
Traceback (most recent call last):
	38: from downloader.rb:75:in `<main>'
	37: from downloader.rb:72:in `main'
	36: from downloader.rb:22:in `fetch_batch'
	35: from downloader.rb:22:in `fetch_batch'
	34: from downloader.rb:22:in `fetch_batch'
	33: from downloader.rb:22:in `fetch_batch'
	32: from downloader.rb:22:in `fetch_batch'
	31: from downloader.rb:22:in `fetch_batch'
	30: from downloader.rb:22:in `fetch_batch'
	29: from downloader.rb:22:in `fetch_batch'
	28: from downloader.rb:22:in `fetch_batch'
	27: from downloader.rb:22:in `fetch_batch'
	26: from downloader.rb:22:in `fetch_batch'
	25: from downloader.rb:22:in `fetch_batch'
	24: from downloader.rb:22:in `fetch_batch'
	23: from downloader.rb:22:in `fetch_batch'
	22: from downloader.rb:22:in `fetch_batch'
	21: from downloader.rb:22:in `fetch_batch'
	20: from downloader.rb:22:in `fetch_batch'
	19: from downloader.rb:22:in `fetch_batch'
	18: from downloader.rb:22:in `fetch_batch'
	17: from downloader.rb:22:in `fetch_batch'
	16: from downloader.rb:22:in `fetch_batch'
	15: from downloader.rb:22:in `fetch_batch'
	14: from downloader.rb:22:in `fetch_batch'
	13: from downloader.rb:22:in `fetch_batch'
	12: from downloader.rb:20:in `fetch_batch'
	11: from downloader.rb:46:in `download_images'
	10: from downloader.rb:46:in `each'
	 9: from downloader.rb:47:in `block in download_images'
	 8: from downloader.rb:53:in `download_image'
	 7: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon.rb:250:in `get'
	 6: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/connection.rb:282:in `request'
	 5: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/connection.rb:451:in `response'
	 4: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/middlewares/response_parser.rb:7:in `response_call'
	 3: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/response.rb:63:in `parse'
	 2: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/response.rb:63:in `loop'
	 1: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/response.rb:64:in `block in parse'
/Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/socket.rb:65:in `readline': EOFError (EOFError)
	38: from downloader.rb:75:in `<main>'
	37: from downloader.rb:72:in `main'
	36: from downloader.rb:22:in `fetch_batch'
	35: from downloader.rb:22:in `fetch_batch'
	34: from downloader.rb:22:in `fetch_batch'
	33: from downloader.rb:22:in `fetch_batch'
	32: from downloader.rb:22:in `fetch_batch'
	31: from downloader.rb:22:in `fetch_batch'
	30: from downloader.rb:22:in `fetch_batch'
	29: from downloader.rb:22:in `fetch_batch'
	28: from downloader.rb:22:in `fetch_batch'
	27: from downloader.rb:22:in `fetch_batch'
	26: from downloader.rb:22:in `fetch_batch'
	25: from downloader.rb:22:in `fetch_batch'
	24: from downloader.rb:22:in `fetch_batch'
	23: from downloader.rb:22:in `fetch_batch'
	22: from downloader.rb:22:in `fetch_batch'
	21: from downloader.rb:22:in `fetch_batch'
	20: from downloader.rb:22:in `fetch_batch'
	19: from downloader.rb:22:in `fetch_batch'
	18: from downloader.rb:22:in `fetch_batch'
	17: from downloader.rb:22:in `fetch_batch'
	16: from downloader.rb:22:in `fetch_batch'
	15: from downloader.rb:22:in `fetch_batch'
	14: from downloader.rb:22:in `fetch_batch'
	13: from downloader.rb:22:in `fetch_batch'
	12: from downloader.rb:20:in `fetch_batch'
	11: from downloader.rb:46:in `download_images'
	10: from downloader.rb:46:in `each'
	 9: from downloader.rb:47:in `block in download_images'
	 8: from downloader.rb:53:in `download_image'
	 7: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon.rb:250:in `get'
	 6: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/connection.rb:282:in `request'
	 5: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/connection.rb:451:in `response'
	 4: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/middlewares/response_parser.rb:7:in `response_call'
	 3: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/response.rb:63:in `parse'
	 2: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/response.rb:63:in `loop'
	 1: from /Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/response.rb:64:in `block in parse'
/Users/harry/.rvm/gems/ruby-2.7.5/gems/excon-0.87.0/lib/excon/socket.rb:65:in `readline': EOFError (EOFError) (Excon::Error::Socket)
rake aborted!
Command failed with status (1): [bundle exec ruby downloader.rb...]
/Users/harry/Desktop/blockchain/opensea-images-downloader/Rakefile:3:in `block in <top (required)>'
/Users/harry/.rvm/gems/ruby-2.7.5/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/Users/harry/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in `eval'
/Users/harry/.rvm/gems/ruby-2.7.5/bin/ruby_executable_hooks:22:in `<main>'
Tasks: TOP => default => run
(See full trace by running task with --trace)
@ghost
Copy link

ghost commented Apr 26, 2022

1+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant