onebox/lib/onebox/engine/amazon_onebox.rb at main · discourse/onebox · GitHub is correct file to modify.
The best would be to clone the onebox library GitHub - discourse/onebox: (DEPRECATED) A gem for turning URLs into website previews · GitHub (run bundle install inside your onebox directory after cloning).
After that you can change the code and run bundle exec rake server to preview changes in the browser on localhost:9000