Comments (11)
This is probably linked to this: praw-dev/praw#726
from draw.
Thanks for the issue @StefanLobbenmeier!
The reason why there's not getters for each property is that Reddit doesn't have a complete listing of the possible properties and the API doesn't consistently return the same properties for each request. The getters that are there are the ones which I've seen consistently, but they're by no means a complete set.
Do you happen to know what the different types of content can be? If so, I'm happy to accept pull requests or design input!
from draw.
Sry for the late response. I will look into this, but I am currently concentrating on more basic parts of the API, but I expect I will investigate this further in a few month.
from draw.
I hope you dont mind if I use this issue to document my findings - I want to gather as many examples of media before thinking about a good design.
from draw.
gyfcat (link has video, other metadata available)
media_embed: {content: <iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fconstantdecimalkarakul&url=https%3A%2F%2Fgfycat.com%2Fconstantdecimalkarakul&image=https%3A%2F%2Fthumbs.gfycat.com%2FConstantDecimalKarakul-size_restricted.gif&key=ed8fa8699ce04833838e66ce79ba05f1&type=text%2Fhtml&schema=gfycat" width="600" height="338" scrolling="no" frameborder="0" allow="autoplay; fullscreen" allowfullscreen="true"></iframe>, width: 600, scrolling: false, height: 338}
secure_media: {type: gfycat.com, oembed: {provider_url: https://gfycat.com, description: Watch xD GIF by @tomyhy on Gfycat. Discover more related GIFs on Gfycat, title: xD, thumbnail_width: 444, height: 338, width: 600, html: <iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fconstantdecimalkarakul&url=https%3A%2F%2Fgfycat.com%2Fconstantdecimalkarakul&image=https%3A%2F%2Fthumbs.gfycat.com%2FConstantDecimalKarakul-size_restricted.gif&key=ed8fa8699ce04833838e66ce79ba05f1&type=text%2Fhtml&schema=gfycat" width="600" height="338" scrolling="no" frameborder="0" allow="autoplay; fullscreen" allowfullscreen="true"></iframe>, version: 1.0, provider_name: Gfycat, thumbnail_url: https://thumbs.gfycat.com/ConstantDecimalKarakul-size_restricted.gif, type: video, thumbnail_height: 250}}
is_reddit_media_domain: false
secure_media_embed: {content: <iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fconstantdecimalkarakul&url=https%3A%2F%2Fgfycat.com%2Fconstantdecimalkarakul&image=https%3A%2F%2Fthumbs.gfycat.com%2FConstantDecimalKarakul-size_restricted.gif&key=ed8fa8699ce04833838e66ce79ba05f1&type=text%2Fhtml&schema=gfycat" width="600" height="338" scrolling="no" frameborder="0" allow="autoplay; fullscreen" allowfullscreen="true"></iframe>, width: 600, scrolling: false, media_domain_url: https://www.redditmedia.com/mediaembed/7s6y7w, height: 338}
media_only: false
url: https://gfycat.com/ConstantDecimalKarakul
media: {type: gfycat.com, oembed: {provider_url: https://gfycat.com, description: Watch xD GIF by @tomyhy on Gfycat. Discover more related GIFs on Gfycat, title: xD, thumbnail_width: 444, height: 338, width: 600, html: <iframe class="embedly-embed" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fconstantdecimalkarakul&url=https%3A%2F%2Fgfycat.com%2Fconstantdecimalkarakul&image=https%3A%2F%2Fthumbs.gfycat.com%2FConstantDecimalKarakul-size_restricted.gif&key=ed8fa8699ce04833838e66ce79ba05f1&type=text%2Fhtml&schema=gfycat" width="600" height="338" scrolling="no" frameborder="0" allow="autoplay; fullscreen" allowfullscreen="true"></iframe>, version: 1.0, provider_name: Gfycat, thumbnail_url: https://thumbs.gfycat.com/ConstantDecimalKarakul-size_restricted.gif, type: video, thumbnail_height: 250}}
from draw.
imgur (link has video, no other data):
media_embed: {}
secure_media: null
is_reddit_media_domain: false
secure_media_embed: {}
media_only: false
url: https://i.imgur.com/4a3Ch82.gifv
media: null
from draw.
Reddit video
media_embed: {}
secure_media: {reddit_video: {fallback_url: https://v.redd.it/yaydjqjx91o21/DASH_1080?source=fallback, height: 1080, width: 540, scrubber_media_url: https://v.redd.it/yaydjqjx91o21/DASH_240, dash_url: https://v.redd.it/yaydjqjx91o21/DASHPlaylist.mpd, duration: 14, hls_url: https://v.redd.it/yaydjqjx91o21/HLSPlaylist.m3u8, is_gif: false, transcoding_status: completed}}
is_reddit_media_domain: true
secure_media_embed: {}
media_only: false
url: https://v.redd.it/yaydjqjx91o21
media: {reddit_video: {fallback_url: https://v.redd.it/yaydjqjx91o21/DASH_1080?source=fallback, height: 1080, width: 540, scrubber_media_url: https://v.redd.it/yaydjqjx91o21/DASH_240, dash_url: https://v.redd.it/yaydjqjx91o21/DASHPlaylist.mpd, duration: 14, hls_url: https://v.redd.it/yaydjqjx91o21/HLSPlaylist.m3u8, is_gif: false, transcoding_status: completed}}
from draw.
Youtube
media_embed: {content: <iframe width="600" height="338" src="https://www.youtube.com/embed/coR4Y-DkrLc?feature=oembed&enablejsapi=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>, width: 600, scrolling: false, height: 338}
secure_media: {type: youtube.com, oembed: {provider_url: https://www.youtube.com/, version: 1.0, title: Pagination in Flutter using Firebase's Cloud Firestore, type: video, thumbnail_width: 480, height: 338, width: 600, html: <iframe width="600" height="338" src="https://www.youtube.com/embed/coR4Y-DkrLc?feature=oembed&enablejsapi=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>, author_name: Samarth Agarwal, provider_name: YouTube, thumbnail_url: https://i.ytimg.com/vi/coR4Y-DkrLc/hqdefault.jpg, thumbnail_height: 360, author_url: https://www.youtube.com/user/thesamarthagarwal}}
is_reddit_media_domain: false
secure_media_embed: {content: <iframe width="600" height="338" src="https://www.youtube.com/embed/coR4Y-DkrLc?feature=oembed&enablejsapi=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>, width: 600, scrolling: false, media_domain_url: https://www.redditmedia.com/mediaembed/b4ap7n, height: 338}
media_only: false
url: https://www.youtube.com/watch?v=coR4Y-DkrLc
media: {type: youtube.com, oembed: {provider_url: https://www.youtube.com/, version: 1.0, title: Pagination in Flutter using Firebase's Cloud Firestore, type: video, thumbnail_width: 480, height: 338, width: 600, html: <iframe width="600" height="338" src="https://www.youtube.com/embed/coR4Y-DkrLc?feature=oembed&enablejsapi=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>, author_name: Samarth Agarwal, provider_name: YouTube, thumbnail_url: https://i.ytimg.com/vi/coR4Y-DkrLc/hqdefault.jpg, thumbnail_height: 360, author_url: https://www.youtube.com/user/thesamarthagarwal}}
from draw.
I hope you dont mind if I use this issue to document my findings - I want to gather as many examples of media before thinking about a good design.
Not a problem! Sorry I haven't had more time to work on this myself. Hopefully I can spend some more time on this soon...
from draw.
Adding to @StefanLobbenmeier examples of media. This gfycat example has
"reddit_video_preview": {
"fallback_url": "https://v.redd.it/7fpx9a4xvi431/DASH_360",
"height": 360,
"width": 640,
"scrubber_media_url": "https://v.redd.it/7fpx9a4xvi431/DASH_96",
"dash_url": "https://v.redd.it/7fpx9a4xvi431/DASHPlaylist.mpd",
"duration": 61,
"hls_url": "https://v.redd.it/7fpx9a4xvi431/HLSPlaylist.m3u8",
"is_gif": true,
"transcoding_status": "completed"
},
Which has a link to the video/gif
from draw.
@donovanrost Thanks for the input :) I actually decided against pursuing this issue further, since I can get away with basically ignoring the fields and only working with the url. I use this library (shameless plug, its my own) to convert them https://github.com/StefanLobbenmeier/video_provider and the mp4 gives me all the metadata I need. Will close for now.
from draw.
Related Issues (20)
- Some questions regarding authentication. HOT 3
- No field for rewarder karma HOT 1
- Cast error on vote
- Subreddit Submit Unhandled Exception: type '_InternalLinkedHashMap<String, String?>' is not a subtype of type 'Map<String, String>' in type cast HOT 4
- Some tests for this package fail in sound null-safety mode HOT 6
- Investigate web authentication test failure HOT 1
- Good way to get only comments HOT 3
- Bugs with comment api. HOT 1
- TypeError when accessing "variants" property of "Submission" object HOT 2
- Get other information such as icon_img HOT 1
- how to get subreddit icon like in PRAW HOT 2
- Redirect doesn't work? HOT 1
- SubredditRef promotion to Subreddit HOT 1
- Getting the authenticated user's subreddits, no `after` param?
- Next release? HOT 1
- Invalid OAuth response for "https://www.reddit.com/api/v1/access_token": required parameter "error" was not a string, was "400". HOT 5
- Unhandled Exception: LateInitializationError: Field '_infoPath@xxxxx' has not been initialized.
- "The authorization URL has not yet been generated." after auth.authorize
- submit media HOT 4
- Search by keyword
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from draw.