Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR intends to fix #126, preventing lack of copyright information from the API.
I've made quite a few changes to copyright parsing, trying to not break parsing older APODs - i manually verified parsing for a few older ones, and it doesn't seem to break any.
It also cleans up the copyright line before returning it in the 2nd copyright parsing attempt, preventing double spaces and weird/unnecessary newlines (
,
).
\n
) and double/triple spaces (it also checks for explicit NASA credit - if no mentions of "copyright" or "license" have been found in the image credits, and NASA is explicitly credited, it assumes the image to be Public Domain and skips returning copyright information.
i also thought about introducing a "credits" line, specifically for cases like this, where there's no specific license/copyright information present but you still want to attribute the source of the image properly.
feedback is very much appreciated!
side note: the code might not be the best, i don't usually write python, but i tried to document it well enough for others to be able to understand it :3