WordPress / openverse-api

The Openverse API allows programmatic access to search for CC-licensed and public domain digital media.

Home Page:https://api.openverse.engineering/v1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace the old CC `BASE_URL` of media reports

krysal opened this issue · comments

Description

Currently, the media reports appear in the Django Admin with a URL from Creative Commons, meaning that when you click on the link it will count as a referrer from the old CC Search site, which is not true. The BASE_URL should be https://wordpress.org/openverse/.

This can be fixed by editing the following line.

BASE_URL = "https://search.creativecommons.org/"

And potentially and preferably we can centralize this constant in the settings.py file for the example responses as well.

origin = os.getenv("AUDIO_REQ_ORIGIN", "https://api.openverse.engineering")

origin = os.getenv("AUDIO_REQ_ORIGIN", "https://api.openverse.engineering")

Reproduction

  1. Run just up to bring up the API
  2. Pick any id from http://localhost:50280/v1/audio/ (or from the image list)
  3. Replace <uuid> with the id previously selected and create a media report with:
curl -X POST \
	-H 'Content-Type: application/json' \
	-d '{
		"mediaType":"audio",
		"identifier":"<uuid>",
		"reason":"other",
		"description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse blandit id felis sed imperdiet. Integer tristique nisi et metus sollicitudin."
	}'\
	http://localhost:50280/v1/audio/<uuid>/report/
  1. Go to http://localhost:50280/admin/api/audioreport/ The user & pass for the local API is deploy
  2. See the wrong URL under the "Audio url" column.

Screenshots

CleanShot 2022-10-03 at 12 41 28@2x

Hi @krysal BASE_URL should be replaced by which URL? Clicking on the BASE_URL appears as a referrer https://wordpress.org/openverse/?referrer=creativecommons.org here.
Is it https://wordpress.org/openverse/?

@swapnalshahil That's correct! Sorry I forgot to mention the new URL, https://wordpress.org/openverse/ is indeed the new home of Openverse 😄 Do you want to try to solve this issue? I can assign it to you.