Skip to main content

A Wrapper for Hermicraft Video API

Project description

Hermitcraft Video API

This is a python wrapper for the Hermitcraft.com api, that supports retrieving data for hermits and their videos.

The Site was created by hypnotised, and the api is used within the site to get the latest videos and see when hermits are live. This uses those api endpoints allowing us to get the data that the site uses.

Getting started

Go ahead and import the library.

import hermitcraftvideos

Next, we get a hermit from the api. Let's use Xisumavoid for this example.

hermit = hermitcraftvideos.getHermit("xisumavoid")

Make sure that you use the right name. It needs to be the EXACT channel name in the youtube URL in lower case. Example: Mumbo --> https://www.youtube.com/user/ThatMumboJumbo --> thatmumbojumbo

How we have our hermit from the api, we can find out data.

Such as a profile picture

print(hermit.picture) #https://yt3.ggpht.com/-x5tq4dTokyM/AAAAAAAAAAI/AAAAAAAAAAA/x4s30KOqUVA/s88-c-k-no/photo.jpg

Or we can find out a twitter:

print("@{} - {}".format(hermit.twitter.name,hermit.twitter.url)) #@xisumavoid - https://twitter.com/xisumavoid

Or better, if they are live on youtube, twitch or mixer(beam)

print(hermit.youtube.live) #False
print(hermit.twitch.live) #True
print(hermit.mixer.live) #False

We can also get videos!

videos = hermit.getVideos()

You can get simple data from the video

video = videos[0]
print(video.title) #Hermitcraft VI 712 Already Its The End!

And Some handy data

print("video is {} mins long".format(video.duration_time)) #video is 22:49 mins long
print("uploaded {}".format(video.uploaded_time)) #uploaded 7 hours ago 

Oooooh. Statistics

print(video.views) #44430
print(video.likes) # 2785

Oooooooooooooooooooooooooooooooooooooh. Updated Statistics

video.update()
print(video.views) #44440
print(video.likes) # 2790

And That's Mostly it. You can also get a jumble of videos with

hermitcraftvideos.getLatestVideos()

API Reference

Soon!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermitcraftvideos-0.1.1.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

hermitcraftvideos-0.1.1-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page