ILiedAboutCake / OverRustle

This version of the site is abandoned, check Rustla2
https://github.com/ILiedAboutCake/Rustla2
10 stars 7 forks source link

Show Stream preview thumbnails in /strims #25

Closed hayksaakian closed 9 years ago

hayksaakian commented 10 years ago

Notes from various apis:

all apis assumed stream is live

twitch https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel

endpoint:

api.twitch.tv/kraken/streams/CHANNEL_NAME

json:

image_url = json.stream.preview.large

hitbox http://developers.hitbox.tv/media

endpoint:

api.hitbox.tv/media/stream/CHANNEL_NAME

json:

image_url = "edge.sf.hitbox.tv" + json.livestream[0].media_thumbnail_large

http://static/img/media/live/newlegacyinc_large_000.jpg

ustream http://ustream.github.io/api-docs/channel.html

endpoint:

https://api.ustream.tv/channels/CHANNEL_IDjson

json

image_url = json.channel.thumbnail.live

those seem like the most popular platforms, so let's start with them.

Notes:

hayksaakian commented 9 years ago

We now support thumbnails for everything except Castamp and MLG

Castamp would require some kind of scraping hack since they don't have an API. Do they even have thumbnails?

MLG only provides these fields via API, but maybe there's some API we don't know about

"Only allowed fields are: id, name, slug, subtitle, description, stream_name, type, default_tab, send_tweet, send_email, send_push_notification, is_hidden, chat_is_disabled, bracket_url, image_1_1, image_16_9, image_16_9_small, image_16_9_medium, image_16_9_large, image_background, social_twitter, url, stream_featured, stream_sort_order, embed_code, mobile_embed_code, tags, tag_names, children, subscription_url, donate_url"

http://www.majorleaguegaming.com/api/channels/all.js?slug=csgo&fields=id,name,slug,subtitle,stream_name,image_16_9_medium,description

hayksaakian commented 9 years ago

get viewer numbers on a specific stream:

$STREAM_NAME usually looks like mlgXYZ (where xyz is some number)

http://streamapi.majorleaguegaming.com/service/streams/status/$STREAM_NAME

get HLS playlists for a specific stream

http://streamapi.majorleaguegaming.com/service/streams/playback/$STREAM_NAME?format=all

hayksaakian commented 9 years ago

placholders:

mlg: http://s3.amazonaws.com/s3.majorleaguegaming.com/tv-category-icons/image_16_9s/95/medium/comingsoon.jpg?1390332269

hayksaakian commented 9 years ago

mlg ready as of

https://github.com/ILiedAboutCake/OverRustle-API/commit/ec7cbfe38d47927ec5d55e363ea4f454a27dbffe

keep in mind the thumbs are going to not really be thumbs, but rather a static image the channel woner chose.

TODO:

Never:

hayksaakian commented 9 years ago

for website screenshots, we're using http://www.page2images.com/my_account/apikey

they have a 3000 api calls / month free tier

hayksaakian commented 9 years ago

punting screenshots