Add support for HTML5 Video #135
Open
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.
Adjust media_type detection to include embedded
The API fails with at least one type of APOD. Today's APOD, May 18th 2024 is an embedded html5 < video >. The utility.py doesn't recognize it cause it's expecting videos to be iframes.
This new
elifstatement fixes themedia_typeandurlfor APODs that are HTML5 videos embedded directly in the HTML.Before
{ "date": "2025-05-18", "explanation": "What if you could fly over Pluto -- what might you see? The New Horizons spacecraft did just this in 2015 July as it shot past the distant world at a speed of about 80,000 kilometers per hour. Images from this spectacular passage have been color enhanced, vertically scaled, and digitally combined into the featured two-minute time-lapse video. As your journey begins, light dawns on mountains thought to be composed of water ice but colored by frozen nitrogen. Soon, to your right, you see a flat sea of mostly solid nitrogen that has segmented into strange polygons that are thought to have bubbled up from a comparatively warm interior. Craters and ice mountains are common sights below. The video dims and ends over terrain dubbed bladed because it shows 500-meter high ridges separated by kilometer-sized gaps. The robotic New Horizons spacecraft has too much momentum to ever return to Pluto and is now headed out of our Solar System.", "media_type": "other", "service_version": "v1", "title": "Pluto Flyover from New Horizons" }After (With this change)
{ "date": "2025-05-18", "explanation": "What if you could fly over Pluto -- what might you see? The New Horizons spacecraft did just this in 2015 July as it shot past the distant world at a speed of about 80,000 kilometers per hour. Images from this spectacular passage have been color enhanced, vertically scaled, and digitally combined into the featured two-minute time-lapse video. As your journey begins, light dawns on mountains thought to be composed of water ice but colored by frozen nitrogen. Soon, to your right, you see a flat sea of mostly solid nitrogen that has segmented into strange polygons that are thought to have bubbled up from a comparatively warm interior. Craters and ice mountains are common sights below. The video dims and ends over terrain dubbed bladed because it shows 500-meter high ridges separated by kilometer-sized gaps. The robotic New Horizons spacecraft has too much momentum to ever return to Pluto and is now headed out of our Solar System.", "media_type": "video", "service_version": "v1", "title": "Pluto Flyover from New Horizons", "url": "https://apod.nasa.gov/apod/image/2505/PlutoFlyover_NewHorizons.mp4" }Related issues
I believe this issue is described in this issue and this PR will fix it.